惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

N
News and Events Feed by Topic
V
V2EX
博客园 - 【当耐特】
Vercel News
Vercel News
雷峰网
雷峰网
爱范儿
爱范儿
WordPress大学
WordPress大学
云风的 BLOG
云风的 BLOG
S
Securelist
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Microsoft Azure Blog
Microsoft Azure Blog
F
Full Disclosure
有赞技术团队
有赞技术团队
Hugging Face - Blog
Hugging Face - Blog
NISL@THU
NISL@THU
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Attack and Defense Labs
Attack and Defense Labs
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Microsoft Security Blog
Microsoft Security Blog
腾讯CDC
P
Proofpoint News Feed
B
Blog
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
K
Kaspersky official blog
I
InfoQ
Google Online Security Blog
Google Online Security Blog
L
LINUX DO - 最新话题
Project Zero
Project Zero
Engineering at Meta
Engineering at Meta
V
Visual Studio Blog
AI
AI
Schneier on Security
Schneier on Security
B
Blog RSS Feed
T
Tor Project blog
H
Help Net Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LINUX DO - 热门话题
阮一峰的网络日志
阮一峰的网络日志
S
Security @ Cisco Blogs
T
Threat Research - Cisco Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
Cyber Attacks, Cyber Crime and Cyber Security
G
Google Developers Blog
Google DeepMind News
Google DeepMind News
V2EX - 技术
V2EX - 技术
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
A
Arctic Wolf
Webroot Blog
Webroot Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main

Hacker News - Newest: "AI"

