qmetrics.net

Kimi K3 in C

Portable C99 CPU inference for Kimi K3

kimi-k3-in-c runs Kimi K3 text generation on a single CPU without BLAS, frameworks, or GPUs. It streams a multi-terabyte checkpoint from disk so inference fits in about eight gigabytes of RAM.

Overview

kimi-k3-in-c is a compact inference engine that executes the Kimi K3 model using portable C99. It avoids external math libraries and GPUs, relying on AVX2 and FMA on x86-64 or NEON on arm64, with builds for Linux, macOS, and Windows.

The design streams most weights from a large on-disk checkpoint while keeping peak resident memory near eight gigabytes on small machines. Routed mixture-of-experts stay on disk in packed four-bit form; dense trunk layers can pin partially in memory with presets that trade speed for RAM. Output tokens match across memory budgets; only latency changes.

You can verify the engine without downloading weights by running the test suite and oracle models, then fetch shards, pack the trunk into a single file, and run batch or chat modes. Chat uses official XTML segments; a REPL supports reset and history export. Memory flags control trunk ring size, expert LRU cache, threading, and an ultra-low preset for eight-gigabyte-class hardware.

Python tooling assists download, packing, and analysis, but core inference is a native binary with OpenMP threading and documented presets from laptop through server tiers.

Key features

  • CPU-only Kimi K3 inference
  • MXFP4 expert streaming from disk
  • Memory presets from laptop to server
  • Official XTML chat REPL
  • Incremental generation with KV cache
  • Packed trunk single-file reads
  • Full test suite without checkpoint
  • Cross-platform x86 and arm64 builds

Use cases

  • Running huge LLMs on modest RAM
  • Research on memory-efficient inference
  • Offline chat with official tokenizer
  • Byte-identical validation across hardware
  • Teaching systems programming for ML

Tags

Similar software

TensorFlow

End-to-end machine learning platform and tooling ecosystem

TensorFlow is a machine learning platform with Python and C++ APIs, optional GPU packages, and companion libraries for data, training, deployment, and visualization.

★ 201.8k⟳ todayApache-2.0

Transformers

Shared model definitions for multimodal ML workloads

Transformers is a Python library that defines pretrained text, vision, audio, and multimodal models once in PyTorch for shared inference and training across the ecosystem.

★ 169.4k⟳ todayApache-2.0

RAGFlow

Open-source RAG engine and agent context platform

RAGFlow ingests heterogeneous documents, builds retrievable knowledge, and supports agent workflows with citations. It can run on your own hardware with Docker or a from-source server stack.

★ 94.8k⟳ todayApache-2.0

Headroom

Local LLM context compression library and proxy

Headroom shrinks tool outputs, logs, JSON, and chat history before LLM calls to cut input tokens while preserving retrievable originals. It offers a Python library, proxy, MCP tools, and agent wrappers.

★ 81k⟳ yesterdayApache-2.0

Unsloth

Local desktop workspace to run and fine-tune AI models

Unsloth is a desktop application to chat with, fine-tune, and serve LLMs, diffusion, audio, and embedding models on your own hardware with optional agent integrations.

★ 80.4k⟳ todayApache-2.0

Models

TensorFlow reference models and modeling utilities collection

The TensorFlow Model Garden hosts implementations of models and modeling solutions for TensorFlow, installable via pip as tf-models-official.

★ 77.6k⟳ 11 days agoApache-2.0