Downloads · 30 days
14
10% of all-time downloads
FlagRelease/Kimi-K2-Instruct-FlagOS
Kimi-K2-Instruct-FlagOS is a machine learning model from FlagRelease. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
FlagOS is a unified heterogeneous computing software stack for large models, co-developed with leading global chip manufacturers. With core technologies such as the FlagScale distributed training/inference framework,…
Downloads · 30 days
14
10% of all-time downloads
All-time downloads
144
Public
Parameters
1T
1 TB on disk
Likes
1
Public
Click a slice to open those files.
.safetensors1 TB · 100%
How the weights are stored.
F8_E4M31T · 100%
From the Hugging Face model README
FlagOS is a unified heterogeneous computing software stack for large models, co-developed with leading global chip manufacturers. With core technologies such as the FlagScale distributed training/inference framework, FlagGems universal operator library, FlagCX communication library, and FlagTree unified compiler, the FlagRelease platform leverages the FlagOS stack to automatically produce and release various combinations of <chip + open-source model>. This enables efficient and automated model migration across diverse chips, opening a new chapter for large model deployment and application.
Based on this, the Kimi-K2-Instruct-FlagOS model is adapted for the Nvidia chip using the FlagOS software stack, enabling:
FlagScale is an end-to-end framework for large models across heterogeneous computing resources, maximizing computational efficiency and ensuring model validity through core technologies. Its key advantages include:
FlagGems is a Triton-based, cross-architecture operator library collaboratively developed with industry partners. Its core strengths include:
FlagEval (Libra)** is a comprehensive evaluation system and open platform for large models launched in 2023. It aims to establish scientific, fair, and open benchmarks, methodologies, and tools to help researchers assess model and training algorithm performance. It features:
| Metrics | Kimi-K2-Instruct-FlagOS-H100-CUDA | Kimi-K2-Instruct-FlagOS-FlagOS-Nvidia |
|---|---|---|
| AIME-0shot@avg1 | 0.667 | 0.700 |
| LiveBench-0shot@avg1 | 0.685 | 0.690 |
| MMLUpro-5shots@avg1 | 0.773 | 0.788 |
| MUSR-0shot@avg1 | 0.724 | 0.710 |
Environment Setup
| System Component | Version Information |
|---|---|
| Docker Version | Docker version 24.0.0, build 98fdcd7 |
| Operating System | Description: Ubuntu 20.04 LTS |
| FlagScale | Version: 0.8.0 |
| FlagGems | Version: 2.2 |
Dual-machine execution
docker pull harbor.baai.ac.cn/flagrelease-public/flagrelease_nvidia_kimi_k2
Execution under shared storage on master node IP
pip install modelscope
modelscope download --model moonshotai/Kimi-K2-Instruct --local_dir /share/models/Kimi-K2-Instruct
Dual-machine execution
#Container Startup
docker run --rm --init --detach \
--net=host --uts=host --ipc=host \
--security-opt=seccomp=unconfined \
--privileged=true \
--ulimit stack=67108864 \
--ulimit memlock=-1 \
--ulimit nofile=1048576:1048576 \
--shm-size=32G \
-v /share/models:/models \
--gpus all \
--name flagos \
harbor.baai.ac.cn/flagrelease-public/flagrelease_nvidia_kimi_k2 \
sleep infinity
docker exec -it flagos bash
Dual-machine execution---Edit the hostfile.txt file
Change the IP in hostfile.txt to the corresponding machine's IP
vim /root/miniconda3/envs/flagscale-inference/lib/python3.12/site-packages/flag_scale/examples/kimik2/conf/hostfile.txt
# ip slots type=xxx[optional]
# master node
x.x.x.x slots=8 type=gpu
# worker nodes
x.x.x.x slots=8 type=gpu
Dual-machine execution---Modify the serve.yaml file
vim /root/miniconda3/envs/flagscale-inference/lib/python3.12/site-packages/flag_scale/examples/kimik2/conf/serve.yaml
Modify
hostfile: examples/kimik2/conf/hostfile.txt
to
hostfile: /root/miniconda3/envs/flagscale-inference/lib/python3.12/site-packages/flag_scale/examples/kimik2/conf/hostfile.txt
Modify
USE_FLAGGEMS: false
to
USE_FLAGGEMS: true
flagscale-inference environmentExecution on master node IP
conda activate flagscale-inference
cd /repos/FlagScale
pip install . -i https://pypi.tuna.tsinghua.edu.cn/simple --no-build-isolation
Write the contents of the ~/.ssh/id_rsa.pub file from the flagos container on the master node into the ~/.ssh/authorized_keys file on the worker nodes' physical machines.
Execution on Master Node IP
flagscale serve kimik2
#After the service starts, you will see output similar to the following:
#INFO 07-08 09:49:51 [api_server.py:1349] Starting vLLM API server 0 on http://0.0.0.0:30000
import openai
openai.api_key = "EMPTY"
openai.base_url = "http://<server_ip>:30000/v1/"
model = "Kimi-K2-Instruct-nvidia-origin"
messages = [
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What's the weather like today?"}
]
response = openai.chat.completions.create(
model=model,
messages=messages,
stream=False,
)
for item in response:
print(item)
/models directory inside the container.docker logs flagos.docker exec flagos ps aux | grep flagscale.We warmly welcome global developers to join us:

The weights of this model are based on moonshotai/Kimi-K2-Instruct and are open-sourced under the Apache 2.0 License: https://www.apache.org/licenses/LICENSE-2.0.txt.