AI can't read an investor deck AI as an attorney? Student uses ChatGPT, Gemini to sue UW over alleged racial discrimination Hacking MCP Servers in AI Systems – The Rug Pull: Tool Changes After Approval GitHub - MeepCastana/KubeezCut: Free Web based video editor GitHub - GenAI-Gurus/awesome-eu-ai-act: Curated tools, official sources, OSS, templates, and guides for EU AI Act compliance. Amazon AI Cancelling Webcomics Can AI judge journalism? A Thiel-backed startup says yes, even if it risks chilling whistleblowers Coming soon: 10 Things That Matter in AI Right Now DARPA built an AI to fact-check enemy weapons claims What explains heterogeneity in AI adoption? When AI Meets Muscle: Context-Aware Electrical Stimulation Promises a New Way to Guide Human Movements - Department of Computer Science AI Changed How We Build. It Did Not Change What Matters. Linux rules on using AI-generated code - Copilot is OK, but humans must take 'full responsibility for the… Meta spins up AI version of Mark Zuckerberg to engage with employees Code Mode: Let Your AI Write Programs, Not Just Call Tools | TanStack Blog GitHub - Delavalom/graft: Go framework for building AI agents. Type-safe tools, multi-provider (OpenAI, Anthropic, Gemini, Bedrock), zero vendor SDKs. India's TCS tops estimates, says new AI models did not dent services demand Gen Z's fading AI hype Strong feeling: we are in a folded AI reality GitHub - machinarii/total-recall-catalog: A reference catalog of latest knowledge retrieval, memory & RAG systems GitHub - mensfeld/code-on-incus: Give each AI agent its own isolated machine with root, Docker, and systemd. Active defense detects and stops threats automatically.. Quantization, LoRA, and the 8% Problem: Benchmarking Local LLMs for Production AI Iran war: We spoke to the man making Lego-style AI videos that experts say are powerful propaganda Powell, Bessent discussed Anthropic's Mythos AI cyber threat with major U.S. banks GitHub - immartian/bellamem: Persistent belief-graph memory for AI agents. Retrieves decisive context by importance — not recency, not RAG, not /compact. recursive-mode: The Repo-Native Operating System for AI Engineering After the attack on Sam Altman's home, will AI CEO's go on the offensive? The biggest advance in AI since the LLM Opus 4.6 vs GPT 5.4 One Prompt Unity World Generation Test “AI polls” are fake polls Client Challenge Can AI be a 'child of God'? Inside Anthropic's meeting with Christian leaders How to Switch AI Chatbots and Why You Might Want To GitHub - MattMessinger1/agentic_refund_guardrail: Safe refund policy layer for AI agents — Python + TypeScript. Same behavior, shared tests. Adam/papers/emergent_values_whitepaper.md at master · strangeadvancedmarketing/Adam Ask HN: How do you stop playing 20 questions with your AI coding tools How far can automation and AI support psychotherapy? - @theU GitHub - stagas/rtdiff: realtime git diff gui and AI-assisted commits A History of the Early Years of AI at the University of Edinburgh Why AI Coding Tools Still Feel Stuck on Localhost MSN AI Datacenters Are Becoming Strategic Targets twitter.com Penn Researchers Use AI to Surface Unreported GLP-1 Side Effects in Reddit Posts Show HN: MoodSense AI (ML and FastAPI and Gradio, Deployed on Hugging Face) Moodsense Ai - a Hugging Face Space by aman179102 AI models are terrible at betting on soccer—especially xAI Grok GitHub - xialeistudio/echoic GitHub - HimashaHerath/github-dev-wrapped: AI-powered weekly GitHub activity reports deployed to GitHub Pages GitHub - alejandrobalderas/claude-code-from-source: Architecture, patterns & internals of Anthropic's AI coding agent — reverse-engineered from source maps AI and Tech brief: Ireland ascendant GitHub - Titovilal/context0: Context0 - Never Surrender Training for a Marathon with an AI Coach: What Worked and What Didn't Cyber Pulse: Agentic Intel - Apps on Google Play I Built an AI PR Reviewer That Catches Bugs by Not Looking for Bugs Gen Z workers are so fearful AI will take their job they’re intentionally sabotaging their company’s AI rollout | Fortune How AI Is Reimagining the Game of Golf–For Both Players and Courses GitHub - nattergabriel/reseed: A CLI tool for managing and distributing agent skills across projects Is SVG the final frontier? My AI workflow evolved from prompts to a near-autonomous workflow MLSharp Help - 3DGS Viewer & Generator I put my cognitive field based AI's runtime on GitHub Is Numble the first AI-proof game? A3: Kubernetes for autonomous AI agent fleets | Emergent Principles Deepali Vyas ("The Elite Recruiter") GitHub - msmarkgu/RelayFreeLLM: A restful API designed to route user prompts to various AI model providers. Unionized ProPublica staff are on strike over AI, layoffs, and wages Unleashing the Advantage of Quantum AI We're heading for an AI-fueled 'dementia crisis,' brain scientist warns The AI-Assisted Breach of Mexico's Government Infrastructure [pdf] GitHub - stef41/lmscan: 🔍 Detect AI-generated text and fingerprint which LLM wrote it. Open-source GPTZero alternative. Zero dependencies, works offline. MSN GitHub - visionscaper/collabmem: Enabling long-term collaboration with Agentic AI - building up episodic and world model memory over time with in-context awareness We gave an AI a 3 year retail lease in SF and asked it to make a profit | Andon Labs AI Code is Hollowing Out Open Source, and Maintainers are Looking the Other Way What leaked "SteamGPT" files could mean for the PC gaming platform's use of AI AI is the boss at this retail store. What could go wrong? GitHub - Wuzu11517/agentic-proxy: Local proxy meant to help reduce With Drones, Geophysics and ArtificiaI Intelligence, Researchers Prepare to Do Battle Against Land Mines A Single Operator, Two AI Platforms, Nine Government Agencies: The Full Technical Report 在 Steam 上购买 FriedrichAI: Offline AI 立省 10% GitHub - inevolin/resume-cli: Hit Claude usage limits? Resume any AI coding session elsewhere. Switch tools at zero friction. GitHub - atripati/ark: AI Runtime Kernel — a context operating system for AI agents. Eliminates tool bloat, loads only what’s needed, and gives LLMs their reasoning space back. How to Build a Secure AI PR Reviewer with Claude, GitHub Actions, and JavaScript This Startup Wants You to Pay Up to Talk With AI Versions of Human Experts Intel Arc Pro B70 Brings 32GB VRAM to Local AI for $949 WordPress 7.0: The Good, the AI, and the Still Missing AI on the couch: Anthropic gives Claude 20 hours of psychiatry IatroBench: Pre-Registered Evidence of Iatrogenic Harm from AI Safety Measures AI Agents Know About Supabase. They Don't Always Use It Right. The history and future of AI at Google, with Sundar Pichai Inside an AI‑enabled device code phishing campaign How Meta Used AI to Map Tribal Knowledge in Large-Scale Data Pipelines AI for Systems: Using LLMs to Optimize Database Query Execution Forecasting the Economic Effects of AI Introducing Tinker: Play with AI, bring your ideas to life AI sheds light on an ancient gaming mystery People really hate AI but not as much as Iran—or Democrats | Fortune What is an AI Product Engineer? Phoebe Gates wants her $185 million AI startup to succeed with 'no ties to my privilege or my last name': 'I have a chip on my shoulder' | Fortune
A Mac Studio for Local AI — 6 Months Later
spicyneuron · 2026-04-11 · via Hacker News - Newest: "AI"
Day 3 of chasing a caching bug through a sea of request logs.

