Local LLM inference for the hardware you already own.
Atomic Engine is an open-source inference engine by AtomicBot, focused on making large mixture-of-experts (MoE) models practical on consumer hardware. Our primary target is a PC with 8 GB of VRAM and 16 GB of system RAM, running a capable local model for coding, agents and everyday work.
Instead of requiring the entire model to fit on the GPU, Atomic Engine makes use of GPU memory, system RAM and SSD-backed weights. The goal is not just to load a large model, but to keep it responsive during real workloads, including long prompts and multi-turn conversations.
Quick start · Benchmarks · Models · Architecture · Documentation · Acknowledgments
- 8 GB GPUs: make large MoE models useful on ordinary gaming PCs and laptops, without a high-end workstation.
- Memory-aware inference: adaptive expert placement, CPU execution for non-resident experts, SSD-backed weights and memory-pressure handling.
- Fast generation: optimized CUDA and Metal execution paths, quantized weights and embedded multi-token prediction (MTP) where supported.
- Long-context workloads: efficient prompt processing, growing KV caches and conversation reuse where supported by the model/backend.
- Local agents: a local HTTP server with OpenAI- and Anthropic-compatible endpoints for integration with existing applications and coding tools.
The engine is under active development. Qwen4-35B-A3B is the primary integration and optimization target documented here. Support, speed and memory usage depend on the exact model, quantization, backend and machine; 8 GB VRAM is a design target, not a universal compatibility guarantee.
Clone this repository:
git clone https://github.com/AtomicBot-ai/atomic-engine.git
cd atomic-engineDownload a Qwen4-35B-A3B GGUF from the AtomicChat model collection. For an 8 GB GPU with 16 GB RAM, start with AD-IQ2_XS (about 24.2 GB on disk). AD-IQ3_S and AD-Q4_K_M-Compact have also been run on the 8 GB test laptop. A fast SSD is recommended.
The examples below allow 32,768 input tokens plus 1,024 output tokens. The native worker's --max-context and the setup wrapper's --context both set the total token limit. Reduce it if your machine is short on memory.
Windows / Linux. Install CMake 3.24 or newer, Ninja, an NVIDIA driver and a compatible CUDA Toolkit. On Windows, install Visual Studio 2022 Build Tools with Desktop development with C++ and use an x64 Developer PowerShell. On Linux, use a CUDA-compatible C++ compiler.
The default CUDA build includes the Qwen4 35B kernels alongside the other models. Build it from the repository root:
cmake -S engine -B build/qwen4-cuda -G Ninja -DCMAKE_BUILD_TYPE=Release -DCMAKE_CUDA_ARCHITECTURES=native -DSTRATA_ENABLE_CUDA=ON -DSTRATA_BUILD_POLY=ON
cmake --build build/qwen4-cuda --target strata-poly -j 4Put the downloaded GGUF in your Models directory under your home folder, or change the model path below.
Windows (PowerShell)
.\build\qwen4-cuda\strata-poly.exe --serve --model "$HOME\Models\Qwen4-35B-A3B-AD-IQ2_XS.gguf" --max-context 33792Linux
./build/qwen4-cuda/strata-poly --serve --model "$HOME/Models/Qwen4-35B-A3B-AD-IQ2_XS.gguf" --max-context 33792The CUDA worker detects the embedded MTP draft when available, chooses prompt batch sizes and adapts expert placement to memory pressure. Leave the expert RAM budget on Auto to start. Add --no-draft to disable MTP. See CUDA settings for manual controls.
Apple Silicon. Install the Xcode command line tools and CMake 3.24 or later. Extract Apple's metal-cpp headers to ~/metal-cpp, so that ~/metal-cpp/Metal/Metal.hpp exists.
cmake -S engine/metal -B build/qwen4-metal \
-DCMAKE_BUILD_TYPE=Release \
-DSTRATA_METAL_POLY=ON \
-DMETAL_CPP_DIR="$HOME/metal-cpp"
cmake --build build/qwen4-metal --target strata-poly -j 6Keep the checkout in place: the binary reads Metal shader sources at runtime.
./build/qwen4-metal/strata-poly --serve --model "$HOME/Models/Qwen4-35B-A3B-AD-IQ2_XS.gguf" --max-context 33792 --qwen4-metal-fast --qwen4-mtp --window 2 --lookup 0The fast Metal path uses incremental expert buffers and spin polling, which can increase CPU usage. MTP is explicitly enabled here; ordinary Metal setup defaults to no MTP. See Qwen4 engine notes for memory behavior and options.
Native worker protocol: the strata-poly executable reads token IDs over stdin/stdout, not HTTP. Wait for READY, enter GEN 8 temperature=0 42,43 and look for DONE. Enter QUIT to exit. For text prompts and API clients, use the HTTP setup below.
The existing setup wrappers can build the Qwen4 worker from this checkout, download the model and tokenizer, and start the local HTTP server. Run them from the repository root.
Windows · CUDA
.\START-HERE.bat --family qwen4-poly --model AD-IQ2_XS --context 33792 --yesLinux · CUDA
./setup.sh --family qwen4-poly --model AD-IQ2_XS --context 33792 --yesmacOS · Metal
./setup.sh --qwen4-metal-fast --model AD-IQ2_XS --context 33792 --yesAdd --gguf-dir /absolute/path/to/models to reuse a local GGUF, or --setup to change saved settings. Use --mtp off to disable drafting or --mtp on to re-enable it. The CUDA shortcut --qwen4-cuda-fast selects the same Qwen4 family and requests embedded MTP unless explicitly disabled.
The HTTP server listens on 127.0.0.1:8080 by default. Configure your client with the OpenAI-compatible base URL http://127.0.0.1:8080/v1. Query /v1/models to get the active model ID.
curl http://127.0.0.1:8080/v1/chat/completions \
-H 'Content-Type: application/json' \
-d '{"model":"qwen4-35b-a3b-poly-ad-iq2_xs","messages":[{"role":"user","content":"What is 2 + 2?"}],"max_tokens":128,"temperature":0}'On Windows, run Invoke-RestMethod http://127.0.0.1:8080/v1/models in another PowerShell to check the server. Anthropic-compatible clients can use /v1/messages; consult the API documentation for other endpoints and client settings. Set an API key before exposing the server outside localhost.
62.8 tokens/s on an RTX 4070 Laptop with 8 GB VRAM and 16 GB system RAM with IQ2_XS after a 2K-token prompt; 58.5 tokens/s after a 32K-token prompt. Higher-precision variants also ran on the same laptop.
Each pair shows results for 2K / 32K input tokens, with embedded MTP enabled and automatic expert placement. The two laptops were tested separately on Windows.
| Hardware | AtomicChat quantization | Decode (tok/s) | TTFT (s) |
|---|---|---|---|
| RTX 4070 Laptop · 8 GB VRAM · 16 GB RAM | IQ2_XS | 62.8 / 58.5 | 2.54 / 31.85 |
| RTX 4070 Laptop · 8 GB VRAM · 16 GB RAM | IQ3_S | 39.7 / 37.6 | 3.24 / 27.80 |
| RTX 4070 Laptop · 8 GB VRAM · 16 GB RAM | Q4_K_M-Compact | 31.4 / 27.1 | 4.32 / 29.16 |
| RTX 5090 Laptop · 24 GB VRAM · 32 GB RAM | IQ2_XS | 158.6 / 154.6 | 1.72 / 11.53 |
| RTX 5090 Laptop · 24 GB VRAM · 32 GB RAM | IQ3_S | 151.6 / 156.5 | 1.37 / 9.29 |
| RTX 5090 Laptop · 24 GB VRAM · 32 GB RAM | Q4_K_M-Compact | 142.8 / 121.5 | 1.64 / 10.54 |
Test conditions: engine revision 3ecf0da55, one native-worker observation per setting, 128 greedy output tokens, no prompt-prefix reuse. TTFT is time to first token, excluding model loading and tokenization. Decode measures the intervals after the first token. File-cache state, available memory, MTP acceptance and generated tokens can affect the measurements. These are not end-to-end agent benchmarks or equivalent-quality comparisons.
Live VRAM-reserve changes were also tested: the worker shrank and restored expert slots without a process restart. See the full CUDA report and raw CSV for the comparison with the previous build, memory samples, output hashes and limitations.
A separate optimized Metal run on an M4 Max with 48 GB unified memory, using AtomicChat IQ3_S and embedded MTP:
| Input tokens | Prefill (tok/s) | TTFT (s) | Decode (tok/s) |
|---|---|---|---|
| 2,048 | 1,035 | 1.979 | 108.88 |
| 32,768 | 984 | 33.330 | 106.27 |
These are one-request observations with 128 generated tokens; both outputs matched the earlier 0ff479204 build in this test. They were collected in a separate experiment, not as a controlled comparison with the CUDA table. See Metal optimization results and raw Metal data.
Our focus is sustained throughput, TTFT and memory behavior on real consumer hardware. Short synthetic tests are useful engineering evidence, but they do not establish agent-task success rates, production stability or performance across all GPUs.
| Qwen4-35B-A3B file | Download size | Guidance |
|---|---|---|
AD-IQ2_XS |
24.23 GB | Start here for 8 GB VRAM / 16 GB RAM |
AD-IQ3_S |
31.09 GB | Tested on both CUDA laptops and M4 Max |
AD-Q4_K_M-Compact |
36.02 GB | Tested on both CUDA laptops; a larger quantized variant |
The catalog also includes IQ4_XS, Q4_K_M, Q5_K_M, Q6_K and Q8_0. Their presence in the catalog is not proof of equivalent runtime validation. Qwen4 support through the qwen4-poly family is currently experimental, text-only, single-device CUDA or Metal, and one request at a time. External draft models, HIP and multiple GPUs are outside this Qwen4 port. See the model guide and engine notes.
Atomic Engine r3 packages the native strata-poly worker for Apple Silicon Metal and NVIDIA CUDA 13 on Windows and Linux. The CUDA build includes the general model kernels and the Qwen4 35B kernels. The table links the model guides and the available Metal evidence. Measurements refer to the hardware, weights and revision in each report.
| Model | Apple Silicon Metal evidence |
|---|---|
| Qwen4-35B-A3B | AtomicChat AD-IQ3_S on M4 Max 48 GB. Measurements |
| Qwen3.6-35B-A3B | UD-Q2_K_XL on M5 Ultra. Prompt and decode measurements |
| LFM2.5-24B-A2B | UD-Q3_K_XL on M5 Ultra. Real-weight smoke test |
| Inkling 2 Mini | UD-Q3_K_XL on M5 Ultra 256 GB with and without a DSpark draft. Results |
| GLM 5.3 Flash, DeepSeek V4 Flash | Listed in the Metal installer. Full-weight Mac validation is pending. |
| Ornith 1.5 35B-A3B, Tiel Coder 35B-A3B | Listed in the Metal installer. Full-weight Mac validation is pending. |
| Gemma 4 26B-A4B, MiniCPM-V 4.7 35B-A3B | Metal includes image projector support. Full-weight Mac validation is pending. |
The native catalog also includes Flint 40B-A2.5B, Clover-35B-A3B-Preview, Groot 19B-A3B 261023, Kolibri 1 and Ornith 1.5 122B. Consult each guide for its GGUFs, hardware requirements and validation. The separate upstream workers serve Qwen3.8-Flash-Next and Hy4-Flash.
Atomic Chat's Hub lists the documented native models for discovery. Its Run with Atomic Engine action is available for three AtomicChat Qwen4 files and two Qwen4 Uncensored files (AD-IQ2_XS and AD-IQ3_S) in r3. The Atomic Chat manifest specifies the files for each platform.
- NVIDIA: the primary development target is a single 8 GB CUDA GPU. The Qwen4 measurements above are from RTX 4070 Laptop and RTX 5090 Laptop on Windows. The source-build instructions also cover Linux; do not assume Windows timings carry over to Linux or other GPU generations.
- Apple Silicon: Qwen4 Metal measurements are available on an M4 Max with 48 GB of unified memory. Memory-fit and speed on smaller Macs depend on the model and context.
- Storage: enough SSD space for the GGUF, build and temporary files. File size is not the same as resident RAM usage. Available memory and SSD speed matter when weights cannot stay resident.
- Other backends: see the inherited AMD HIP, Intel Arc, older GPU and multi-GPU guides for model-specific support and experimental paths.
MoE models activate only a subset of experts for each token. Atomic Engine uses that property to distribute model execution and weight storage across the available memory tiers instead of treating GPU VRAM as the only usable memory.
flowchart TD
A[Local application or coding agent] --> B[HTTP API and tokenizer]
B --> C[Native inference worker]
C --> D[Model execution and MTP verification]
D --> E[Expert routing and memory budget]
E --> F[GPU-resident experts and kernels]
E --> G[CPU experts in system RAM]
H[SSD-backed GGUF weights] --> G
H --> F
D <--> I[KV cache and conversation state]
GPU-resident experts are preferred. When the model does not fit, CPU execution and file-backed expert weights provide a fallback. Automatic placement can resize the GPU cache under memory pressure; the exact policy depends on the backend. On supported Qwen4 files, the embedded MTP layer proposes a token for the main model to verify. No separate draft-model download is needed.
See Qwen4 technical notes, engine internals and model architectures for the actual implementation details. The diagram is a simplified view, not a claim that every model uses identical execution and cache policies.
| Topic | Guide |
|---|---|
| Qwen4 runtime, options and measurements | QWEN4_POLY.md |
| Installation and source builds | Installation · Source builds |
| Model formats and quantization | QUANTS.md |
| API and client integration | DETAILS.md · Integration handoff |
| Benchmarks and methodology | Community benchmarks · Benchmark protocol |
| Architecture and memory management | BACKENDS.md · HOW_IT_WORKS.md |
| Troubleshooting | TROUBLESHOOTING.md |
| Privacy and network settings | SAFETY.md |
Some guides and translated READMEs retain upstream branding, commands and release references. For testing Atomic Engine, use this repository's checkout and the native build commands above, rather than installing a binary from another project's release feed.
Performance and compatibility reports are welcome, especially from 8 GB GPUs with 16–32 GB system RAM. Include the commit, OS, GPU, VRAM and system RAM, model and quantization, prompt length, output length, MTP settings and observed behavior. Keep failures and raw measurements alongside successful runs.
Open an issue or a pull request in this repository. See the contribution guidelines for validation and benchmark-report requirements. Remove private prompts, credentials and other sensitive information from logs before sharing.
Atomic Engine would not be possible without the open-source work that came before it. We are especially grateful to two projects that laid the foundation for this engine.
A huge thank you to VecSzn and the PolyStrata contributors. Atomic Engine is a fork of PolyStrata, and its multi-model inference runtime is the foundation of our work. Their engineering made running large MoE models on consumer hardware far more accessible. We deeply appreciate both the technical achievements of the project and the decision to share that work with the open-source community.
A huge thank you to Niko1221 and the Strata contributors for building the original inference engine that PolyStrata and, in turn, Atomic Engine build upon. Strata's work on efficient inference across GPU and system memory, together with its Qwen engine, installer, server and web interface, provides an important part of the foundation we inherit today.
We have enormous respect for both projects and their contributors. Thank you for making this work possible and for pushing the boundaries of local LLM inference.
Atomic Engine is developed by AtomicBot, building on the work of PolyStrata and Strata. The runtime also uses parts of llama.cpp / ggml. We thank its maintainers and contributors for their foundational work on local model inference and quantization.
The Qwen4 model is by the Qwen team; the GGUFs used in the Qwen4 benchmarks are distributed by AtomicChat. The inherited model integrations also build on the work of the Qwen team, Liquid AI, Google, DeepSeek, Recursive, Thinking Machines, GrootTeam, Aleph Alpha, DiffuSpace, ornith-ai, OpenBMB, Tencent, and model quantizers and contributors including ISTA-DASLab, UkisAI, neuralll, Unsloth, patrickbdevaney, bartowski, Hob-forge, maternion, IsValorum, mudler, peculiar-ragdoll and iMilnb.
See upstream engine credits, detailed credits and licenses, the linked model guides and the previous README's full model credits for attribution and original measurements.
The repository is distributed under the MIT License, with existing upstream copyright notices preserved. Some third-party components have their own licenses; model weights are distributed separately and are subject to their respective licenses. See license details.