Back to models
Yi-Coder-9B-Chat
Developed by 01.AI, Yi-Coder-9B-Chat is a 9B open-weight coding model supporting 52 programming languages and a 128K context window for repository-level code generation and debugging.
What you can do
- Multilingual function generation and completion
- Cross-file repository bug diagnosis
- Automated unit test suite authoring
Input & output
- Input
- Source code files, error stack traces, and natural language coding instructions up to 128K tokens
- Output
- Source code implementations, refactoring diffs, unit tests, and debugging explanations
Try a prompt like this
请用 Go 语言实现一个支持并发安全、TTL 过期清理与优雅退出的内存令牌桶限流器,并附带表驱动单元测试。
Things to know
Apache 2.0 license; fits comfortably on a single 24 GB GPU in BF16 (~18–20 GB VRAM), though full 128K context benefits from vLLM FlashAttention and KV cache quantization.
All listed models publish open weights for self-hosted deployment; check each repository's license before commercial use.
Call it through the API
The platform exposes an OpenAI-compatible API. Use an official SDK or any HTTP client, then set the gateway URL, API key, and model ID.
- Endpoint
POST/v1/chat/completions- Model repo ID
01ai/Yi-Coder-9B-Chat
import os
from openai import OpenAI
client = OpenAI(
base_url=os.environ["API_BASE_URL"],
api_key=os.environ["API_KEY"],
)
response = client.chat.completions.create(
model="01ai/Yi-Coder-9B-Chat",
messages=[{"role": "user", "content": "请用 Go 语言实现一个支持并发安全、TTL 过期清理与优雅退出的内存令牌桶限流器,并附带表驱动单元测试。"}],
)
print(response.choices[0].message.content)Before running a sample, set the API_BASE_URL (gateway URL) and API_KEY environment variables.
Read the full API guide