The Mac Studio M3 with 512GB of memory is an absurd amount of computer. When I bought one to run 600+ billion parameter language models at home, I knew I was signing up for adventure.

I was already an AI devotee — multiple paid subscriptions, dozens of experiments with Llama and other “small” LLMs. Over time, the possibility of running frontier-class models on my own hardware simply became irresistible.

Still, every review I read about the Mac Studio repeated the same warning: prompt processing on Apple Silicon is too slow for serious LLM work.

Either those reviewers were too early, or I was too stubborn, because I found the bottleneck to be surprisingly negotiable... if you don’t mind sacrificing a few weekends.

Somewhere in the depths of Reddit threads, academic papers, and sparsely documented code, I glimpsed my white whale — Claude Code, powered by local, frontier-class models, running at usable speeds. If local models can do this, they graduate from “expensive hobby” to “actually useful.”

This post is a breadcrumb trail for anyone foolhardy curious enough to try this themselves. Whether it represents victory or Stockholm syndrome, you can decide.

Apple is rarely the cheapest option in any category. But in this fringe use case, I found that a Mac Studio was the only viable option under $10k USD.

Alternatives exist: $50k multi-GPU workstations, DIY Frankenstein servers built from scavenged 3090s, mini-clusters of NVIDIA DGX Sparks.

But uniquely, the Mac Studio is configurable up to 512GB memory1, runs cool and quiet, and won’t trip your circuit breakers at full load.

As for performance, there are broadly three separate questions:

  1. What’s the smartest (read: largest) model that it can run?

  2. How long does it take to respond? (prompt processing or “prefill”)

  3. How fast does it respond? (token generation or “decode”)

On the first dimension, the 512GB Mac Studio is unparalleled, because it can comfortably house the best open weight models currently in existence. Even Kimi K2.5‘s one trillion parameters, compressed optimally, fits with room to spare.

Benchmarks often claim that open models are near parity with the frontier, but in my experience, the gap is slightly wider. To me, the best open models are comparable to API models from 6 to 12 months ago. Still impressive, but 6 months is an eternity in this space!

On the second and third points, I’ll let the numbers speak. Below are results that approximate my day-to-day use cases:

To put these numbers into perspective, even with my slowest model:

  • Simple chat messages get replies within seconds.

  • Asking for edits on this post (~7000 tokens) takes ~30 seconds.

  • Running Claude Code with a moderate system prompt (~16000 tokens) takes ~90 seconds.

And in each case, the response streams at more than 3x my reading speed.

Slower than the APIs? Yes. Unusable? Hardly.

Enough preamble — let’s get concrete. Starting with package management:

These are technically optional, but they make life easier:

Then hf to manage model downloads from Hugging Face:

And finally, Claude Code itself:

By default, macOS caps the GPU to 75% of total memory. That’s a reasonable default, but on a 512GB machine, that wastes ~120GB!

Empirically, I’ve found that 6GB is enough for operating system overhead. I also set iogpu.wired_lwm_mb to 10GB to encourage memory reclamation and compression when things get tight, but it’s unclear whether that makes a difference:

sysctl alone doesn’t persist across reboots and modern macOS silently ignores /etc/sysctl.conf. So we need a Launch Daemon to run this automatically on startup:

Save to /Library/LaunchDaemons/local.increase-gpu-memory.plist and then run:

There are many different apps and open-source servers for running LLMs on Macs. But almost all of them wrap the same two foundational projects: mlx-lm for language models and mlx-vlm for multimodal.

If you’re spending money on this hobby, you might as well stay close to the source. It gives you more room to optimize and a much better sense of how models actually work.

It’s also dead simple with uvx:

This installs the latest mlx-lm, starts a server on localhost, and downloads my Qwen 3.5 quantization from HuggingFace. By default, models are saved to ~/.cache/huggingface/hub.

A couple years ago, llama.cpp would have been a solid option as well, but in 2026, MLX is consistently 10-25% faster.

“Models” plural, because apps like Claude Code increasingly expect multiple models under the hood: a large one for complex tasks, a medium one for when speed matters, and a small one for narrow, one-off utilities.

