KTransformers
kvcache-ai / ktransformers
面向异构硬件的推理/微调框架:把 MoE 专家卸载到 CPU/内存,用少量 GPU 跑大模型。Heterogeneous-hardware inference and fine-tuning: offload MoE experts to CPU/RAM so a small GPU can run large models.
为什么选Why choose it
- MoE 模型不必全部塞进显存,适合本地大模型。MoE models do not need to fit entirely in VRAM — useful for local large models.
- 支持 Intel/AMD CPU 与特定 GPU 组合。Supports Intel/AMD CPUs with selected GPU combinations.
- 提供微调与推理两条线。Covers both fine-tuning and inference.
不适合Not for
追求通用、稳定的生产推理,优先 vLLM/SGLang。For general, stable production inference, prefer vLLM/SGLang.
硬件组合有限制,不是所有模型都支持。Hardware combinations are constrained; not every model is supported.
最小上手Minimum setup
- 确认 CPU 指令集、内存容量与 GPU 型号在支持列表里。Confirm CPU instruction set, RAM size and GPU model are on the supported list.
- 先用官方脚本跑一个小 MoE 模型,记录显存与内存占用。Run a small MoE model with the official script; record VRAM and RAM use.
- 再换目标模型,观察专家命中率与 tokens/s 是否符合预期。Switch to the target model and check expert hit rate and tokens/s.
依赖与成本Dependencies and cost
Python + PyTorch;需要足够系统内存;部分内核依赖特定 CPU/GPU。Python + PyTorch; needs enough system RAM; some kernels require specific CPUs/GPUs.
许可与使用边界License and usage boundaries
代码 Apache-2.0;模型权重与数据集另有许可。Code is Apache-2.0; model weights and datasets carry their own licenses.
开源不等于可商用:GPL / AGPL 有传染性;代码许可、模型许可、生成内容许可要分开看。上线前读仓库 LICENSE 与模型卡,必要时让法务确认。Open source is not automatically commercial-use friendly: GPL / AGPL are copyleft; code, model and output licenses are separate. Read the LICENSE and model card before launch, and involve legal when needed.
替代与相邻Alternatives and neighbors
- Ollama — 先试这个Start here,一条命令拉模型、跑本地推理,自带模型库与 OpenAI 兼容 API。Pull and run local models with one command, with a built-in model library and an OpenAI-compatible API.
- llama.cpp — 本地优先Local-first,C/C++ 推理引擎,CPU、Apple Silicon、消费级 GPU 都能跑,量化格式丰富。A C/C++ inference engine that runs on CPUs, Apple Silicon and consumer GPUs, with a wide range of quantisation formats.
下一步Next steps
- 打开 GitHub,先读 README、LICENSE、最近 release 与 issue。Open GitHub and read the README, LICENSE, latest release and issues first.
- 按“部署依赖 / 显存 / 数据 / 网络 / 权限”列一张上手清单。Make an onboarding checklist for deployment dependencies, VRAM, data, network and permissions.
- 用一个小样本跑通,再决定是否进生产;不要直接上生产数据。Run a small sample first, then decide on production; never start with production data.
GitHub 仓库 ↗GitHub repository ↗ 文档 ↗Docs ↗ 加入对比Add to compare