File size: 2,635 Bytes
e117027
 
e17362e
 
 
 
 
e117027
e17362e
e117027
e17362e
 
 
1841fa5
e17362e
 
 
 
 
 
 
 
 
1841fa5
e17362e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
---
license: apache-2.0
tags:
  - code
  - agent
  - merged
  - fine-tuned
---

# Primus

**A coding model that fixes what developers actually complain about.**

Primus is a 295B-parameter coding model trained using the APEX method stack. Unlike frontier models optimized for benchmark scores, Primus is optimized for the five complaints developers have about AI coding assistants:

1. **Regression-free repair** — fixes the bug without breaking adjacent functionality
2. **Scope discipline** — changes only what you asked for, not 47 files
3. **Ask-vs-guess** — asks clarifying questions instead of guessing wrong
4. **API honesty** — never invents functions or libraries that don't exist
5. **Terseness** — minimal diffs, no essays

## Method

- **Training:** SFT → TIDE-DPO → RLVR sprint
- **Data:** 31,453 decontaminated samples (priors, CAT units, behavior demonstrations, TIDE pairs)
- **Hardware:** 8× RTX PRO 6000 (764GB VRAM)

## The APEX Stack

- **CAT** (Consequence-Augmented Training): Predicts blast radius before acting
- **TIDE** (Step-Anchored DPO): Assigns credit/blame at the exact causal step
- **SENTINEL**: Anti-reward-hacking verifier
- **AEGIS**: Adaptive best-of-N at inference (safest effective option)
- **SONAR**: External memory for long-horizon tasks

## Usage

```python
from transformers import AutoModelForCausalLM, AutoTokenizer

model = AutoModelForCausalLM.from_pretrained(
    "kovacreations/primus",
    trust_remote_code=True,
    device_map="auto",
    torch_dtype="bfloat16"
)
tok = AutoTokenizer.from_pretrained("kovacreations/primus", trust_remote_code=True)

messages = [
    {"role": "system", "content": "You are Primus, a coding assistant. Write clean, minimal code."},
    {"role": "user", "content": "Fix the null pointer in auth.py"}
]
prompt = tok.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
inputs = tok(prompt, return_tensors="pt").to(model.device)
out = model.generate(**inputs, max_new_tokens=2048)
print(tok.decode(out[0], skip_special_tokens=True))
```

## Scorecard

Pre-registered 15-axis scorecard with all results published (wins and losses):

- 10 public benchmarks (Terminal-Bench, SWE-bench, etc.)
- 5 DevPain axes (regression, scope, ask, API honesty, terseness)

## Research Paper

See [PRIMUS_PAPER.md](PRIMUS_PAPER.md) for the full method description, training details, and analysis.

## Harness

Open-source evaluation harness: [github.com/kovalabs/nebula](https://github.com/kovalabs/nebula)

## License

Apache 2.0. Decontaminated training data. All losses published.

---

*Primus: first, do no harm to the codebase.*