# Repository Briefing: llmsforall/millie-runtime
> Source: https://repoforai.com/repo/llmsforall/millie-runtime (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/llmsforall/millie-runtime
- **Category**: LLMs & Inference (大模型与推理微调)
- **Primary Language**: C++
- **License**: MIT
- **Engineering Health**: A (86/100 · Maintenance 35/35 · Adoption 11/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v0.2.0 (2026-12-01) — https://github.com/llmsforall/millie-runtime/releases
- **Review Snapshot**: 2026-12-04
- **Deployment / Stack Signals**: Self-Hosted, Local AI, CLI, GPU, API
- **Momentum**: 61 ★ total (+1 24h / +49 7d) · 5 forks
- **When to Use**: Best for: Running Millie 2 Q3 or Ternary locally on memory-constrained devices when you can test the target backend, storage, and context length and integrate a streaming chat client. Skip if: You need verified full OpenAI API compatibility, non-streaming chat, broad model interchangeability, or managed capacity without operating inference hardware.

## Overview
```text
### Architecture & Core Mechanics
Millie Runtime is a C++ inference engine built on llama.cpp. Its source layout includes `src/`, `ggml/`, and `include/`, alongside a CMake build and a separate `gguf-py/` package. It retains the `llama_*` APIs and executable names such as `llama-cli` and `llama-server`. Millie 2 adds a dedicated launcher, `bin/millie-chat`, which starts a loopback chat server from a complete model directory containing the weights and matching multi-token prediction (MTP) head.

The key change is what must stay resident during inference: expert streaming addresses model weights, while attention streaming addresses the attention cache. The Linux launcher uses Vulkan, the MTP head, disk-backed experts, and host-side K/V; macOS uses Metal and streamed attention at the model's native context length. The Python ≥3.9 manifest, with Transformers 5.5.1 and a local `gguf` dependency, is for the script toolchain, including model conversion. It is not a blanket requirement for running every prebuilt C++ binary.

### Key Capabilities & Differentiators
Millie 2 supports Q3 and Ternary weights using Millie's custom quantization formats. The local server listens on `127.0.0.1:28297` and accepts requests at `/v1/chat/completions`. It requires `stream: true`, emits text fragments in `choices[0].delta.content`, and terminates with `data: [DONE]`. This gives streaming chat clients a concrete integration path but does not establish non-streaming support or full OpenAI API parity.

For Millie 1.1, `llama-cli` loads the Ternary GGUF and accepts a separate vision GGUF via `--mmproj`, with `--image` supplying the image input. Its low-memory mode caps the number of resident experts per layer and requires Apple Metal; that restriction is specific to the Millie 1.1 mode, not to all Millie 2 paths. The original Millie 35B-A3B distributions come in 7 GB, 9 GB, and 11 GB sizes. Those are model distribution sizes, not RAM or VRAM requirements.

### Trade-offs & Limitations
Millie Runtime is a focused choice over upstream llama.cpp when the workload calls for Millie's custom quantizations and lower memory residency. Retaining familiar `llama_*` entrypoints helps with migration, but the Millie 2 server still has a distinct model layout and a streaming-only chat contract. Do not assume that another llama.cpp build can load the custom formats, or that an existing OpenAI client can use this server without testing its request and response handling.

Compared with the hosted OpenAI API, local serving keeps inference on your hardware and shifts model staging, sizing, and service operation to your team. Disk-backed experts and host-side K/V make storage behavior and host memory part of the sizing exercise, not just VRAM. Test your target context and concurrency on the actual backend: fitting a model does not establish acceptable generation speed. The runtime is MIT-licensed; review the separately distributed model terms before bundling weights.

### Hardware & Deployment Guide
For Millie 2 desktop serving, extract the platform release, download the full Q3 or Ternary model directory, and run `bin/millie-chat` with that directory. For Q3, `hf download llmsforall/Millie-2-Q3 --local-dir ./models/Millie-2-Q3` fetches the artifacts. Keep the matching MTP head in place. Generation runs against the local model and loopback server after staging. If a client must connect remotely, plan network exposure and access controls separately rather than treating the local listener as a ready-made remote deployment.

The v0.1.0 release shipped Apple Silicon macOS and Linux x86_64 builds with custom quantization support and low-memory Metal inference. v0.2.0 adds Millie 2 Q3 and Ternary and provides a signed, notarized Apple Silicon package. The Windows x64 v0.2.0 preview uses Vulkan and requires Python 3 plus a GPU driver that supports 32-lane subgroups. The iPhone instructions use a source build; the REDMAGIC Android instructions provide a separate first-run path.
```

## Key Capabilities
```text
- Memory residency: Millie 2 streams experts and attention so weights and attention cache need not all be resident at once.
- Model packaging: Millie 2 Q3 and Ternary each use a complete model directory with a matching multi-token prediction (MTP) head.
- Backend behavior: The Linux launcher uses Vulkan, disk-backed experts, and host K/V; macOS uses Metal and streams attention at native context length.
- Client integration: The loopback chat endpoint requires `stream: true`, returns `choices[0].delta.content` fragments, and ends with `data: [DONE]`.
- Vision input: The Millie 1.1 `llama-cli` flow pairs Ternary weights with a separate vision GGUF via `--mmproj` and takes an image via `--image`.
- Windows preview: The x64 release requires Python 3 and Vulkan driver support for 32-lane subgroups.
```

## Quick Start / Clone
```bash
curl -N http://127.0.0.1:28297/v1/chat/completions \
  -H 'Content-Type: application/json' \
  -d '{"model":"millie-2-q3","messages":[{"role":"user","content":"Write a two-line poem about rain."}],"max_tokens":64,"stream":true}'
```
