slotstream README

项目的 README,来自 github.com/carloslfu/slotstream。合并为一个 markdown 文件:README.md。

slotstream

Latest release GitHub stars

Run a 105 GB AI model on a Mac that can't hold it.

Slotstream runs Qwen3.8-Flash-Next, a 125-billion-parameter open model, on Apple Silicon Macs with 16 to 64 GB of memory. It streams experts from SSD and caches them in RAM. The engine is fully native Swift on Apple's MLX and Metal, with no Python runtime or cloud account. Inference works offline after the model download.

Chat, ask about pictures, or connect a coding agent. Slotstream provides a CLI, Ollama-, OpenAI- and Anthropic-compatible APIs, and a Swift library.

Get started · Speed · Guides · About me

Requirements

An Apple Silicon Mac with at least 16 GB of memory, macOS 14 or later, and about 110 GB of free SSD space. Windows, Linux, Intel Macs and 8 GB Macs are unsupported. On 96 GB and larger Macs, engines that keep the model fully in memory report faster replies. See the hardware guide.

Install

Open Terminal and paste:

curl -fsSL https://raw.githubusercontent.com/carloslfu/slotstream/main/install.sh | sh

This installs the latest release, v0.2.30. Run the same command to update. If slotstream isn't found, open a new terminal.

Use it

Check your Mac and ask for a first reply:

slotstream doctor
slotstream run --prompt "Why is the sky blue?"

The first run offers to download the model. It can take hours, but you only need to do it once; interrupted downloads resume. doctor checks your Mac without loading the model. See the step-by-step setup.

To use Claude Code on the local model, install Claude Code separately, then run:

slotstream launch claude

The same command works with codex, pi, opencode and hermes in place of claude. It starts the server if needed and connects the agent. See the coding agent guide for setup.

Speed

Development tests on October 5, 2026 measured 20.91–23.69 tok/s (tokens per second) across three workloads on a 48 GB M5 Pro, using the original 4-bit model at a 33 GB budget. These three-run medians used the archived Mac app's startup settings; they do not measure current CLI defaults or sustained speed. Loading and prompt processing add time; long prompts can take minutes before a reply starts.

See results on real Macs, speed estimates by memory and prompt-processing results for the tables, test conditions and limits.

How it works

The model uses a mixture-of-experts architecture: each token needs only a subset of its expert networks. Slotstream keeps shared weights in RAM and reads the needed experts from SSD into a cache. More cache means fewer disk reads, without removing experts from the model.

Swift owns the runtime, memory planner and cache; MLX and Metal do the GPU work. Auto mode chooses a memory budget and context window for your Mac, then adjusts the cache as other apps need room. The engineering guide explains the design.

Who made this

I'm Carlos Galarza. I build local AI and make it run efficiently on the computers people already own. Slotstream is written natively for the Mac and tuned as one system.

I also build AI agents and help teams with AI engineering, from integrating models into products to debugging agent workflows. For help or consulting, email me.

Guides

What you want to do Guide
Install, download the model or ask about a picture Get started
Connect Open WebUI or another chat app Chat apps
Use Claude Code, Codex, Pi, opencode, Hermes or fx Coding agents, fx
Check speed, memory or context on your Mac Hardware and speed
Use the APIs or Swift library, build or test Engineering
Fix a problem, move the model or uninstall Troubleshooting

Apps and agents supply the interface and tools; install them separately. Release notes describe what's changed.

Status and limits

The Mac app and Fast/Q2 models are archived. Current work focuses on the engine, CLI, serving APIs and Swift library.

FAQ

Does it work offline?

Yes, after the model download. Connected agents may still use internet services for their tools; their settings determine what those tools send.

Why doesn't Slotstream use all of my RAM?

The budget leaves room for macOS, other apps and temporary model work. You can preview a different budget with slotstream doctor --memory-gb 40. See memory defaults and overrides before changing it.

Will this wear out my SSD?

Generation reads model files without rewriting them. macOS swap and conversation caching do write to disk. See the memory and disk guidance.

For other models or hardware, see related projects.

Why this exists

I wanted to run this model on my own Mac, but the standard loader exhausted memory before producing a reply. The measurements start with that failed load. The project was also discussed on Hacker News.

Support

Report a bug, share your Mac's results, or contribute. Hardware reports are credited to their authors.

Grants and sponsors

Guillermo Rauch's GitHub profile photo
Guillermo Rauch

Slotstream was selected for Guillermo Rauch's personal grants for foundational open-source software. Thank you for supporting its development.

Star history

Slotstream GitHub star history, updated weekly

The badge shows the latest star count; this chart is updated weekly.

License

Slotstream is MIT-licensed. Model weights and included third-party code retain their own licenses, including the model's Qwen community license. See third-party notices and credits.

slotstream (carloslfu/slotstream)

正在搜索数据库…

这是什么?Slotstream 让你在只有 16 到 64 GB 内存的 Mac 上运行一个 105 GB 的 AI 模型(Qwen3.8-Flash-Next,一个 125B 参数的专家混合模型),方法是从 SSD 流式读取模型的大部分内容,并把最繁忙的专家缓存在内存中。
这是独立服务器,还是我要导入的库?它是一个原生 Swift 二进制文件,作为本地服务器运行,暴露 OpenAI 和 Ollama 兼容的 API;同时还提供一个 Swift 库,供想把它嵌入自己应用的开发者使用。
怎么安装和运行它?打开终端并粘贴 README 中的安装命令(以后再次运行会更新 Slotstream),然后运行 doctor 检查并请求第一条回复,这将触发一次性模型下载。
需要先装 Python 或特殊的 GPU 配置吗?不需要 Python——它是一个构建在 MLX 和 Metal(Apple 自家的 GPU 框架)之上的单一原生 Swift 二进制文件,所以你只需要一台 Apple Silicon Mac。
它在任何 Mac 上都能运行吗?你需要 Apple Silicon Mac、macOS 14 或更高版本,以及约 110 GB 的可用 SSD 空间;目前不支持 Windows、Linux 和 Intel Mac,8 GB 内存的 Mac 需要使用交换空间,可能拖慢整台机器。
设置完成后还需要联网吗?不需要,一次性模型下载完成后,推理完全在你的 Mac 上进行;已连接的智能体仍可能为其自身工具(如网页搜索)使用互联网。
我可以用其他模型代替 Qwen3.8-Flash-Next 吗?还不行——加载器和内存规划器是专为这一个模型构建的,目前不支持换成其他模型。
哪些编码智能体和聊天应用能与它配合?由于它暴露 OpenAI 和 Ollama 兼容的 API,它可以配合 Claude Code、Codex、Open WebUI 以及 Hermes 等智能体工具使用。
实际速度有多快?速度很大程度上取决于 Mac:16 GB 的 Mac mini M2 约为 1.4 tok/s,48 GB 的 MacBook Pro M5 Pro 大约 12 tok/s,128 GB 的 MacBook Pro M5 Max 最高约 21-22 tok/s。
即使我有很多空闲内存,它为什么不用尽 Mac 的全部内存?Auto 模式把总内存目标限制在 33 GB(开启投机解码为 34.6 GB),因为测试表明更大的专家缓存带来的速度提升递减;如果你想尝试,可以手动设置更高的目标。
多个应用能同时使用它吗?不能——Slotstream 一次只生成一条回复,因此已连接的应用共享同一个运行中的模型实例。
作者
carloslfu
大小
2.2 GB
星标
673
时长
3个月
提交 · 90 天