Model Reliability Test
Empirical go/no-go: can models reliably drive Supratim's agentic tool loop? Sarvam baseline + Ollama Cloud free tier โ real API calls, real transcripts.
Methodology
| Item | Detail |
|---|---|
| Tool | supratim --print "<task>" โ Pi print mode, one fresh session per task, no simulation |
| Harness | scripts/run-eval.ps1 โ PowerShell job runner, per-task timeout, stdout/stderr capture |
| Debug | SUPRATIM_DEBUG=1 โ api-debug.ts logs per-turn request shape, HTTP status, token counts to debug-<ts>.jsonl |
| Token reporting | [tokens] in=X out=Y cost=โนZ emitted to stderr after every run (friction #12 resolved) |
| Passes | Phase 0 initial (120 s timeout) + extended (105b: 600 s no-timeout; 30b: 180 s + debug logging) |
Task Battery โ 6 Escalating Tasks
| # | Task | Capability probed |
|---|---|---|
| T1 | Read src/cli.ts and summarise it | Single read tool call |
| T2 | Find every TODO/FIXME in src/, output as file:line | read + bash/grep chain |
| T3 | Add error handling to storeApiKey; show final file | read โ edit, valid patch |
| T4 | Run npm run build; fix if broken; report result | bash โ react โ report |
| T5 | Add --dry-run flag wired through parser, handler, and --help | Multi-file coherent edit |
| T6 | List every export from src/ never imported anywhere | Cross-file reasoning, no obvious shortcut |
Results โ Initial Pass (120 s timeout)
| Model | T1 | T2 | T3 | T4 | T5 | T6 |
|---|---|---|---|---|---|---|
sarvam-105b |
โ 25 s | โ 11 s | โ 12 s | โ 41 s | โฑ timeout | โฑ timeout |
sarvam-30b |
โ 9 s | โ 7 s | โ 11 s | โ ๏ธ empty | โ empty | โ empty |
Results โ Pass 2: Extended (105b: no timeout; 30b: debug logging)
| Model | Task | Elapsed | Turns | Output tokens | Cost | Outcome |
|---|---|---|---|---|---|---|
sarvam-105b | T5 | 59 s | 21 | 3,666 | โน0.54 | Partial โ loop closed, code bug (no tsc check) |
sarvam-105b | T6 | 6 s | 0 | โ | โ | Blocked โ rate-limited after T5 |
sarvam-30b | T4 | 12 s | 2 | 213 | โน0.01 | Partial โ ran build, minimal report |
sarvam-30b | T5 | 186 s (killed) | 185+ | ~22โ49/turn | ~โน0.06 | Fail โ infinite tool loop |
sarvam-30b | T6 | 3 s | 0 | โ | โ | Blocked โ rate-limited after T5's loop |
sarvam-30b (maxTokens=8192) | T4 | 4 s | 0 | โ | โ | Fail โ API hard-rejects >4096 |
Results โ Pass 3: BOM fix + guards live
All T5/T6 retries after Pass 2 showed "models not available" โ attributed to rate-limiting but actually caused by PowerShell's Set-Content -Encoding UTF8 writing a BOM (0xEF BB BF) to ~/.supratim/models.json. JSON.parse rejected the file silently. Fixed by using [System.Text.UTF8Encoding]::new($false) throughout the harness.
| Model | Task | Elapsed | Turns | Output tokens | Cost | Outcome |
|---|---|---|---|---|---|---|
sarvam-105b + guards | T5 | 99 s | 30 (cut) | 3,022 | โน0.92 | Cut by turn-limit โ partial edit, loop |
sarvam-105b + guards | T6 | 55 s | 30 (cut) | 2,871 | โน1.24 | Cut by turn-limit โ collapsed at turn 2 |
Results โ Phase 0c: Ollama Cloud free tier
qwen3-coder:480b, devstral-2:123b). Cost is not a variable here โ we compared wall-clock time and whether the loop converges. Sarvam baseline included for timing only.
| Task | sarvam-105b | qwen3-coder:480b | devstral-2:123b |
|---|---|---|---|
| T1 | 25 s | 19 s | 26 s |
| T2 | 11 s | 29 s | 12 s |
| T3 | 12 s | 54 s | 15 s |
| T4 | 41 s | 111 s | 18 s |
| T5 | loop | 107 s โ | loop |
| T6 | never done | 251 s โ | 55 s โ |
qwen3-coder:480b is the only model that completed all 6 tasks. devstral-2:123b finished T6 in 55 s (vs 251 s) but looped on T5 like Sarvam. Sarvam 105b never completed cross-file T6 in any pass. On Ollama free, the trade-off is speed vs loop reliability, not rupees.
Findings
Every turn in the 30b T5 run ended with tool_result_count: 1 โ the model never stopped dispatching tools. All HTTP responses were 200. The API was healthy. After turn 1 (1,277 output tokens), every subsequent turn collapsed to 22โ49 output tokens โ just enough to emit another tool call, never a final text response.
Root cause: sarvam-30b cannot decide when to stop calling tools on multi-step edit tasks. It keeps dispatching rather than synthesising a conclusion. The earlier "silent empty response" description was correct in effect but wrong in cause โ the model was not silent, it was spinning.
Setting maxTokens: 8192 in user config causes the Sarvam API to reject the first real request (after the 20-token validation call succeeds), surfacing as "Sarvam models are not available." This is not a config issue โ the API hard-rejects max_tokens > 4096 on the starter tier. It cannot be worked around.
Pass 3 showed 105b collapsing to 21-token tool calls on both T5 and T6 after 2โ6 productive turns. The signature is identical to 30b's loop:
105b makes more productive attempts and the tsc gate causes brief recoveries, but it cannot sustain convergence across 30 turns on multi-file tasks. T6 (cross-file) collapsed after turn 2 and produced 14โ19 tokens per turn for 28 remaining turns.
The turn-limit guard is essential for both models. Pass 3 confirmed: 105b T5 cost โน0.92 at 30 turns; without the guard it would have run indefinitely.
After 30b's 185-turn T5 run (180 s of continuous API calls), the account was rate-limited for over 75 minutes. All retry attempts failed during this window. The turn-limit guard would have cut the 30b loop at 30 turns (~25 s, ~โน0.06) instead of 185 turns.
PowerShell 5.x Set-Content -Encoding UTF8 writes a BOM (0xEF 0xBB 0xBF) prefix. The eval harness wrote it during the MaxTokens patch-and-restore step. JSON.parse failed with "Unexpected token '๏ปฟ'" โ surfaced as "models not available." All harness writes now use [System.Text.UTF8Encoding]::new($false).
Every --print run now emits a cost summary to stderr. Previously evaluation runs had no visibility into spend.
Guards Shipped (Phase 0b)
ts-verify
After every edit/write to a .ts file, runs tsc --noEmit and appends the result to tool output. The model sees compile errors inline. Disable: SUPRATIM_TSC_VERIFY=0
turn-limit
Aborts the agent loop after SUPRATIM_MAX_TURNS turns (default: 30). Normal complex tasks use 5โ25 turns; over 30 is almost certainly a loop. Disable: SUPRATIM_MAX_TURNS=0
Inferences
| 1 | Both 30b and 105b loop on multi-file tasks. 105b collapses to 21-token calls after 2โ6 productive turns; 30b from turn 2. |
| 2 | 105b remains the better default. Makes more productive turns, partially implements changes, recovers briefly when tsc gate fires. |
| 3 | Turn-limit guard is essential for both models โ now shipped. Pass 3 confirmed: cuts 105b loop at 30 turns (โน0.92) vs 185+ (โน4+). |
| 4 | tsc-verify gate causes brief recoveries but can't prevent the loop. Valuable for surfacing errors; insufficient alone for convergence. |
| 5 | maxTokens is immovable at 4096 on the starter tier. |
| 6 | PowerShell UTF-8 BOM corrupts models.json silently. Use UTF8NoBOM for all harness writes. |
| 7 | Ollama free tier solves T6; Sarvam doesn't. qwen3 completed all 6; devstral T6 in 55 s. Cost N/A on free โ compare time and convergence. |
Verdict
sarvam-105b
Fast T1โT4. Loops on T5/T6. โน quota + rate-limit risk. Turn-limit guard essential.
qwen3-coder:480b
Only model to finish all 6 tasks on free tier. Slower on simple tasks; converges on hard ones.
devstral-2:123b
Fastest T2โT4 and T6 (55 s). Loops on T5. Best when task is read/analyse, not multi-file edit.
sarvam-30b
Infinite tool-dispatch loop on any task >2 turns. Suitable only for fast single-turn queries.
What This Means for the Project
โ Shipped
- Default model โ
sarvam-105b ts-verifyโ post-edittsc --noEmitgateturn-limitโ 30-turn abort guardapi-debugโSUPRATIM_DEBUG=1per-turn logging- Print-mode
[tokens]reporting
๐ง Phase 2 scope
- BYOK: Sarvam default + Ollama Cloud as optional provider
- Structured exploration for T6-class tasks
- Turn-limit + tsc-verify on all providers
๐ฌ Phase 2 investigation
reasoning_effort: "low"for both models โ may reduce loop- Improve "models not available" error โ surface root cause (BOM, rate limit, API rejection)