Views
No views yet
[!NOTE] This is a preview checkpoint intended for testing and integration validation. Planned RL/GRPO releases will be continued from this SFT checkpoint as the initialization base.
CnakeAgent-sft-v0.1 is a supervised fine-tune of openai/gpt-oss-20b for Python -> Cython optimization workflows.
It is trained on multi-turn tool-use traces where the model proposes Cython code and receives compile/test/benchmark feedback.evaluate_cython)1python -m vllm.entrypoints.openai.api_server \
2 --model CnakeCharmer/CnakeAgent-sft-v0.1 \
3 --served-model-name gpt-oss-20b-cython \
4 --host 0.0.0.0 \
5 --port 8003 \
6 --trust-remote-code[!IMPORTANT] This model is designed primarily as a local agent backend for code tools such as Claude Code and Codex.
[!NOTE] The CnakeCharmer tool-execution path uses Bubblewrap (bwrap) for sandboxing. Install it before running MCP agent loops that callevaluate_cython.Linux install:bash1# Debian / Ubuntu 2sudo apt-get update && sudo apt-get install -y bubblewrap 3 4# Fedora 5sudo dnf install -y bubblewrap 6 7# Arch 8sudo pacman -S --noconfirm bubblewrap
1# one-time setup
2git clone https://github.com/dleemiller/CnakeCharmer.git
3cd CnakeCharmer
4uv sync
5
6# terminal 1: model server
7bash scripts/start_vllm_server.sh
8
9# terminal 2: MCP
10uv run python -m cnake_charmer.mcp_serverrun_cython_agent from your MCP client.claude mcp add cnake-charmer -- uv run python -m cnake_charmer.mcp_servercodex mcp add cnake-charmer -- uv run python -m cnake_charmer.mcp_servercProfile, py-spy, or benchmark timings).run_cython_agent with the isolated python_code, func_name, and short task description.1import torch
2from huggingface_hub import hf_hub_download
3from transformers import AutoModelForCausalLM, AutoTokenizer
4
5model_id = "CnakeCharmer/CnakeAgent-sft-v0.1"
6tok = AutoTokenizer.from_pretrained(model_id)
7model = AutoModelForCausalLM.from_pretrained(
8 model_id,
9 device_map="auto",
10 torch_dtype=torch.bfloat16,
11 trust_remote_code=True,
12)
13
14system_prompt_path = hf_hub_download(model_id, "system_prompt.txt")
15with open(system_prompt_path) as f:
16 system_prompt = f.read().strip()
17user_prompt = (
18 "python_code: def add(a, b):\n"
19 " return a + b\n\n"
20 "func_name: add\n"
21 "description: optimize with cython"
22)
23
24messages = [
25 {"role": "system", "content": system_prompt},
26 {"role": "user", "content": user_prompt},
27]
28
29inputs = tok.apply_chat_template(
30 messages,
31 tokenize=True,
32 add_generation_prompt=True,
33 return_tensors="pt",
34).to(model.device)
35
36with torch.no_grad():
37 out = model.generate(inputs, max_new_tokens=512)
38
39print(tok.decode(out[0], skip_special_tokens=True))system_prompt.txt for reproducible agent behavior.