Instructions to use Baidu-Baige/KODA-35B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use Baidu-Baige/KODA-35B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-text-to-text", model="Baidu-Baige/KODA-35B") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] pipe(text=messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("Baidu-Baige/KODA-35B") model = AutoModelForMultimodalLM.from_pretrained("Baidu-Baige/KODA-35B", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=256) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use Baidu-Baige/KODA-35B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Baidu-Baige/KODA-35B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Baidu-Baige/KODA-35B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/Baidu-Baige/KODA-35B
- SGLang
How to use Baidu-Baige/KODA-35B with SGLang:
Install from pip and serve model
# Install SGLang from pip: pip install sglang # Start the SGLang server: python3 -m sglang.launch_server \ --model-path "Baidu-Baige/KODA-35B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Baidu-Baige/KODA-35B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker images
docker run --gpus all \ --shm-size 32g \ -p 30000:30000 \ -v ~/.cache/huggingface:/root/.cache/huggingface \ --env "HF_TOKEN=<secret>" \ --ipc=host \ lmsysorg/sglang:latest \ python3 -m sglang.launch_server \ --model-path "Baidu-Baige/KODA-35B" \ --host 0.0.0.0 \ --port 30000 # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:30000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Baidu-Baige/KODA-35B", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }' - Docker Model Runner
How to use Baidu-Baige/KODA-35B with Docker Model Runner:
docker model run hf.co/Baidu-Baige/KODA-35B
KODA-35B: Kernel Optimization via Domain Adaptation
KODA-35B is a CUDA kernel generation and optimization model based on Qwen3.6-35B-A3B, with 35B total parameters and approximately 3B active at inference. Given a reference implementation, it proposes a CUDA kernel and revises it across rounds using compiler diagnostics, correctness tests, runtime measurements, and profiler feedback from the KODA agent.
Benchmark results
The charts compare KODA-35B with the Qwen3.6 base model and other models on KernelBench and SOL-ExecBench. The horizontal axis shows total parameter count on a logarithmic scale. The red star marks KODA-35B.
Best values are bold, including ties. Compared with its Qwen3.6 base model, KODA-35B improves correctness by 35.2 percentage points on KernelBench and 31.1 points on SOL-ExecBench, based on the displayed scores. It ties for the highest KernelBench correctness and reaches the second-highest KernelBench median speedup in this comparison.
KernelBench (270 problems)
| Model | Correctness | Fast@1 | Fast@2 | Median speedup |
|---|---|---|---|---|
| KODA-35B | 95.6% | 88.9% | 61.9% | 3.15ร |
| Qwen3.6-35B-A3B | 60.4% | 24.1% | 10.7% | 0.94ร |
| Qwen3.8-Flash-Next | 94.8% | 82.2% | 51.9% | 2.27ร |
| DeepSeek-V4.1-Flash-1017 | 92.6% | 90.0% | 70.4% | 4.31ร |
| DeepSeek-V4-Flash-0731 | 95.6% | 77.4% | 52.6% | 2.26ร |
| GLM-5.3 | 94.1% | 84.4% | 62.6% | 2.97ร |
| GLM-5.3-Flash | 95.6% | 80.0% | 48.1% | 2.02ร |
| Kimi-K3 | 93.7% | 84.8% | 64.1% | 2.99ร |
| MiMo-v2.6-Flash-MOPD | 89.6% | 71.1% | 39.6% | 1.72ร |
| Recursive-Flint-40B | 68.9% | 18.1% | 9.3% | 0.48ร |
| MusaCoder-27B | 73.0% | 26.7% | 14.1% | 0.95ร |
| Kevin-32B | 5.2% | 1.1% | 0.7% | 0.64ร |
| IndustrialCoder-32B-Thinking | 23.7% | 3.0% | 1.1% | 0.27ร |
SOL-ExecBench (202 problems with fixed workload sampling)
| Model | Correctness | Fast@1 | Fast@2 | Median speedup |
|---|---|---|---|---|
| KODA-35B | 95.5% | 78.7% | 48.0% | 2.10ร |
| Qwen3.6-35B-A3B | 64.4% | 17.8% | 8.9% | 0.73ร |
| Qwen3.8-Flash-Next | 95.5% | 74.8% | 44.1% | 1.70ร |
| DeepSeek-V4.1-Flash-1017 | 91.6% | 81.7% | 54.5% | 3.15ร |
| DeepSeek-V4-Flash-0731 | 98.0% | 67.3% | 41.1% | 1.37ร |
| GLM-5.3 | 93.6% | 78.7% | 50.0% | 2.28ร |
| GLM-5.3-Flash | 96.0% | 72.8% | 43.6% | 1.57ร |
| Kimi-K3 | 94.6% | 78.2% | 44.6% | 1.81ร |
| MiMo-v2.6-Flash-MOPD | 82.2% | 57.4% | 32.7% | 1.43ร |
| Recursive-Flint-40B | 65.8% | 13.4% | 8.4% | 0.30ร |
| MusaCoder-27B | 71.3% | 26.7% | 14.9% | 0.87ร |
| Kevin-32B | 2.5% | 0.0% | 0.0% | 0.74ร |
| IndustrialCoder-32B-Thinking | 25.7% | 3.5% | 2.0% | 0.59ร |
Usage
Serve KODA with a compatible inference engine such as vLLM or SGLang, and connect its model API to the KODA agent. The agent compiles and evaluates candidates in managed sandboxes and feeds the results back to the model.
Model serving and kernel evaluation use separate GPU resources. Refer to the agent repository for configuration and evaluation instructions.
Model provenance
This repository provides the KODA model weights, tokenizer, and configuration in Hugging Face format. KODA is fine-tuned from Qwen3.6-35B-A3B.
License
The model is distributed under Apache License 2.0. See LICENSE for the license text and upstream notices. We acknowledge the Qwen team for the base model. The agent code and benchmark datasets have their own licenses.
- Downloads last month
- -
