@monotykamary/pi-opencode-provider 1.0.10 → 1.0.11

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.
@@ -0,0 +1,4 @@
1
+ github: monotykamary
2
+ ko_fi: monotykamary
3
+ buy_me_a_coffee: monotykamary
4
+ polar: monotykamary
package/AGENTS.md ADDED
@@ -0,0 +1,57 @@
1
+ # AGENTS.md
2
+
3
+ ## DO NOT EDIT — Auto-generated Files
4
+
5
+ The following files are **idempotent** and regenerated by `scripts/update-models.js`. Never edit them directly — your changes will be overwritten on the next model sync.
6
+
7
+ | File | Why it's auto-generated |
8
+ |------|------------------------|
9
+ | `models.json` | Built from the provider API. `update-models.js` fetches models, preserves curated data for known IDs, and writes this file. |
10
+ | `deprecated-models.json` | Graveyard for models the API delisted. update-models.js stamps them with deprecatedAt and pi keeps serving them for a 2-week grace period, then evicts them. Never edit by hand. |
11
+ | `README.md` (model table) | The table under `## Available Models` is replaced in-place by `update-models.js` after merging base models → patch → custom models. |
12
+
13
+ ## Correct Files to Edit
14
+
15
+ When a model needs overrides, new properties, or corrections, edit the appropriate source file below. These are the **source of truth** that the update script reads but never writes.
16
+
17
+ | File | Purpose |
18
+ |------|---------|
19
+ | `patch.json` | Per-model overrides keyed by model ID. Add reasoning flags, compat settings, pricing corrections, thinking level maps, etc. Applied on top of `models.json` at runtime and for README generation. |
20
+ | `custom-models.json` | Models that don't exist in the provider API (hidden models, router endpoints, cross-provider aliases). Merged after patch. Format: array of full model objects (same schema as `models.json` entries). |
21
+ | `index.ts` | Provider extension code. |
22
+ | `scripts/update-models.js` | The sync script itself (edit only if changing how models are fetched/transformed). |
23
+
24
+ ## Data Flow
25
+
26
+ ```
27
+ Provider API ──fetch──► models.json ──apply──► patch.json ──merge──► custom-models.json
28
+ │ │ │
29
+ └────────────────────────────┴──────────────────────┘
30
+
31
+ README model table
32
+ ```
33
+
34
+ 1. `models.json` — base data from the provider API (auto-generated, DO NOT EDIT)
35
+ 2. `patch.json` — overrides applied on top (EDIT THIS for corrections/enrichments)
36
+ 3. `custom-models.json` — additional models not in the API (EDIT THIS for new models)
37
+ 4. README table — rendered from the merged result of all three (auto-generated, DO NOT EDIT)
38
+
39
+ ## Common Tasks
40
+
41
+ ### Add a compat setting or override pricing for an existing model
42
+ → Edit `patch.json`. Add an entry keyed by the model's `id`.
43
+
44
+ ### Add a model not available in the provider API
45
+ → Edit `custom-models.json`. Add a full model object to the array.
46
+
47
+ ### Update models from the provider API
48
+ → Run `node scripts/update-models.js` (may require an API key env var).
49
+
50
+ ### Regenerate the README model table
51
+ → Run `node scripts/update-models.js` — it updates both `models.json` and the README table.
52
+
53
+ ## TL;DR
54
+
55
+ - **Never edit `models.json`** — edit `patch.json` instead.
56
+ - **Never edit the README model table** — run the update script instead.
57
+ - `patch.json` and `custom-models.json` are the source files you should modify.
@@ -0,0 +1,24 @@
1
+ [
2
+ {
3
+ "id": "gemini-3-pro",
4
+ "name": "Gemini 3 Pro",
5
+ "api": "google-generative-ai",
6
+ "baseUrl": "https://opencode.ai/zen/v1",
7
+ "reasoning": true,
8
+ "input": ["text", "image"],
9
+ "cost": { "input": 1.25, "output": 10, "cacheRead": 0.125, "cacheWrite": 0 },
10
+ "contextWindow": 1048576,
11
+ "maxTokens": 65536
12
+ },
13
+ {
14
+ "id": "grok-code",
15
+ "name": "Grok Code",
16
+ "api": "openai-completions",
17
+ "baseUrl": "https://opencode.ai/zen/v1",
18
+ "reasoning": true,
19
+ "input": ["text", "image"],
20
+ "cost": { "input": 1, "output": 2, "cacheRead": 0.2, "cacheWrite": 0 },
21
+ "contextWindow": 256000,
22
+ "maxTokens": 256000
23
+ }
24
+ ]
@@ -0,0 +1,98 @@
1
+ {
2
+ "claude-opus-4-1": {
3
+ "id": "claude-opus-4-1",
4
+ "name": "Claude Opus 4.1",
5
+ "api": "anthropic-messages",
6
+ "baseUrl": "https://opencode.ai/zen",
7
+ "reasoning": true,
8
+ "input": [
9
+ "text",
10
+ "image"
11
+ ],
12
+ "cost": {
13
+ "input": 15,
14
+ "output": 75,
15
+ "cacheRead": 1.5,
16
+ "cacheWrite": 18.75
17
+ },
18
+ "contextWindow": 200000,
19
+ "maxTokens": 32000,
20
+ "deprecatedAt": "2026-08-07T02:00:18.924Z"
21
+ },
22
+ "ling-3.0-flash-free": {
23
+ "id": "ling-3.0-flash-free",
24
+ "name": "Ling-3.0-flash Free",
25
+ "api": "openai-completions",
26
+ "baseUrl": "https://opencode.ai/zen/v1",
27
+ "reasoning": true,
28
+ "input": [
29
+ "text"
30
+ ],
31
+ "cost": {
32
+ "input": 0,
33
+ "output": 0,
34
+ "cacheRead": 0,
35
+ "cacheWrite": 0
36
+ },
37
+ "contextWindow": 262144,
38
+ "maxTokens": 32768,
39
+ "deprecatedAt": "2026-08-08T02:00:18.268Z"
40
+ },
41
+ "north-mini-code-free": {
42
+ "id": "north-mini-code-free",
43
+ "name": "North Mini Code Free",
44
+ "api": "openai-completions",
45
+ "baseUrl": "https://opencode.ai/zen/v1",
46
+ "reasoning": true,
47
+ "input": [
48
+ "text"
49
+ ],
50
+ "cost": {
51
+ "input": 0,
52
+ "output": 0,
53
+ "cacheRead": 0,
54
+ "cacheWrite": 0
55
+ },
56
+ "contextWindow": 256000,
57
+ "maxTokens": 64000,
58
+ "deprecatedAt": "2026-08-12T02:00:24.970Z"
59
+ },
60
+ "longcat-2.0-free": {
61
+ "id": "longcat-2.0-free",
62
+ "name": "LongCat-2.0 Free",
63
+ "api": "openai-completions",
64
+ "baseUrl": "https://opencode.ai/zen/v1",
65
+ "reasoning": true,
66
+ "input": [
67
+ "text"
68
+ ],
69
+ "cost": {
70
+ "input": 0,
71
+ "output": 0,
72
+ "cacheRead": 0,
73
+ "cacheWrite": 0
74
+ },
75
+ "contextWindow": 1000000,
76
+ "maxTokens": 131072,
77
+ "deprecatedAt": "2026-08-12T06:38:24.559Z"
78
+ },
79
+ "ling-3.0-tiny-free": {
80
+ "id": "ling-3.0-tiny-free",
81
+ "name": "Ling-3.0-tiny Free",
82
+ "api": "openai-completions",
83
+ "baseUrl": "https://opencode.ai/zen/v1",
84
+ "reasoning": true,
85
+ "input": [
86
+ "text"
87
+ ],
88
+ "cost": {
89
+ "input": 0,
90
+ "output": 0,
91
+ "cacheRead": 0,
92
+ "cacheWrite": 0
93
+ },
94
+ "contextWindow": 262144,
95
+ "maxTokens": 32768,
96
+ "deprecatedAt": "2026-08-14T02:00:20.260Z"
97
+ }
98
+ }