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

- **GitHub URL**: https://github.com/shunte88/eomoe
- **Category**: LLMs & Inference (大模型与推理微调)
- **Primary Language**: Rust
- **License**: MIT
- **Engineering Health**: A (76/100 · Maintenance 35/35 · Adoption 1/25 · Releases 20/20 · License 20/20)
- **Latest Release**: v0.3.0 (2026-12-01) — https://github.com/shunte88/eomoe/releases
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: Docker, Self-Hosted, Local AI, CLI, GPU, API
- **Momentum**: 19 ★ total (+1 24h / +18 7d) · 0 forks
- **Topics**: `claude-code`, `cuda`, `llama-cpp`, `llm`, `local-llm`, `moe`, `qwen3`, `rust`
- **When to Use**: Best for: Self-hosted coding assistants and local API workloads on a supported NVIDIA GPU, with enough host RAM for the chosen GGUF and a measured throughput advantage on the intended model. Skip if: You need AMD or Vulkan support, enforce JSON Schema keywords outside the supported subset, or want managed capacity without sizing RAM, VRAM, and concurrency yourself.

## Overview
```text
### Architecture & Core Mechanics
eomoe packages a Rust inference server and CLI in one binary. Tokio and Axum handle HTTP; `gguf.rs`, `tokenizer.rs`, and `template.rs` load weights, perform BPE tokenization, and render Jinja chat templates using MiniJinja. The routing and quantization modules feed an f32 CPU reference forward pass used as a correctness baseline. The production GPU path uses `cudarc` and loads named C ABI kernels from `kernels/eomoe.cu`, keeping the kernel implementation separate from the host-side Rust engine.

For MoE inference, expert weights live in host RAM and active experts occupy a frequency-class LRU in VRAM. Cache misses are uploaded from pinned RAM over PCIe on a copy stream that overlaps computation. During decode, the current layer's output is passed through the next layer's router to prefetch likely experts, with a measured recall of 84%. Quantized tensor-core GEMMs and FlashAttention-2 accelerate prefill, while split-K attention serves long-context decode.

### Key Capabilities & Differentiators
The supported GGUF variants include Q4_K_M, Q4_0, MXFP4, and ternary Q2_0 across supported models such as Qwen3.6-35B-A3B, Qwen3-Coder-Next, gpt-oss-20b, GLM-4.7-Flash, Gemma 4, and dense Qwen3.8 and Bonsai variants. The HTTP surface includes OpenAI Chat and Responses, Anthropic Messages, native completion and infill, and selected Ollama endpoints. OpenAI Chat supports streaming and tools. Constrained JSON sampling covers a subset of JSON Schema; keywords such as `allOf`, `pattern`, and `minItems` are accepted but not enforced.

On an RTX 5060 8 GB with an approximately 5K-token prompt and 128 generated tokens, Qwen3.6-35B-A3B reached 1467 tok/s prefill and 69.8 tok/s decode, versus 990 and 49.9 for tuned llama.cpp. The server defaults to a 32K context with f16 KV and reuses cached prompt prefixes across requests. The throughput test does not establish performance at the full context limit or under simultaneous client load.

### Trade-offs & Limitations
The clearest reason to choose eomoe over tuned llama.cpp is a measured win on the MoE model you actually intend to serve, not a blanket speed advantage. Dense Qwen3.8-27B, with MTP enabled on both engines, prefills faster in eomoe but decodes at 6.2 tok/s versus llama.cpp's 7.3. The small VRAM footprint shifts pressure to host RAM and PCIe: the Qwen3-Coder-Next benchmark used 64 GB of system RAM. Four requests share the default KV pool, so benchmark long prompts and concurrency together rather than sizing from single-request throughput.

Lowering `--moeexperts` can trade output fidelity for speed: one Qwen3-Coder run at four experts measured roughly 1.6× decode throughput while retaining 80% of greedy choices. That is not a general quality score. Compared with a hosted OpenAI API, local inference keeps prompts on infrastructure you control but leaves capacity, availability, and client compatibility testing to you. The engine is MIT-licensed; check model-weight and client terms separately.

### Hardware & Deployment Guide
CUDA requires an NVIDIA GPU with sm_80 or newer; there is no AMD, ROCm, or Vulkan backend. Source builds need Rust and the CUDA toolkit with `nvcc`; `EOMOE_CUDA_ARCH` selects a different build target when needed. Build with `cargo build --release`, configure a local GGUF, and start `eomoe serve`, which defaults to `127.0.0.1:8080`. Configuration precedence is flags, environment, then YAML. Docker Compose builds locally, requests one NVIDIA GPU, mounts config and models read-only under `/app`, and sets `EOMOE_CONFIG_PATH=/app/config/config.yaml`.

Compose publishes port 8080, so verify reachability and configure API keys and TLS before allowing remote access. Queue length and request duration are unlimited by default; set `--queue-limit` and `--req-timeout` for shared service. To avoid the startup GitHub check on an isolated host, use `--update off` and stage model files locally. Release v0.3.0 adds ternary Bonsai Q2_0 support and model-native MTP speculative decoding for Qwen3.8-27B.
```

## Key Capabilities
```text
- Expert placement: MoE weights stay in host RAM; pinned-memory transfers refill a frequency-class VRAM LRU on a CUDA copy stream.
- Decode prefetch: Each layer applies the next layer's router to its own output to predict which expert weights to upload.
- GPU execution: Quantized Q4_K/Q6_K prefill GEMMs and FlashAttention-2 use tensor cores; long-context decode uses split-K attention.
- Client integration: One server exposes OpenAI Chat and Responses, Anthropic Messages, llama.cpp infill, and selected Ollama routes.
- Resource controls: The default 32K f16 KV configuration supports four parallel requests sharing a KV pool, with configurable queue limits and timeouts.
- Regression testing: Captured llama-server traffic drives API golden tests; an f32 CPU reference forward pass provides a separate correctness baseline.
```

## Quick Start / Clone
```bash
cargo build --release
./target/release/eomoe install          # model + Claude Code / Codex clients
./target/release/eomoe serve            # leave running (127.0.0.1:8080)
./target/release/eomoe claude           # Claude Code on the local server
./target/release/eomoe codex            # Codex CLI on the local server
./target/release/eomoe check            # streamed smoke test of both APIs
```
