Text Generation
Transformers
Safetensors
qwen3_5_text
agentic-coding
reasoning
tool-use
on-device
laptop-scale
sft
reinforcement-learning
conversational
Instructions to use jsbaicenter/JSBAI-Coder-4B with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use jsbaicenter/JSBAI-Coder-4B with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-generation", model="jsbaicenter/JSBAI-Coder-4B") messages = [ {"role": "user", "content": "Who are you?"}, ] pipe(messages)# pip install -U transformers accelerate # Load model directly from transformers import AutoTokenizer, AutoModelForCausalLM tokenizer = AutoTokenizer.from_pretrained("jsbaicenter/JSBAI-Coder-4B") model = AutoModelForCausalLM.from_pretrained("jsbaicenter/JSBAI-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=256) print(tokenizer.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- vLLM
How to use jsbaicenter/JSBAI-Coder-4B with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "jsbaicenter/JSBAI-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/JSBAI-Coder-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }'Use Docker
docker model run hf.co/jsbaicenter/JSBAI-Coder-4B
- SGLang
How to use jsbaicenter/JSBAI-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/JSBAI-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/JSBAI-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/JSBAI-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/JSBAI-Coder-4B", "messages": [ { "role": "user", "content": "What is the capital of France?" } ] }' - Docker Model Runner
How to use jsbaicenter/JSBAI-Coder-4B with Docker Model Runner:
docker model run hf.co/jsbaicenter/JSBAI-Coder-4B
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -16,9 +16,7 @@ pipeline_tag: text-generation
|
|
| 16 |
|
| 17 |
# JSBAI-Coder-4B
|
| 18 |
|
| 19 |
-
**An agentic coding model that runs on your laptop.** JSBAI-Coder-4B is a 4B-parameter model fine-tuned from Qwen3.5-4B for multi-step, tool-using software engineering
|
| 20 |
-
|
| 21 |
-
Built by the [James Silberrad Brown Center for AI](https://sdsu.edu) (SDSU).
|
| 22 |
|
| 23 |
## Results
|
| 24 |
|
|
@@ -27,16 +25,16 @@ Built by the [James Silberrad Brown Center for AI](https://sdsu.edu) (SDSU).
|
|
| 27 |
| **Live-60** (real-world SWE, t32) | 15.0% | **21.7%** | **+44% relative** |
|
| 28 |
| **IFEval** (excl-empty, 8K) | 84.66 | **87.21** | +2.55 |
|
| 29 |
| **Held-out SWE** (unseen instances, K=8) | 10.1% | **82.9%** | **+72.8pp** |
|
| 30 |
-
| MMLU-Pro (generative) | TBD | TBD |
|
| 31 |
-
| Terminal-Bench 2.1 | TBD | TBD |
|
| 32 |
|
| 33 |
-
*Held-out SWE: 121 never-trained coding instances solved with verified test execution
|
| 34 |
|
| 35 |
## What it does
|
| 36 |
|
| 37 |
-
- **Agentic software engineering**: multi-turn bug investigation, tool orchestration (bash, file editing, test running), patch generation and verification
|
| 38 |
- **Interleaved reasoning**: thinks before each tool call, like much larger reasoning models
|
| 39 |
-
- **Quality held**: instruction-following *improved* over base (87.21 vs 84.66 IFEval)
|
| 40 |
- **Laptop-scale**: ~8GB VRAM BF16 / ~5GB NVFP4
|
| 41 |
|
| 42 |
## Training methodology
|
|
@@ -44,10 +42,10 @@ Built by the [James Silberrad Brown Center for AI](https://sdsu.edu) (SDSU).
|
|
| 44 |
**Teacher-seeded agentic RL.** The model was produced in three stages:
|
| 45 |
|
| 46 |
1. **Seed SFT**: a small curated set (~1,875 verified trajectories) from GLM-5.3 (a 744B-A40B open model) bootstrap the student into the agentic tool-use distribution
|
| 47 |
-
2. **GRPO with verifiable rewards**: 145 batches of on-policy RL on a difficulty-banded pool of real SWE tasks (237 unique instances), where the reward is *actual test execution*
|
| 48 |
-
3. **Generalization gates**: held-out never-trained instances verified the transfer at every phase boundary (10.1%
|
| 49 |
|
| 50 |
-
The RL phase is the capability engine: the seed SFT contributes the behavioral format, the verification-driven RL builds the problem-solving. We extensively studied on-policy distillation from the teacher (logprob-scoring) and found the signal prefers stylistic imitation over correctness at every model family and tier we tested
|
| 51 |
|
| 52 |
## Usage
|
| 53 |
|
|
@@ -64,7 +62,7 @@ A quantized NVFP4 variant (~5GB) and an MTP-boosted speculative decoding head (f
|
|
| 64 |
|
| 65 |
- 4B-scale knowledge limits: obscure factual recall and extreme-domain reasoning remain behind larger models
|
| 66 |
- The agent loop is tuned for sandboxed container environments; other deployment contexts are untested
|
| 67 |
-
- Safety behaviors inherited from the base model; the RL phase was reward-verification only (no safety-specific training)
|
| 68 |
|
| 69 |
## Lineage & credits
|
| 70 |
|
|
|
|
| 16 |
|
| 17 |
# JSBAI-Coder-4B
|
| 18 |
|
| 19 |
+
**An agentic coding model that runs on your laptop.** JSBAI-Coder-4B is a 4B-parameter model fine-tuned from Qwen3.5-4B for multi-step, tool-using software engineering: the capability class currently gated to 27B+ models, at a size that fits consumer GPUs.
|
|
|
|
|
|
|
| 20 |
|
| 21 |
## Results
|
| 22 |
|
|
|
|
| 25 |
| **Live-60** (real-world SWE, t32) | 15.0% | **21.7%** | **+44% relative** |
|
| 26 |
| **IFEval** (excl-empty, 8K) | 84.66 | **87.21** | +2.55 |
|
| 27 |
| **Held-out SWE** (unseen instances, K=8) | 10.1% | **82.9%** | **+72.8pp** |
|
| 28 |
+
| MMLU-Pro (generative) | TBD | TBD | TBD |
|
| 29 |
+
| Terminal-Bench 2.1 | TBD | TBD | TBD |
|
| 30 |
|
| 31 |
+
*Held-out SWE: 121 never-trained coding instances solved with verified test execution. The gains are broad-spectrum generalization, not benchmark memorization. Our decontamination protocol is published with the model.*
|
| 32 |
|
| 33 |
## What it does
|
| 34 |
|
| 35 |
+
- **Agentic software engineering**: multi-turn bug investigation, tool orchestration (bash, file editing, test running), patch generation and verification, in real repositories inside sandboxed containers
|
| 36 |
- **Interleaved reasoning**: thinks before each tool call, like much larger reasoning models
|
| 37 |
+
- **Quality held**: instruction-following *improved* over base (87.21 vs 84.66 IFEval). The agentic gains cost nothing on general quality.
|
| 38 |
- **Laptop-scale**: ~8GB VRAM BF16 / ~5GB NVFP4
|
| 39 |
|
| 40 |
## Training methodology
|
|
|
|
| 42 |
**Teacher-seeded agentic RL.** The model was produced in three stages:
|
| 43 |
|
| 44 |
1. **Seed SFT**: a small curated set (~1,875 verified trajectories) from GLM-5.3 (a 744B-A40B open model) bootstrap the student into the agentic tool-use distribution
|
| 45 |
+
2. **GRPO with verifiable rewards**: 145 batches of on-policy RL on a difficulty-banded pool of real SWE tasks (237 unique instances), where the reward is *actual test execution*. The model's patch must make the hidden tests pass.
|
| 46 |
+
3. **Generalization gates**: held-out never-trained instances verified the transfer at every phase boundary (10.1% to 82.9% pass rate).
|
| 47 |
|
| 48 |
+
The RL phase is the capability engine: the seed SFT contributes the behavioral format, the verification-driven RL builds the problem-solving. We extensively studied on-policy distillation from the teacher (logprob-scoring) and found the signal prefers stylistic imitation over correctness at every model family and tier we tested. Those negative results and the mechanism are documented in our technical report.
|
| 49 |
|
| 50 |
## Usage
|
| 51 |
|
|
|
|
| 62 |
|
| 63 |
- 4B-scale knowledge limits: obscure factual recall and extreme-domain reasoning remain behind larger models
|
| 64 |
- The agent loop is tuned for sandboxed container environments; other deployment contexts are untested
|
| 65 |
+
- Safety behaviors inherited from the base model; the RL phase was reward-verification only (no safety-specific training). See the base model card
|
| 66 |
|
| 67 |
## Lineage & credits
|
| 68 |
|