Text Generation
Transformers
Safetensors
qwen3_5_text
agentic-coding
reasoning
tool-use
on-device
laptop-scale
sft
reinforcement-learning
conversational
Instructions to use jsbaicenter/Aztec-Coder-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jsbaicenter/Aztec-Coder-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jsbaicenter/Aztec-Coder-4B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("jsbaicenter/Aztec-Coder-4B") model = AutoModelForCausalLM.from_pretrained("jsbaicenter/Aztec-Coder-4B", 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 jsbaicenter/Aztec-Coder-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jsbaicenter/Aztec-Coder-4B" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "jsbaicenter/Aztec-Coder-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/jsbaicenter/Aztec-Coder-4B
- SGLang
How to use jsbaicenter/Aztec-Coder-4B 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 "jsbaicenter/Aztec-Coder-4B" \ --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": "jsbaicenter/Aztec-Coder-4B", "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 "jsbaicenter/Aztec-Coder-4B" \ --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": "jsbaicenter/Aztec-Coder-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use jsbaicenter/Aztec-Coder-4B with Docker Model Runner:
docker model run hf.co/jsbaicenter/Aztec-Coder-4B
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,3 +1,110 @@
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
license: apache-2.0
|
| 3 |
+
base_model:
|
| 4 |
+
- Qwen/Qwen3.5-4B
|
| 5 |
+
tags:
|
| 6 |
+
- agentic-coding
|
| 7 |
+
- reasoning
|
| 8 |
+
- tool-use
|
| 9 |
+
- on-device
|
| 10 |
+
- laptop-scale
|
| 11 |
+
- sft
|
| 12 |
+
- reinforcement-learning
|
| 13 |
+
library_name: transformers
|
| 14 |
+
pipeline_tag: text-generation
|
| 15 |
+
datasets:
|
| 16 |
+
- nvidia/Nemotron-Post-Training-Dataset-v2
|
| 17 |
---
|
| 18 |
+
|
| 19 |
+
# James Silberrad Brown Center for AI Research
|
| 20 |
+
|
| 21 |
+
The **James Silberrad Brown Center for Artificial Intelligence (JSBCAI)** is an interdisciplinary research hub at San Diego State University dedicated to advancing artificial intelligence through foundational research, applied innovation, and student-driven inquiry.
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
# Aztec-Coder-4B
|
| 25 |
+
|
| 26 |
+
**An agentic coding model that runs on your laptop.**
|
| 27 |
+
|
| 28 |
+
Aztec-Coder-4B is a 4B-parameter model, fine-tuned from Qwen3.5-4B, that investigates bugs, edits files, runs commands, and verifies its own fixes in real software repositories. Agentic coding at this level has required 27B+ models. This one fits on a consumer GPU.
|
| 29 |
+
|
| 30 |
+
## Results
|
| 31 |
+
|
| 32 |
+
We reserved 121 real software bugs that the model never saw during training. Before fine-tuning, it solved 10% of them. After training, it solved **83%**, verified by running each project's hidden test suite. The model learned to fix bugs in general, not just the ones it practiced on.
|
| 33 |
+
|
| 34 |
+
| Benchmark | Qwen3.5-4B (base) | **Aztec-Coder-4B** | Aztec-Coder-4B-NVFP4 |
|
| 35 |
+
|---|---|---|---|
|
| 36 |
+
| **Generalization test** (121 unseen bugs, tests run to verify) | 10.1% | **82.9%** | 38.0%* |
|
| 37 |
+
| **Live-60** (60 real-world engineering tasks, solved end-to-end in containers) | 15.0% | **21.7%** | 15.0% |
|
| 38 |
+
| **Instruction-following** (IFEval) | 84.66 | **87.21** | 86.37 |
|
| 39 |
+
| MMLU-Pro | 64.0% | **70.0%** | 66.85% |
|
| 40 |
+
| Terminal-Bench 1.0 (core, 80 tasks) | 33.8% | **33.8%** | 18.8% |
|
| 41 |
+
| Terminal-Bench 2.1 (89 tasks) | coming soon | coming soon | coming soon |
|
| 42 |
+
|
| 43 |
+
The instruction-following score *improved* over the base model. The coding gains cost nothing on general quality. Gains of this kind usually trade one for the other.
|
| 44 |
+
|
| 45 |
+
*NVFP4 generalization: 12/32 on a 32-instance subset (the same slice our comparisons use). The quantization costs roughly half the generalization capability.
|
| 46 |
+
|
| 47 |
+
Our decontamination protocol is published with the model: none of these benchmark problems overlap the training data.
|
| 48 |
+
|
| 49 |
+
## What it does
|
| 50 |
+
|
| 51 |
+
- **Investigates and fixes bugs in real repositories.** The model explores a codebase, reads the failing code, writes a patch, and runs the tests to check itself, inside a sandboxed container.
|
| 52 |
+
- **Thinks before each action.** Like much larger reasoning models, it reasons between tool calls.
|
| 53 |
+
- **Runs on consumer hardware.** ~8GB VRAM in BF16; ~5GB as the NVFP4 quantized variant.
|
| 54 |
+
|
| 55 |
+
## How we trained it
|
| 56 |
+
|
| 57 |
+
Three stages, each with a plain-language summary:
|
| 58 |
+
|
| 59 |
+
1. **Seed demonstrations.** GLM-5.3, a frontier 744B open model, generated roughly 1,875 coding trajectories. We verified every one by running the actual tests before using it. These demonstrations taught our model the *format* of agentic coding: how to use tools, when to run tests, what a working solution looks like.
|
| 60 |
+
|
| 61 |
+
2. **Reinforcement learning on real bugs.** The model then practiced on 237 curated software engineering problems: ones it could sometimes solve, but not reliably. For each problem, the model repeatedly attempted a fix. Solutions that made the real hidden tests pass were reinforced; failures were not. This phase, 145 batches of on-policy GRPO, built the actual problem-solving ability.
|
| 62 |
+
|
| 63 |
+
3. **Generalization checks.** At every stage boundary, we re-tested the model on problems it had never trained on. The 10.1% to 82.9% jump above is the result.
|
| 64 |
+
|
| 65 |
+
### Training data
|
| 66 |
+
|
| 67 |
+
- **[NVIDIA Nemotron-Post-Training-Dataset-v2](https://huggingface.co/datasets/nvidia/Nemotron-Post-Training-Dataset-v2)**: a portion of its general instruction-following, structured-output, and tool-use data anchored the model's general capabilities.
|
| 68 |
+
- **Our distilled seed set**: ~1,875 verified coding trajectories generated by GLM-5.3 (Z.AI), each confirmed by running the real test suite before use.
|
| 69 |
+
- **Open SWE datasets**: a blend of open software-engineering problem sets provided the RL practice pool.
|
| 70 |
+
- **The RL phase used no static data at all**: the model generated fresh attempts each batch, and only test-verified outcomes became training signal.
|
| 71 |
+
|
| 72 |
+
## Usage
|
| 73 |
+
|
| 74 |
+
```python
|
| 75 |
+
from vllm import LLM
|
| 76 |
+
llm = LLM(model="jsbaicenter/Aztec-Coder-4B", max_model_len=131072)
|
| 77 |
+
```
|
| 78 |
+
|
| 79 |
+
Recommended sampling: `temperature 1.0, top_p 0.95`. The model uses the Qwen3.5 chat template with interleaved thinking (the `qwen3` reasoning parser in vLLM) and `qwen3_coder` tool-call format.
|
| 80 |
+
|
| 81 |
+
A quantized NVFP4 variant (~5GB) and an MTP-boosted speculative decoding head (for faster inference) are available from the same organization.
|
| 82 |
+
|
| 83 |
+
## Limitations
|
| 84 |
+
|
| 85 |
+
- A 4B model has 4B knowledge: obscure facts and extreme-domain reasoning still favor larger models.
|
| 86 |
+
- We tuned the agent loop for sandboxed container environments; other deployment contexts are untested.
|
| 87 |
+
- Safety behaviors come from the base model; the RL phase optimized test-passing only, with no safety-specific training. See the base model card.
|
| 88 |
+
|
| 89 |
+
## Lineage & credits
|
| 90 |
+
|
| 91 |
+
- **Base model**: [Qwen/Qwen3.5-4B](https://huggingface.co/Qwen/Qwen3.5-4B) (Apache-2.0)
|
| 92 |
+
- **Demonstration generator**: GLM-5.3 (Z.AI), served locally
|
| 93 |
+
- **General training data**: [nvidia/Nemotron-Post-Training-Dataset-v2](https://huggingface.co/datasets/nvidia/Nemotron-Post-Training-Dataset-v2)
|
| 94 |
+
- **Quantization**: [NVIDIA ModelOpt](https://github.com/NVIDIA/Model-Optimizer) (NVFP4)
|
| 95 |
+
- **Technical report**: coming soon, covering the full methodology, the ablations, and our negative results on teacher-logprob distillation.
|
| 96 |
+
|
| 97 |
+
## License
|
| 98 |
+
|
| 99 |
+
Apache-2.0, matching the base model.
|
| 100 |
+
|
| 101 |
+
## Citation
|
| 102 |
+
|
| 103 |
+
```bibtex
|
| 104 |
+
@misc{jsbai_coder_4b,
|
| 105 |
+
title={Aztec-Coder-4B: Agentic Coding at Laptop Scale via Teacher-Seeded RL},
|
| 106 |
+
author={James Silberrad Brown Center for AI},
|
| 107 |
+
year={2026},
|
| 108 |
+
publisher={HuggingFace}
|
| 109 |
+
}
|
| 110 |
+
```
|