When selecting models, the important rules of thumb are:

  • More parameters correlates with more intelligence.

  • Speed is proportional to active parameters, not total.

This makes Mixture-of-Experts (MoE) architectures especially attractive. These keep the full model weights in memory (which the Mac Studio has in abundance) while activating only a subset per token (which keeps inference speed usable).

This is how Kimi K2.5‘s massive 1 trillion parameter footprint translates into surprisingly decent speeds — activating only 32 billion at a time.

GLM 5 is a smaller, equally capable model, weighing in at 744 billion. But because it activates 40 billion, it actually runs 20% slower than Kimi.

Qwen 3.5 397B activates 17 billion, roughly half of Kimi’s, and as you might expect, runs roughly twice as fast.

Predictable, once you see the pattern.

Before downloading, there’s one more decision to make — which “quant” to choose?

At a high-level, quantization is simply compression: reducing full precision floats into smaller, more efficient formats. Like other forms of lossy compression, the goal is to get as small as you can without destroying quality.

At a low-level, quantization is PhD territory — obscure acronyms, formal math, endless tradeoffs, and superstitious lore.

My practical takeaways:

  • Hardware matters. For example, older generation M1 and M2 Macs choke on BF16 weights. Future generations may support even more formats.

  • 4-bit is the sweet spot on Apple Silicon. It’s GPU-optimized and a good balance of size and quality.

  • 8-bit is another optimized peak. In most cases, nearly identical quality to full precision, but at half the size.

  • Dynamic or mixed precision is essential for optimization. This means keeping important weights at high precision, while compressing the less sensitive ones more aggressively.

  • Larger models can remain stable at lower quants (< 4-bit), while smaller models need to stay at 4 or above. Quantization-Aware Training (QAT) can also support lower quants.

  • Prefer quants with published, verifiable benchmarks. Measuring quality is impossible with “vibes” alone.

The process for creating and evaluating quants is worth its own post, but you can use my mixed-width MLX quants as a starting point.

mlx_lm.server already has logic for switching between models, but what we actually want is multiple models loaded in parallel, served behind a single API endpoint.2

For this, I use llama-swap. It provides:

  1. A management layer for multiple AI server instances.

  2. A web UI for debugging logs and raw requests.

  3. Centralized settings for generation parameters (ex: temperature, enable_thinking).3

  4. Model aliases and convenience shortcuts.

First, install it:

Then, create a YAML config. The following is my core setup:

  • One small, medium, and large model in parallel.

  • A vision model (accessible via a vision alias).

  • Default to non-thinking mode.

  • *:think aliases to enable thinking mode.

  • Recommended parameter overrides for each model and mode.

And then, to run it:

Visit http://localhost:8080 to see your new API gateway in action.

At ~465GB total and 10GB of KV cache set aside for each model, this is close to the maximum for a 512GB Mac Studio!

I admit, I feel a strange sense of guilt when these bars are not filled.

Stop here and you’d already have a general purpose AI server capable of handling OpenAI-compatible /v1/chat/completions requests. This covers 99% of the apps out there.

But since Claude Code uses Anthropic’s /v1/messages API format, we need a translation layer.

The easiest path is claude-code-router4.

Save the following to ~/.claude-code-router/config.json to wrap our llama-swap API in an Anthropic-flavored proxy:

If you like control, you can start the router and Claude Code independently:

Or if you prefer convenience, just use the built-in shortcut:

Type in a prompt or two, watch the traffic flow through llama-swap, and pour yourself a drink. You now have Claude Code running locally!

Of course “running” and “running at usable speeds” are two different standards. And our naive initial setup fails the speed test.

The first culprit is Claude Code’s sprawling, dynamic system message. Including skills, commands, and tool definitions, it’s often over 20,000 tokens long!

You might think that this system message represents some kind of hyper-optimized prompting masterpiece. But what I found instead was verbose and repetitive.

After several rounds of iteration, I was able to distill it into something much, much leaner:

This is paired with a shell script that appends local environment and context:

And for further gains, we can save thousands more tokens by only passing in tools we actually need:

You can browse the entire tool catalog here, but I’ve found Bash with a few search and editing shortcuts is more than enough.

Combined, these changes take us from 20k tokens to less than 8k. This cuts processing time and stretches your effective context window too.5

I use this slimmed-down version even with cloud Claude — it simply works better.

The textbook solution for expensive operations like prompt processing is caching — calculate once, reuse later. mlx-lm handles this automatically by default.

