Text Generation
Transformers
Safetensors
olmo3
code
reasoning
lora-merged
livecodebench
conversational
Instructions to use modrill/code-think-o7b-20260908 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use modrill/code-think-o7b-20260908 with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="modrill/code-think-o7b-20260908") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("modrill/code-think-o7b-20260908") model = AutoModelForCausalLM.from_pretrained("modrill/code-think-o7b-20260908", device_map="auto") messages = [ {"role": "user", "content": "Who are you?"}, ] inputs = tokenizer.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=40) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use modrill/code-think-o7b-20260908 with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "modrill/code-think-o7b-20260908" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "modrill/code-think-o7b-20260908", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/modrill/code-think-o7b-20260908
- SGLang
How to use modrill/code-think-o7b-20260908 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 "modrill/code-think-o7b-20260908" \ --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": "modrill/code-think-o7b-20260908", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'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 "modrill/code-think-o7b-20260908" \ --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": "modrill/code-think-o7b-20260908", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use modrill/code-think-o7b-20260908 with Docker Model Runner:
docker model run hf.co/modrill/code-think-o7b-20260908
| license: apache-2.0 | |
| base_model: allenai/Olmo-3-1025-7B | |
| tags: | |
| - code | |
| - reasoning | |
| - lora-merged | |
| - livecodebench | |
| pipeline_tag: text-generation | |
| library_name: transformers | |
| # code-think-o7b-20260908 | |
| Research checkpoint: **allenai/Olmo-3-1025-7B** (`a81bae42db3975be1671e27b9c9a56da1a9f980f`) after V4 LoRA SFT on Qwen3-30B-A3B-Thinking-2507 traces (OLMo-tokenized V4 payload), then merged to full weights. | |
| Repo name uses **OLMo-3** because `RUN_IDENTITY.model.hf_id` is `allenai/Olmo-3-1025-7B` (not OLMo-2). | |
| This is a **research checkpoint, not a product**. Single-seed diagnostic numbers only. Do not treat DEV256 as a leaderboard claim. | |
| License: **Apache-2.0**, inherited from [allenai/Olmo-3-1025-7B](https://huggingface.co/allenai/Olmo-3-1025-7B) (verified from the local base `README.md`: `license: apache-2.0`). | |
| ## Base, teacher, and data | |
| | | | | |
| |---|---| | |
| | Student | `allenai/Olmo-3-1025-7B` revision `a81bae42db3975be1671e27b9c9a56da1a9f980f` | | |
| | Teacher | `Qwen/Qwen3-30B-A3B-Thinking-2507` traces (V4 paired think payload, OLMo renderer / tokenizer) | | |
| | Problems | **4715** unique problems (`source_1ep_rows`); physical 2-epoch concat = **9430** rows | | |
| | Dose | **31,689,386** assistant tokens / epoch (OLMo tokenizer; not the Qwen 32.4M count); endpoint **63,378,772** assistant tokens (2 epochs) | | |
| | Train seed | **42** | | |
| ## Recipe | |
| - LoRA **r64 / α128**, dropout 0.0, seven projections: `q_proj`, `k_proj`, `v_proj`, `o_proj`, `gate_proj`, `up_proj`, `down_proj` | |
| - Embeddings / `lm_head` frozen except **two-sided trainable B-row** for **100257** (`<|endoftext|>`). Token id from `adapter/TOKEN_ROWS_META.json`. | |
| - Assistant supervised tail: `<|endoftext|>` (**100257**) | |
| - LR **1e-4**, AdamW (β 0.9/0.95), **cosine** over assistant-token dose, **warmup 6%** (3,802,726 / 63,378,772 tokens), weight decay **0.1** | |
| - **bf16**, no packing, no truncation, context 32768 at train time | |
| - **2 epochs**, physical concat. Endpoint-only score; no checkpoint picking. | |
| - Chat template: `olmo3-lcb-noprefill` (no generation-prompt `<think>` prefill). Bundled as `chat_template.jinja`. | |
| Merged weights are the 2-epoch endpoint (`step-000904`, 63,378,772 assistant tokens). LoRA + B-row are under `adapter/`. | |
| ## Evaluation (DEV256) | |
| 256-problem LiveCodeBench-derived **dev** split. Seed **3407**, **think** mode, **no `<think>` prefill**, max generation ~32k, sandbox-verified **pass@1**. Temperature 0.6, top-p 0.95, top-k 20. | |
| **Cap** = generations that hit the 32k length limit without closing `</think>`. | |
| | Model | pass@1 | Cap | Notes | | |
| |---|---:|---:|---| | |
| | **code-think-o7b-20260908** | **56/256** | **149** | this repo; seed 3407 | | |
| | Olmo-3-1025-7B (same contract, think) | 15/256 | 104 | bare base, seed 3407 | | |
| Single seed. These are research checkpoints, not product scores. | |
| ## Usage | |
| Merged full weights; no PEFT required at inference. The pinned OLMo template supplies a default system turn. **Do not** prefill `<think>`. | |
| ```python | |
| from transformers import AutoModelForCausalLM, AutoTokenizer | |
| repo = "modrill/code-think-o7b-20260908" | |
| tokenizer = AutoTokenizer.from_pretrained(repo) | |
| model = AutoModelForCausalLM.from_pretrained( | |
| repo, torch_dtype="bfloat16", device_map="auto" | |
| ) | |
| messages = [{"role": "user", "content": problem_statement}] | |
| prompt = tokenizer.apply_chat_template( | |
| messages, | |
| tokenize=False, | |
| add_generation_prompt=True, | |
| ) | |
| inputs = tokenizer(prompt, return_tensors="pt").to(model.device) | |
| output = model.generate( | |
| **inputs, | |
| max_new_tokens=32768, | |
| do_sample=True, | |
| temperature=0.6, | |
| top_p=0.95, | |
| top_k=20, | |
| ) | |
| print(tokenizer.decode(output[0][inputs["input_ids"].shape[1]:], skip_special_tokens=False)) | |
| ``` | |
| Stop ids used in the official eval: `100257` (`<|endoftext|>`), `100265` (`<|im_end|>`). | |
| ## Repo layout | |
| - Root: merged HF weights (`config.json`, `model.safetensors`, tokenizer, `generation_config.json`, `chat_template.jinja`) plus `OFFICIAL_MERGE_RECEIPT.json` | |
| - `adapter/`: LoRA, `token_rows_both_sides.safetensors`, `TOKEN_ROWS_META.json`, checkpoint `MANIFEST.json` | |
| - `provenance/`: train `RUN_IDENTITY.json`, `TRAINING_CONFIG.json`, `POLICY.json`; DEV256 `COMPLETE.json` | |
| - `MANIFEST.sha256` | |
| Optimizer / resume states are **not** included. | |