| --- |
| base_model: openai/gpt-oss-20b |
| library_name: transformers |
| tags: |
| - lora |
| - sft |
| - tool-use |
| - gpt-oss |
| license: apache-2.0 |
| --- |
| |
| # gpt-oss-claude-code |
|
|
| Fine-tuned [`openai/gpt-oss-20b`](https://huggingface.co/openai/gpt-oss-20b) for tool-use and agentic coding tasks. LoRA adapters merged into base weights. |
|
|
| ## Quick start |
| ```python |
| import re, torch |
| from transformers import AutoModelForCausalLM, AutoTokenizer |
| |
| model = AutoModelForCausalLM.from_pretrained( |
| "deburky/gpt-oss-claude-code", |
| torch_dtype=torch.bfloat16, |
| device_map="auto", |
| ) |
| tokenizer = AutoTokenizer.from_pretrained("deburky/gpt-oss-claude-code") |
| |
| messages = [{"role": "user", "content": "Who is Alan Turing?"}] |
| inputs = tokenizer.apply_chat_template( |
| messages, add_generation_prompt=True, |
| return_tensors="pt", return_dict=True, |
| ).to(model.device) |
| |
| with torch.no_grad(): |
| out = model.generate(**inputs, max_new_tokens=256) |
| response = tokenizer.decode(out[0][inputs["input_ids"].shape[-1]:]) |
| |
| if "<|channel|>final<|message|>" in response: |
| response = response.split("<|channel|>final<|message|>")[-1] |
| print(re.sub(r"<\\|[^>]+\\|>", "", response).strip()) |
| ``` |
|
|
| ## Apple Silicon (MLX) |
|
|
| A fused MLX version is available at [`deburky/gpt-oss-claude-mlx`](https://huggingface.co/deburky/gpt-oss-claude-mlx). |
|
|
| ## Training |
|
|
| - **Data:** ~280 tool-use conversation examples in gpt-oss harmony format |
| - **Method:** LoRA (rank 8, alpha 16) on attention + MoE expert layers, merged after training |
| - **LR:** 1e-4, cosine schedule |
| - **Final val loss:** ~0.48 |
| - **Hardware:** Google Colab |
|
|