Samosa Chat: Run Qwen3.6-35B-A3B Locally on a 16 GB Apple Silicon Mac Samosa Chat, an independent open-source project, enables local execution of Qwen3.6-35B-A3B, a 35-billion-parameter Mixture-of-Experts language model, on a 16 GB Apple Silicon Mac without cloud accounts or telemetry. The tool uses a custom C inference engine with group-32 quantization and an expert cache to fit the model into limited RAM, achieving 5–9 tokens per second on an M3 MacBook Air. Run Qwen3.6-35B-A3B locally on a 16 GB Apple Silicon Mac. In your terminal, or in your browser · Runs on the CPU · No cloud account · No telemetry Credit.Samosa Chat is built on colibrì by JustVugg. Its expert-streaming design, SIMD kernels, and core utility headers made this project possible. The model is the text part of Qwen3.6-35B-A3B , created and released by the Qwen team. Samosa Chat is an independent, unofficial, Apache-2.0 project. It is not affiliated with or endorsed by either team. What Samosa adds:its own Qwen3.6 inference engine in C — the 30 Gated DeltaNet layers, the 10 attention layers, and the routed-expert path — the group-32 quantization format and its converter, the byte-budgeted expert cache that fits 35B parameters into 16 GB, sealed conversations that resume exactly, a local server and browser app, an atomic installer that verifies and rolls back, and the tests around all of it. The full list . A real, unedited recording on the 16 GB M3 MacBook Air — a question in, an answer out, no cloud: Real time, played at normal speed. The pause before the answer is the model loading; after that it writes at about 5–9 tokens per second. curl -fsSL https://huggingface.co/deepanwa/Samosa-Chat-Qwen3.6-35B-A3B-group32/resolve/main/install.sh | sh Then open a new terminal and ask it something: samosa "explain how DNS works" You need an Apple Silicon Mac, 16 GB of RAM, Apple's Command Line Tools for the C compiler , and about 30 GB of free disk. The download is about 24 GB. The installer resumes interrupted downloads, checks the SHA-256 of every file, compiles the C engine on your machine, and smoke-tests it before switching the new release live. A corrupt or interrupted upgrade leaves your existing install untouched. It does not need administrator rights. Everything lives under ~/.samosa , and nothing is installed system-wide: | path | what it is | |---|---| ~/.samosa/bin/samosa | the samosa command itself | ~/.samosa/current | symlink to the active release | ~/.samosa/releases/ | verified releases, kept so an upgrade can roll back | ~/.samosa/chats/ | your saved conversations | The installer adds ~/.samosa/bin to your PATH by appending one line to your shell's rc file ~/.zshrc for zsh, ~/.bashrc for bash, otherwise ~/.profile . That only affects terminals you open afterwards — which is why the step above says to open a new one. If samosa still is not found: make it work in the terminal you already have export PATH="$HOME/.samosa/bin:$PATH" or skip PATH entirely and run it directly ~/.samosa/bin/samosa "how are you" samosa doctor reports which release is active and whether the model, engine, and tokenizer are healthy. To uninstall, delete ~/.samosa and remove that one line from your rc file. The model lives at deepanwa/Samosa-Chat-Qwen3.6-35B-A3B-group32 https://huggingface.co/deepanwa/Samosa-Chat-Qwen3.6-35B-A3B-group32 . Both come from the same install. Pick based on what you want: | |---| Web app the-web-app-a-demo samosa "your question" samosa app the normal way to use Samosa a demo If you just want to chat with the model, use the terminal. It starts instantly, does everything the model can do, and is the interface that gets used day to day. The web app is a demo at this point. It works, and it is the nicest way to watch answers stream in and see the model's reasoning unfold. But it exists to demonstrate the engine, not as a polished product. Do not feel you need it. Samosa Chat runs Qwen's 35-billion-parameter model on a Mac that has only 16 GB of RAM. The model is a Mixture of Experts. It has 35B parameters in total, but it only uses about 3B of them for each token. Samosa never loads all 35B into memory. The shared "dense" weights stay in RAM. The expert weights are read from the SSD as the model chooses which experts each token needs. Samosa runs entirely on the CPU. It does not use Metal or the Apple GPU. You do not need a dedicated GPU. The model is text only. Qwen3.6 can also read images, but Samosa's converted model leaves the image part out. Where it runs. macOS on Apple Silicon arm64 only. It has been tested on one 16 GB M3 MacBook Air. "Runs on the CPU" does not mean it runs on any 16 GB laptop. The installer refuses other systems. Linux and Windows are not supported. This is the main way to use Samosa. Ask a question, get an answer: samosa "explain how a hash table handles collisions" Keep the conversation going with --continue . Your chat resumes from a saved snapshot, so a follow-up does not re-read the whole history: samosa "explain how a hash table handles collisions" samosa --continue "and which strategy does Python use?" samosa --continue "show me the CPython source for that" The rest of the options: samosa --think "solve this logic puzzle" general reasoning samosa --think-code "build a responsive settings page" precise coding profile samosa --fast "summarize this design" all cores, runs warmer samosa --seed 11 "give me a deterministic sample" reproducible sampling samosa --max-tokens 2048 "write a long explanation" change the ceiling samosa --thinking-budget 512 "..." cap internal reasoning samosa doctor check the installation An answer can run up to 8,192 new tokens. That is an outer ceiling, not a target — the model usually stops earlier on its own when it emits its end-of-turn token. Two threads is the default so the Mac stays cool; --fast uses all performance cores and runs warmer. By default the model answers directly. --think and --think-code turn on reasoning, which is slower and reads a lot more from your SSD — see SSD wear ssd-wear-the-one-thing-to-be-deliberate-about before using them heavily. A conversation is capped at 24,576 tokens total saved history + your new message + the answer ceiling . Samosa checks this before it runs and stops rather than growing memory without limit. samosa app starts a local server and opens a chat page in your browser. Everything runs on your machine. The page makes no outside requests. samosa serve start the server in the foreground on 127.0.0.1:8642 samosa app start the server in the background and open the chat page samosa serve --stop stop the server What the app does: - Streams the answer as the model writes it. - Shows the model's thinking separately from its final answer. - Lets you stop a generation at any time. - Saves your conversations so you can continue them later. - Shows live speed tokens per second and current memory use. - Has settings for thinking mode, maximum answer length, and a fixed seed. The server answers these HTTP endpoints: GET /healthz — status, memory use, the context limit, queue state, last speed GET /v1/models POST /v1/chat/completions — reply as JSON, or stream token by token SSE POST /v1/cancel — stop the current generation POST /v1/shutdown — stop the server cleanly Only one request runs at a time. Extra requests wait in a short queue. Stopping an answer is safe. When you stop an answer partway through, Samosa saves the conversation only up to the last complete sentence. This matters: before this fix, if you stopped an answer in the middle of a sentence, the next answer in that chat would copy the cut-off style and reply with only a word or two before stopping. That is now fixed. If a stopped answer has no complete sentence yet, Samosa keeps the previous saved state instead of overwriting it. Context limit. The same 24,576-token cap applies here. The server checks a turn before queueing it and rejects an oversized one before allocating any memory. Only the conversation you are using is loaded into RAM; opening other saved chats does not add to memory. You do not need this to use Samosa — the installer above compiles the engine for you. This is for working on it. make portable CPU build make omp multithreaded build needs libomp on macOS make test run the bounded tests make builds the engine only, and has no Python dependency. To run it you also need the model files and tokenizer: either the published group-32 download above, or your own conversion from the original Qwen checkpoint with tools/convert qwen36.py . With the engine and model in place, samosa serve and samosa app start the server. Full server details and the exact request format are in docs/SERVE API.md /deepanwadhwa/samosa-chat/blob/main/docs/SERVE API.md . Python is only used for conversion, analysis, and testing. It is not needed to run the model. Every decision follows these three goals, in this order: It must be stable on a machine like this one — a 16 GB Apple Silicon Mac. Memory stays bounded. It does not grow without limit. It stops at clear limits instead of crashing. It must be actually useful. Real answers, real code, real multi-turn conversations. Not a demo that only loads. It must not wear out the machine. Keep memory bounded so the system does not swap heavily. Use two threads by default so the Mac stays cool. Be careful with the SSD reads that cause the real wear explained below . A feature is only called "released" once it meets all three. Until then it stays in this repository as source. The Qwen model and the colibrì runtime are the starting point. This repository adds: - A Qwen3.6 text engine written in C. It covers the 30 Gated DeltaNet layers, the 10 gated attention layers, the shared and routed expert path, the tokenizer, and the chat template. - A converter that turns the original Qwen checkpoint into Samosa's format, shard by shard, with a manifest-based container for the expert weights. - Three weight formats: the older whole-row int4, the newer group-32 int4, and an experimental mixed format group int4 for gate/up, row int8 for the down-projection . - CPU math for those formats: Apple NEON dot-product on Apple Silicon, and a portable AVX2 path for other CPUs. - An expert cache that keeps a fixed byte budget in RAM, drops the least-recently-used experts first, keeps a floor per layer, reuses freed memory, watches system memory pressure, and reports its I/O. - Saved conversations QWSESS01 files that are checked against the model geometry, sealed with a SHA-256 hash, written atomically, and can be resumed exactly. - Qwen's published sampling settings for direct, general-thinking, and precise-code modes. - A thinking-budget limit with a clean hand-off to the answer, separate counts for natural versus forced endings, and a guard that stops a repeating token loop. - A local HTTP server in C with no dependencies: JSON or streaming replies, a bounded request queue, cancellation, health reporting, and clean shutdown. - A 32 KB browser chat page with no external scripts, no analytics, and no outside requests, shipped with the Samosa logo. - An installer that verifies and tests a new version in place before switching to it, and rolls back if the new version is bad. - Test tooling for output structure, task correctness, upstream comparisons, the quantized math, route traces, installer rollback, and memory-pressure limits. Samosa uses Qwen's published sampling settings: | mode | temperature | top-p | top-k | presence penalty | thinking budget | |---|---|---|---|---|---| | direct | 0.7 | 0.80 | 20 | 1.5 | off | | general thinking | 1.0 | 0.95 | 20 | 1.5 | 1,024 tokens | | precise code | 0.6 | 0.95 | 20 | 0.0 | 2,048 tokens | The maximum answer length is an outer limit, up to 8,192 new tokens. It is not a fixed length. The model decides when to stop within that limit. If the thinking reaches its budget, Samosa adds Qwen's trained wind-down text before closing the