In the ideal case, each chat turn builds exactly upon the previous one, and we only need to process the new messages (bolded):

Turn 1

system: You are Arthur, King of the Britons. You are carrying: sword, crown, coconuts
user: What is your quest?

Turn 2

system: You are Arthur, King of the Britons. You are carrying: sword, crown, coconuts
user: What is your quest?
assistant: To seek the Holy Grail.
user: What is the airspeed velocity of an unladen swallow?

Turn 3

system: You are Arthur, King of the Britons. You are carrying: sword, crown, coconuts
user: What is your quest?
assistant: To seek the Holy Grail.
user: What is the airspeed velocity of an unladen swallow?
assistant: What do you mean? An African or European swallow?
user: Huh? I don’t know...

But even a single changed character forces us to recalculate the message history from the point of divergence.

And in practice, Claude Code is not a well-behaved app!

For reasons unclear to me, it changes the order of tools and tool arguments in between turns. Or in the example above, “sword, crown, coconuts” might become “crown, coconuts, sword” or “coconuts, crown, sword.”

Since tools are defined at the beginning of each chat, this leads to slow, full reprocessing on every single message. The longer the chat, the longer the wait.

There are multiple ways to fix this, but the easiest place is in the model’s chat template. For example, here’s my edit to the official Qwen 3.5 template, which sorts tools and arguments into a consistent order:

A similar fix could be configured globally on the server or proxy, to avoid needing to patch every model.

With Claude Code tamed, performance is now nearly acceptable.

“Nearly,” because the ability to break prompt caching is not limited to the unruly clients. Models themselves can also create tricky caching dilemmas.

For example, Qwen 3.5 uses dynamic <think> tag placement. Because these are automatically added and removed from history, they always prevent the previous turn’s assistant response from matching:

Turn 1

system: You are Arthur, King of the Britons.
user: What is your quest?

Turn 2

system: You are Arthur, King of the Britons.
user: What is your quest?
assistant: <think>Ah, the classic Bridge of Death scene.</think>To seek the Holy Grail.
user: What is the airspeed velocity of an unladen swallow?

Turn 3

system: You are Arthur, King of the Britons.
user: What is your quest?
assistant: To seek the Holy Grail.
user: What is the airspeed velocity of an unladen swallow?
assistant: <think>The answer is 11 meters per second, but I should stay in character.</think>What do you mean? An African or European swallow?
user: Huh? I don’t know...

Notice how the first assistant message is processed (bolded) twice? That’s because the <think> tag shifted in turn 3.

Redoing the previous message is better than restarting from the beginning, but still a major drag over the course of a multi-turn chat. Unlike fixing tool order though, this issue is inherent to the model’s chat template logic. Changing it would mean deviating from the model’s chat training — not a good idea.

I spent a few days diving into the mlx-lm implementation and eventually came up with a workaround — speculative prompt processing.

As soon as the model responds, calculate how the thinking tags would shift next turn, and immediately start processing up to the point of the new user message.

The extra work still happens, but it gets a head start. So while I’m reading the model’s previous message and drafting up my own response, the server makes use of those seconds to reduce future wait time.

This feature isn’t available in the official mlx-lm release yet, but feel free to comment on the PR or give my fork a try:

Here, deep in the weeds of experimental fixes and unmerged PRs, our guided tour draws to a close. Beyond this lies the true frontier.

By this point, you have a blueprint for setting up a powerful local AI server. Fully-private, no rate limits, no vendor lock-in.

Only one question remains — is it worth it?

For the price of a Mac Studio, I could have bought 1 billion uncached Opus tokens... or 4 years of the $200/month Max plan. And that’s not counting all the hours I spent chasing the whale through git diffs, network logs, and benchmark results.

Yet whenever I see the silver box humming away on my shelf, I feel genuinely proud. Via Claude Code, it aces my merge conflicts. Through my phone’s camera, it processes my bills. In my notes app, it proofreads my drafts.

By 2026 standards, these are mundane feats. But compared to yesterday’s frontier? The models running on my Mac Studio today are at least as capable as Sonnet 3.7... which itself was state-of-the-art just over one year ago.

Local AI definitely isn’t a drop-in replacement for cloud APIs. If you expect everything to work on the first try, you’re bound to be disappointed. But if reading this post intrigued rather than exhausted you — if part of you finds joy in the hunt for solutions — then I hope this helps justify your next hardware splurge. :)

Besides, at the current rate of new model releases, architecture innovations, software and hardware improvements... this expensive hobby might yet pay off.