Skip to content
HUIAHUB

FareedKhan-dev/kimi-k3-in-c

kimi-k3-in-c

A 2.78-trillion-parameter Kimi K3 running inference on a single CPU in 8.24 GB of RAM. Portable C99: no BLAS, no framework, no GPU.

Metrics updated Emerging+3.4% 7d

GitHub metrics

Stars
13K
+419 this week
Forks
2K
30-day growth
—
Open issues
4
9.2K11K13KOct 29, 2026Nov 23, 2026
GitHub stars from the official GitHub API, recorded each time the repository was checked (3 days).
GitHub stars by day
DayGitHub stars
2026-10-299231
2026-11-1612163
2026-11-2312582

What it does

kimi-k3-in-c is a C99 inference engine that runs the 2.78-trillion-parameter Kimi K3 language model on a CPU without a GPU or machine learning framework. Instead of loading the entire model into memory, it reads mixture-of-experts weights from disk and streams the dense layers when needed. The README reports a peak memory use of 8.24 GB in one configuration. The full checkpoint still occupies 1.56 TB on disk, so the low RAM requirement comes with a substantial storage requirement.

The engine includes a C tokenizer, a safetensors reader, native MXFP4 computation, memory presets, and tests that run without downloading model weights. Version 1.1.0 added terminal chat using K3's XTML format, JSONL conversation history, optional sampling controls, and an ultra-low-memory preset. The repository also provides a C API for developers working directly with its inference components.

To get started, the project's quickstart documentation covers machine checks, compilation, testing, checkpoint download, and preparation of the dense weights for streaming. Linux is the reference platform, with macOS and Windows builds also supported. The main tradeoff is generation speed. Small memory budgets require frequent disk reads, making fast local storage particularly important. The project is suited to CPU inference research and local experiments where execution without a GPU matters more than response speed.

Why it matters

Kimi K3's checkpoint is much larger than the memory available in ordinary computers. This project addresses that problem through selective expert loading, disk streaming, and computation directly on packed MXFP4 weights. Its C99 implementation avoids GPU and BLAS requirements. The repository documents inference across different memory budgets while retaining the original checkpoint weights. The tradeoff is significant storage use and slow generation when the engine must repeatedly fetch weights from disk.

Main features

  • Runs Kimi K3 inference on CPUs using a C99 implementation.
  • Streams routed expert weights directly from disk in packed MXFP4 format.
  • Provides memory presets controlling dense-layer residency and expert caching.
  • Includes native C tokenization and safetensors checkpoint reading.
  • Supports terminal chat with XTML formatting and JSONL conversation history.
  • Offers optional temperature, top-p, and top-k sampling controls.
  • Saves and restores inference state for continuing conversations.
  • Includes weightless tests and a script for checking machine requirements.

Who it's for

  • Systems programmers studying CPU inference, memory management, and low-level model execution in C.
  • AI researchers investigating mixture-of-experts routing, quantized computation, and disk-based inference.
  • Developers who want to inspect or embed Kimi K3 inference components through a C API.
  • Local AI experimenters with substantial storage capacity who want to run a large model without GPU acceleration.

Strengths

  • The project reports full-model inference with 8.24 GB peak RAM use by streaming weights instead of keeping them resident.
  • The inference engine is written in C99 and does not require a GPU, BLAS, or a machine learning framework.
  • Tests cover numerical operations, checkpoint parsing, caching, and reference agreement without requiring model weights.
  • Version 1.1.0 includes native Windows support, macOS fixes, ARM NEON kernels, and a terminal chat interface.

Limitations

  • Full-model inference still requires the 1.56 TB checkpoint and additional storage for the packed dense layers. Low RAM use does not reduce the full checkpoint's disk footprint.
  • Generation is slow at small memory budgets because weights must be read repeatedly. Published performance measurements are hardware-specific, and the documentation identifies substantial variation between runs.
  • Long prompts remain expensive because prefill is not fully chunked. The documented context ceiling does not guarantee practical generation times for prompts approaching that limit.
  • The project has no HTTP serving API or vision inference implementation. GPU acceleration is outside its stated scope.

Getting started

Requirements: Linux x86-64, macOS arm64, or Windows x86-64 through MSYS2 MinGW-w64. GCC 9+ or Clang 10+, GNU Make or CMake, and OpenMP for building. AVX2 and FMA on supported x86 CPUs, with NEON kernels available for arm64. An 8 GB-class memory budget or more, approximately 1.7 TB of free storage for full-model inference, access to the Kimi K3 checkpoint, and Python 3.9+ for model preparation tools.

Always follow the official instructions in the README on GitHub. This overview is our summary, not a copy.

Sources