specjudge 0.1.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
specjudge/__init__.py ADDED
@@ -0,0 +1,11 @@
1
+ """SpecJudge: local-first AI model recommender for Spec-Driven Development projects."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from importlib.metadata import PackageNotFoundError, version
6
+
7
+ try:
8
+ # Single source of truth: the version declared in pyproject.toml.
9
+ __version__ = version("specjudge")
10
+ except PackageNotFoundError: # running from a source tree without an install
11
+ __version__ = "0.0.0+unknown"
@@ -0,0 +1,613 @@
1
+ # SpecJudge model catalog
2
+ # -----------------------
3
+ # Community-editable reference source (Principle V / FR-017).
4
+ # To add a model or update a price, edit THIS file: no code changes needed.
5
+ # Every price MUST carry a `pricing_date` so its freshness is verifiable (FR-018).
6
+ # Entries without `pricing_date` are shown but flagged as "freshness not verifiable".
7
+ #
8
+ # Valid capability levels: low | medium | high | top
9
+ # Dimensions must match those in data/rating-rules.yaml.
10
+ #
11
+ # Prices are per million tokens, in USD, and are a MAINTAINED REFERENCE — not a
12
+ # live feed. Verify against the provider's pricing page before relying on them.
13
+
14
+ version: 1
15
+
16
+ dimensions:
17
+ - reasoning # reasoning complexity the project demands
18
+ - size # size / structure of the work (context, number of pieces)
19
+ - domain_specialization # domain specialization required
20
+
21
+ models:
22
+ # ---------------------------------------------------------------- Anthropic
23
+ - id: claude-opus-4-8
24
+ name: Claude Opus 4.8
25
+ family: Claude
26
+ open_source: false
27
+ provider: Anthropic
28
+ capabilities:
29
+ reasoning: top
30
+ size: top
31
+ domain_specialization: top
32
+ price:
33
+ input_per_million: 5.00
34
+ output_per_million: 25.00
35
+ currency: USD
36
+ pricing_date: 2026-07-20
37
+ notes: Frontier-tier reasoning and long-horizon agentic work. 1M context.
38
+
39
+ - id: claude-sonnet-5
40
+ name: Claude Sonnet 5
41
+ family: Claude
42
+ open_source: false
43
+ provider: Anthropic
44
+ capabilities:
45
+ reasoning: high
46
+ size: top
47
+ domain_specialization: high
48
+ price:
49
+ input_per_million: 3.00
50
+ output_per_million: 15.00
51
+ currency: USD
52
+ pricing_date: 2026-07-20
53
+ notes: >
54
+ Near-Opus quality on coding and agentic work at Sonnet cost. 1M context.
55
+ Introductory pricing of $2.00/$10.00 applies through 2026-08-31.
56
+
57
+ - id: claude-haiku-4-5
58
+ name: Claude Haiku 4.5
59
+ family: Claude
60
+ open_source: false
61
+ provider: Anthropic
62
+ capabilities:
63
+ reasoning: medium
64
+ size: medium
65
+ domain_specialization: medium
66
+ price:
67
+ input_per_million: 1.00
68
+ output_per_million: 5.00
69
+ currency: USD
70
+ pricing_date: 2026-07-20
71
+ notes: Fastest and most cost-effective Anthropic tier. 200K context.
72
+
73
+ # ------------------------------------------------------------------- OpenAI
74
+ - id: gpt-5-6-sol
75
+ name: GPT-5.6 Sol
76
+ family: GPT
77
+ open_source: false
78
+ provider: OpenAI
79
+ capabilities:
80
+ reasoning: top
81
+ size: top
82
+ domain_specialization: top
83
+ price:
84
+ input_per_million: 5.00
85
+ output_per_million: 30.00
86
+ currency: USD
87
+ pricing_date: 2026-07-20
88
+ notes: OpenAI's flagship tier.
89
+
90
+ - id: gpt-5-6-terra
91
+ name: GPT-5.6 Terra
92
+ family: GPT
93
+ open_source: false
94
+ provider: OpenAI
95
+ capabilities:
96
+ reasoning: high
97
+ size: high
98
+ domain_specialization: high
99
+ price:
100
+ input_per_million: 2.50
101
+ output_per_million: 15.00
102
+ currency: USD
103
+ pricing_date: 2026-07-20
104
+ notes: Mid tier of the GPT-5.6 family.
105
+
106
+ - id: gpt-5-6-luna
107
+ name: GPT-5.6 Luna
108
+ family: GPT
109
+ open_source: false
110
+ provider: OpenAI
111
+ capabilities:
112
+ reasoning: medium
113
+ size: medium
114
+ domain_specialization: medium
115
+ price:
116
+ input_per_million: 1.00
117
+ output_per_million: 6.00
118
+ currency: USD
119
+ pricing_date: 2026-07-20
120
+ notes: Entry tier of the GPT-5.6 family.
121
+
122
+ - id: gpt-4-1-nano
123
+ name: GPT-4.1 nano
124
+ family: GPT
125
+ open_source: false
126
+ provider: OpenAI
127
+ capabilities:
128
+ reasoning: low
129
+ size: low
130
+ domain_specialization: low
131
+ price:
132
+ input_per_million: 0.10
133
+ output_per_million: 0.40
134
+ currency: USD
135
+ pricing_date: 2026-07-20
136
+ notes: Budget floor of OpenAI's ladder; suitable only for simple, scoped work.
137
+
138
+ # ------------------------------------------------------------------- Google
139
+ - id: gemini-3-1-pro
140
+ name: Gemini 3.1 Pro
141
+ family: Gemini
142
+ open_source: false
143
+ provider: Google
144
+ capabilities:
145
+ reasoning: high
146
+ size: top
147
+ domain_specialization: high
148
+ price:
149
+ input_per_million: 2.00
150
+ output_per_million: 12.00
151
+ currency: USD
152
+ pricing_date: 2026-07-20
153
+ notes: >
154
+ Google's flagship tier. Long-context pricing rises to $4.00/$18.00 above
155
+ 200K tokens — the rate here is the standard band.
156
+
157
+ - id: gemini-3-5-flash
158
+ name: Gemini 3.5 Flash
159
+ family: Gemini
160
+ open_source: false
161
+ provider: Google
162
+ capabilities:
163
+ reasoning: high
164
+ size: high
165
+ domain_specialization: medium
166
+ price:
167
+ input_per_million: 1.50
168
+ output_per_million: 9.00
169
+ currency: USD
170
+ pricing_date: 2026-07-20
171
+ notes: Fast tier with strong general capability; flat pricing at any context length.
172
+
173
+ - id: gemini-3-flash
174
+ name: Gemini 3 Flash
175
+ family: Gemini
176
+ open_source: false
177
+ provider: Google
178
+ capabilities:
179
+ reasoning: medium
180
+ size: high
181
+ domain_specialization: medium
182
+ price:
183
+ input_per_million: 0.50
184
+ output_per_million: 3.00
185
+ currency: USD
186
+ pricing_date: 2026-07-20
187
+ notes: Previous-generation Flash; still available and notably cheaper.
188
+
189
+ - id: gemini-3-1-flash-lite
190
+ name: Gemini 3.1 Flash-Lite
191
+ family: Gemini
192
+ open_source: false
193
+ provider: Google
194
+ capabilities:
195
+ reasoning: low
196
+ size: medium
197
+ domain_specialization: low
198
+ price:
199
+ input_per_million: 0.25
200
+ output_per_million: 1.50
201
+ currency: USD
202
+ pricing_date: 2026-07-20
203
+ notes: Google's budget tier.
204
+
205
+ # ------------------------------------------------- Local (Ollama on Apple Silicon)
206
+ # These run on your own machine, so the per-token price is 0.00 — the real
207
+ # cost is the hardware you already own plus electricity. RAM figures are for
208
+ # Q4 quantisation via Ollama on Apple Silicon (unified memory, so the whole
209
+ # pool is available to the GPU). Leave headroom for the KV cache at long
210
+ # context. Being free, any of these wins the value comparison outright on a
211
+ # project whose demand it actually meets.
212
+
213
+ - id: gemma-4-e2b-local
214
+ name: Gemma 4 E2B (local)
215
+ family: Gemma
216
+ open_source: true
217
+ provider: Local / Ollama
218
+ capabilities:
219
+ reasoning: low
220
+ size: low
221
+ domain_specialization: low
222
+ price:
223
+ input_per_million: 0.00
224
+ output_per_million: 0.00
225
+ currency: USD
226
+ pricing_date: 2026-07-20
227
+ notes: >
228
+ 2.3B effective params — the smallest practical option. Runs comfortably on
229
+ an 8–16GB Mac. Suitable only for small, well-scoped work.
230
+
231
+ - id: gemma-4-e4b-local
232
+ name: Gemma 4 E4B (local)
233
+ family: Gemma
234
+ open_source: true
235
+ provider: Local / Ollama
236
+ capabilities:
237
+ reasoning: low
238
+ size: medium
239
+ domain_specialization: low
240
+ price:
241
+ input_per_million: 0.00
242
+ output_per_million: 0.00
243
+ currency: USD
244
+ pricing_date: 2026-07-20
245
+ notes: >
246
+ 4.5B effective params, 128K context. ~6GB for the model, ~12.5GB in memory
247
+ with the full context window; ~55 tok/s on a MacBook Air M4. Good default
248
+ for a 16GB Mac.
249
+
250
+ - id: qwen-3-5-9b-local
251
+ name: Qwen 3.5 9B (local)
252
+ family: Qwen
253
+ open_source: true
254
+ provider: Local / Ollama
255
+ capabilities:
256
+ reasoning: medium
257
+ size: medium
258
+ domain_specialization: low
259
+ price:
260
+ input_per_million: 0.00
261
+ output_per_million: 0.00
262
+ currency: USD
263
+ pricing_date: 2026-07-20
264
+ notes: >
265
+ ~6.6GB at Q4_K_M; fits a 16GB Mac. Punches well above its size on
266
+ reasoning — the strongest all-round option that fits base-tier hardware.
267
+
268
+ - id: ministral-3b-local
269
+ name: Ministral 3B (local)
270
+ family: Ministral
271
+ open_source: true
272
+ provider: Local / Ollama
273
+ capabilities:
274
+ reasoning: low
275
+ size: low
276
+ domain_specialization: low
277
+ price:
278
+ input_per_million: 0.00
279
+ output_per_million: 0.00
280
+ currency: USD
281
+ pricing_date: 2026-07-20
282
+ notes: >
283
+ Mistral's edge/on-device tier — ~2GB at Q4, runs on almost anything.
284
+ Smallest practical Mistral; only for small, well-scoped work.
285
+
286
+ - id: llama-3-2-3b-local
287
+ name: Llama 3.2 3B (local)
288
+ family: Llama
289
+ open_source: true
290
+ provider: Local / Ollama
291
+ capabilities:
292
+ reasoning: low
293
+ size: low
294
+ domain_specialization: low
295
+ price:
296
+ input_per_million: 0.00
297
+ output_per_million: 0.00
298
+ currency: USD
299
+ pricing_date: 2026-07-20
300
+ notes: >
301
+ ~2.5GB download; the usual starting point for local Llama. Comfortable on
302
+ any 8GB+ Mac.
303
+
304
+ - id: ministral-8b-local
305
+ name: Ministral 8B (local)
306
+ family: Ministral
307
+ open_source: true
308
+ provider: Local / Ollama
309
+ capabilities:
310
+ reasoning: low
311
+ size: medium
312
+ domain_specialization: low
313
+ price:
314
+ input_per_million: 0.00
315
+ output_per_million: 0.00
316
+ currency: USD
317
+ pricing_date: 2026-07-20
318
+ notes: ~5GB at Q4; the mid size of the Ministral 3 line. Fits a 16GB Mac.
319
+
320
+ - id: llama-3-3-8b-local
321
+ name: Llama 3.3 8B (local)
322
+ family: Llama
323
+ open_source: true
324
+ provider: Local / Ollama
325
+ capabilities:
326
+ reasoning: medium
327
+ size: medium
328
+ domain_specialization: low
329
+ price:
330
+ input_per_million: 0.00
331
+ output_per_million: 0.00
332
+ currency: USD
333
+ pricing_date: 2026-07-20
334
+ notes: >
335
+ ~5.5GB RAM; the strongest all-round option in the 7B/8B class. Fits a
336
+ 16GB Mac.
337
+
338
+ - id: mistral-small-3-2-24b-local
339
+ name: Mistral Small 3.2 24B (local)
340
+ family: Mistral
341
+ open_source: true
342
+ provider: Local / Ollama
343
+ capabilities:
344
+ reasoning: medium
345
+ size: medium
346
+ domain_specialization: medium
347
+ price:
348
+ input_per_million: 0.00
349
+ output_per_million: 0.00
350
+ currency: USD
351
+ pricing_date: 2026-07-20
352
+ notes: >
353
+ ~14GB at Q4 — needs a 24GB+ Mac. Leading model in the sub-70B class;
354
+ the most capable Mistral that is realistically local.
355
+
356
+ - id: gemma-4-31b-local
357
+ name: Gemma 4 31B (local)
358
+ family: Gemma
359
+ open_source: true
360
+ provider: Local / Ollama
361
+ capabilities:
362
+ reasoning: high
363
+ size: medium
364
+ domain_specialization: medium
365
+ price:
366
+ input_per_million: 0.00
367
+ output_per_million: 0.00
368
+ currency: USD
369
+ pricing_date: 2026-07-20
370
+ notes: >
371
+ ~17.5GB at Q4_0 before runtime overhead and KV cache — needs a 32GB+ Mac
372
+ (M4/M5 Pro or Max). Same weights as the hosted gemma-4-31b entry; this row
373
+ is the self-hosted cost profile.
374
+
375
+ - id: qwen-3-6-35b-a3b-local
376
+ name: Qwen 3.6-35B-A3B (local)
377
+ family: Qwen
378
+ open_source: true
379
+ provider: Local / Ollama
380
+ capabilities:
381
+ reasoning: high
382
+ size: high
383
+ domain_specialization: medium
384
+ price:
385
+ input_per_million: 0.00
386
+ output_per_million: 0.00
387
+ currency: USD
388
+ pricing_date: 2026-07-20
389
+ notes: >
390
+ MoE with only 3B active params per token, so throughput stays high even
391
+ though the file is ~20GB at Q4_K_M. Needs a 32GB+ Mac. The most capable
392
+ option that is realistically local.
393
+
394
+ # -------------------------------------------------------------------- Z.ai
395
+ # Z.ai (Zhipu AI). GLM weights are released openly, but the rates below are
396
+ # Z.ai's own hosted API. Cached input is billed separately and much lower
397
+ # (e.g. $0.26/M on GLM-5.2 vs $1.40 uncached) — not modelled here.
398
+ - id: glm-5-2
399
+ name: GLM-5.2
400
+ family: GLM
401
+ open_source: true
402
+ provider: Z.ai
403
+ capabilities:
404
+ reasoning: high
405
+ size: high
406
+ domain_specialization: high
407
+ price:
408
+ input_per_million: 1.40
409
+ output_per_million: 4.40
410
+ currency: USD
411
+ pricing_date: 2026-07-20
412
+ notes: >
413
+ Z.ai's flagship; strong coding capability at well below Western
414
+ frontier-tier pricing. Cached input drops to $0.26/M.
415
+
416
+ - id: glm-5-1
417
+ name: GLM-5.1
418
+ family: GLM
419
+ open_source: true
420
+ provider: Z.ai
421
+ capabilities:
422
+ reasoning: high
423
+ size: high
424
+ domain_specialization: medium
425
+ price:
426
+ input_per_million: 0.97
427
+ output_per_million: 3.04
428
+ currency: USD
429
+ pricing_date: 2026-07-20
430
+ notes: Previous flagship; still widely used and cheaper than GLM-5.2.
431
+
432
+ - id: glm-4-7
433
+ name: GLM-4.7
434
+ family: GLM
435
+ open_source: true
436
+ provider: Z.ai
437
+ capabilities:
438
+ reasoning: medium
439
+ size: high
440
+ domain_specialization: medium
441
+ price:
442
+ input_per_million: 0.60
443
+ output_per_million: 2.20
444
+ currency: USD
445
+ pricing_date: 2026-07-20
446
+ notes: Solid mid tier. Cached input as low as $0.11/M.
447
+
448
+ - id: glm-4-5-air
449
+ name: GLM-4.5-Air
450
+ family: GLM
451
+ open_source: true
452
+ provider: Z.ai
453
+ capabilities:
454
+ reasoning: medium
455
+ size: medium
456
+ domain_specialization: low
457
+ price:
458
+ input_per_million: 0.20
459
+ output_per_million: 1.10
460
+ currency: USD
461
+ pricing_date: 2026-07-20
462
+ notes: Budget tier of the GLM line.
463
+
464
+ - id: glm-4-7-flash
465
+ name: GLM-4.7 Flash
466
+ family: GLM
467
+ open_source: true
468
+ provider: Z.ai
469
+ capabilities:
470
+ reasoning: low
471
+ size: medium
472
+ domain_specialization: low
473
+ price:
474
+ input_per_million: 0.00
475
+ output_per_million: 0.00
476
+ currency: USD
477
+ pricing_date: 2026-07-20
478
+ notes: >
479
+ Listed at $0 for input and output on Z.ai's free tier (rate limits apply).
480
+ Being free, it wins the value comparison outright on any project whose
481
+ demand it actually meets — verify the rate limits fit your workload.
482
+
483
+ # -------------------------------------------------------- Open source / open weights
484
+ # Open-weight models can also be self-hosted, in which case the real cost is
485
+ # GPU time rather than per-token. The rates below are representative hosted
486
+ # API prices; substitute your provider's rate if you host elsewhere.
487
+
488
+ - id: deepseek-v4-flash
489
+ name: DeepSeek V4 Flash
490
+ family: DeepSeek
491
+ open_source: true
492
+ provider: DeepSeek
493
+ capabilities:
494
+ reasoning: medium
495
+ size: medium
496
+ domain_specialization: medium
497
+ price:
498
+ input_per_million: 0.14
499
+ output_per_million: 0.28
500
+ currency: USD
501
+ pricing_date: 2026-07-20
502
+ notes: Among the cheapest hosted APIs available; open weights.
503
+
504
+ - id: deepseek-v3
505
+ name: DeepSeek V3
506
+ family: DeepSeek
507
+ open_source: true
508
+ provider: DeepSeek
509
+ capabilities:
510
+ reasoning: medium
511
+ size: high
512
+ domain_specialization: medium
513
+ price:
514
+ input_per_million: 0.27
515
+ output_per_million: 1.10
516
+ currency: USD
517
+ pricing_date: 2026-07-20
518
+ notes: Widely deployed open-weight model with strong price/performance.
519
+
520
+ - id: gemma-4-31b
521
+ name: Gemma 4 31B
522
+ family: Gemma
523
+ open_source: true
524
+ provider: Google
525
+ capabilities:
526
+ reasoning: high
527
+ size: medium
528
+ domain_specialization: medium
529
+ price:
530
+ input_per_million: 0.12
531
+ output_per_million: 0.35
532
+ currency: USD
533
+ pricing_date: 2026-07-20
534
+ notes: >
535
+ Apache 2.0 open weights (Google DeepMind). Very strong reasoning for its
536
+ size — among the top-ranked open models — but a 31B dense model is limited
537
+ on very large, multi-part projects. Rate shown is OpenRouter hosted;
538
+ self-hosting costs GPU time instead (roughly $0.001–$0.008/M).
539
+
540
+ - id: gemma-4-26b-moe
541
+ name: Gemma 4 26B MoE
542
+ family: Gemma
543
+ open_source: true
544
+ provider: Google
545
+ capabilities:
546
+ reasoning: medium
547
+ size: medium
548
+ domain_specialization: medium
549
+ price:
550
+ input_per_million: 0.06
551
+ output_per_million: 0.33
552
+ currency: USD
553
+ pricing_date: 2026-07-20
554
+ notes: >
555
+ Apache 2.0 open weights; Mixture-of-Experts (3.8B active per token), so it
556
+ is cheap to run for its capability. Rate shown is OpenRouter hosted.
557
+
558
+ - id: qwen3-7-max
559
+ name: Qwen3.7 Max
560
+ family: Qwen
561
+ open_source: false
562
+ provider: Alibaba
563
+ capabilities:
564
+ reasoning: high
565
+ size: high
566
+ domain_specialization: high
567
+ price:
568
+ input_per_million: 1.25
569
+ output_per_million: 3.75
570
+ currency: USD
571
+ pricing_date: 2026-07-20
572
+ notes: Top of the Qwen line; strong capability at open-weight pricing.
573
+
574
+ # The two entries below carry a date (the constitution requires one on every
575
+ # entry) but their figures are LESS RELIABLE than the rest: cost depends on the
576
+ # hosting provider (Groq, Fireworks, Together, self-hosted…), so treat them as
577
+ # placeholders and substitute your provider's rate.
578
+ - id: llama-4-scout
579
+ name: Llama 4 Scout
580
+ family: Llama
581
+ open_source: true
582
+ provider: Meta
583
+ capabilities:
584
+ reasoning: medium
585
+ size: high
586
+ domain_specialization: medium
587
+ price:
588
+ input_per_million: 0.20
589
+ output_per_million: 0.60
590
+ currency: USD
591
+ pricing_date: 2026-07-20
592
+ notes: >
593
+ Open weights; free to self-host (cost is GPU time). PLACEHOLDER RATE — the
594
+ real price depends on your hosting provider. Substitute your provider's
595
+ rate and update pricing_date.
596
+
597
+ - id: mistral-large-3
598
+ name: Mistral Large 3
599
+ family: Mistral
600
+ open_source: true
601
+ provider: Mistral AI
602
+ capabilities:
603
+ reasoning: high
604
+ size: high
605
+ domain_specialization: medium
606
+ price:
607
+ input_per_million: 2.00
608
+ output_per_million: 6.00
609
+ currency: USD
610
+ pricing_date: 2026-07-20
611
+ notes: >
612
+ Apache 2.0 open weights. PLACEHOLDER RATE — the real price depends on your
613
+ hosting provider. Substitute your provider's rate and update pricing_date.
@@ -0,0 +1,48 @@
1
+ # SpecJudge rating rules
2
+ # -----------------------
3
+ # Translates the project's demand profile (estimated by the local judge) and each
4
+ # model's declared capability into a rating: poor / fair / good / overkill (FR-004).
5
+ # Editable without touching the code (Principle V / FR-017).
6
+ #
7
+ # `dimensions` MUST match those in data/models.yaml.
8
+
9
+ version: 1
10
+
11
+ dimensions:
12
+ - reasoning
13
+ - size
14
+ - domain_specialization
15
+
16
+ # Thresholds used to classify the "scarce" data state (FR-010 / Clarifications Q2).
17
+ scarce_thresholds:
18
+ # Minimum number of tasks with a description to NOT be considered "thin on detail".
19
+ min_detailed_tasks: 3
20
+
21
+ # How the project is presented to the local judge.
22
+ judge:
23
+ # Judges at or below this parameter count (in billions) get a COMPACT prompt: a
24
+ # structured summary (counts, headings, task titles) instead of the full artifact
25
+ # text. Small models lose the instructions inside a long dump and start continuing
26
+ # the document rather than evaluating it. Larger judges get the full text, which
27
+ # gives them more literal context.
28
+ # Measured empirically: 8B and 24B judges both failed on the full text, so the
29
+ # default is deliberately generous. Lower it if your judge handles long prompts.
30
+ compact_prompt_at_or_below_params_b: 70
31
+ # Cap per artifact when sending the full text (characters).
32
+ max_chars_per_artifact: 8000
33
+ # Cap per artifact when sending the compact summary (characters).
34
+ max_chars_per_artifact_compact: 1500
35
+
36
+ # Maps the ordinal difference (capability - demand) to a partial label per dimension.
37
+ # The global rating is aggregated according to `aggregation`.
38
+ mapping:
39
+ # Closed ordinal vocabulary, shared by demand and capability.
40
+ levels: [low, medium, high, top]
41
+ per_dimension:
42
+ below_by_2_or_more: poor # capability far below the demand
43
+ below_by_1: fair # capability one step below
44
+ exact: good # capability matches the demand
45
+ above_by_1_or_more: overkill # capability above (likely overspend)
46
+ # 'worst_dimension': the global rating is the worst rating across dimensions, so a
47
+ # critical gap is never masked by strengths in other dimensions.
48
+ aggregation: worst_dimension