pi-fireworks-provider 1.0.2

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
@@ -0,0 +1 @@
1
+ {"_meta":true,"v":1,"id":"memory","type":"named","createdAt":"2026-05-25T08:03:16.155Z","description":"Cross-session knowledge and insights"}
@@ -0,0 +1 @@
1
+ 019e98a1-b474-7d6d-b80e-b1dedf22aa71
package/AGENTS.md ADDED
@@ -0,0 +1,56 @@
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
+ | `README.md` (model table) | The table under `## Available Models` is replaced in-place by `update-models.js` after merging base models → patch → custom models. |
11
+
12
+ ## Correct Files to Edit
13
+
14
+ 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.
15
+
16
+ | File | Purpose |
17
+ |------|---------|
18
+ | `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. |
19
+ | `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). |
20
+ | `index.ts` | Provider extension code. |
21
+ | `scripts/update-models.js` | The sync script itself (edit only if changing how models are fetched/transformed). |
22
+
23
+ ## Data Flow
24
+
25
+ ```
26
+ Provider API ──fetch──► models.json ──apply──► patch.json ──merge──► custom-models.json
27
+ │ │ │
28
+ └────────────────────────────┴──────────────────────┘
29
+
30
+ README model table
31
+ ```
32
+
33
+ 1. `models.json` — base data from the provider API (auto-generated, DO NOT EDIT)
34
+ 2. `patch.json` — overrides applied on top (EDIT THIS for corrections/enrichments)
35
+ 3. `custom-models.json` — additional models not in the API (EDIT THIS for new models)
36
+ 4. README table — rendered from the merged result of all three (auto-generated, DO NOT EDIT)
37
+
38
+ ## Common Tasks
39
+
40
+ ### Add a compat setting or override pricing for an existing model
41
+ → Edit `patch.json`. Add an entry keyed by the model's `id`.
42
+
43
+ ### Add a model not available in the provider API
44
+ → Edit `custom-models.json`. Add a full model object to the array.
45
+
46
+ ### Update models from the provider API
47
+ → Run `node scripts/update-models.js` (may require an API key env var).
48
+
49
+ ### Regenerate the README model table
50
+ → Run `node scripts/update-models.js` — it updates both `models.json` and the README table.
51
+
52
+ ## TL;DR
53
+
54
+ - **Never edit `models.json`** — edit `patch.json` instead.
55
+ - **Never edit the README model table** — run the update script instead.
56
+ - `patch.json` and `custom-models.json` are the source files you should modify.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,150 @@
1
+ <div align="center">
2
+
3
+ # 🎆 pi-fireworks-provider
4
+
5
+ **31+ models through [Fireworks AI](https://fireworks.ai/)**
6
+
7
+ _Kimi, MiniMax, GLM, DeepSeek, GPT-OSS — unified OpenAI-compatible API for [pi](https://github.com/earendil-works/pi-coding-agent)._
8
+
9
+ [![pi extension](https://img.shields.io/badge/pi-extension-blueviolet)](https://github.com/earendil-works/pi-coding-agent)
10
+ [![license](https://img.shields.io/badge/license-MIT-blue)](./LICENSE)
11
+
12
+ </div>
13
+
14
+ ---
15
+
16
+ ## Features
17
+
18
+ - **35+ AI Models** including Kimi K2.5, MiniMax M2.5, GLM 4.5/4.7/5, DeepSeek V3.1/V3.2, DeepSeek V4 Flash, and GPT-OSS
19
+ - **Unified API** via Fireworks AI's OpenAI-compatible completions endpoint
20
+ - **Cost Tracking** with per-model pricing for budget management
21
+ - **Reasoning Models** support for advanced reasoning capabilities
22
+ - **Vision Support** for image-capable models
23
+
24
+ ## Installation
25
+
26
+ ### Option 1: Using `pi install` (Recommended)
27
+
28
+ Install directly from GitHub:
29
+
30
+ ```bash
31
+ pi install https://github.com/monotykamary/pi-fireworks-provider
32
+ ```
33
+
34
+ Then set your API key and run pi:
35
+ ```bash
36
+ # Recommended: add to auth.json
37
+ # See Authentication section below
38
+
39
+ # Or set as environment variable
40
+ export FIREWORKS_API_KEY=your-api-key-here
41
+
42
+ pi
43
+ ```
44
+
45
+ ### Option 2: Manual Clone
46
+
47
+ 1. Clone this repository:
48
+ ```bash
49
+ git clone https://github.com/monotykamary/pi-fireworks-provider.git
50
+ cd pi-fireworks-provider
51
+ ```
52
+
53
+ 2. Set your Fireworks API key:
54
+ ```bash
55
+ # Recommended: add to auth.json
56
+ # See Authentication section below
57
+
58
+ # Or set as environment variable
59
+ export FIREWORKS_API_KEY=your-api-key-here
60
+ ```
61
+
62
+ 3. Run pi with the extension:
63
+ ```bash
64
+ pi -e /path/to/pi-fireworks-provider
65
+ ```
66
+
67
+ ## Available Models
68
+
69
+ | Model | Type | Context | Max Tokens | Input Cost | Output Cost |
70
+ |-------|------|---------|------------|------------|-------------|
71
+ | DeepSeek V3.1 | Text | 164K | 164K | $0.56 | $1.68 |
72
+ | DeepSeek V3.2 | Text | 164K | 160K | $0.56 | $1.68 |
73
+ | DeepSeek V4 Flash | Text | 1.0M | 1.0M | $0.14 | $0.28 |
74
+ | DeepSeek V4 Pro | Text | 1.0M | 1.0M | Free | Free |
75
+ | DeepSeek V4 Pro (router) | Text | 1.0M | 1.0M | $1.74 | $3.48 |
76
+ | Gemma 4 26B A4B IT | Text + Image | 262K | 0 | Free | Free |
77
+ | Gemma 4 31B IT | Text + Image | 262K | 0 | Free | Free |
78
+ | GLM 4.5 | Text | 131K | 131K | $0.55 | $2.19 |
79
+ | GLM 4.5 Air | Text | 131K | 131K | $0.22 | $0.88 |
80
+ | GLM 4.7 | Text | 203K | 198K | $0.60 | $2.20 |
81
+ | GLM 5 | Text | 203K | 131K | $1.00 | $3.20 |
82
+ | GLM 5 Fast (router) | Text | 203K | 131K | $1.00 | $3.20 |
83
+ | GLM 5.1 | Text | 203K | 131K | $1.40 | $4.40 |
84
+ | GLM 5.1 Fast (router) | Text | 203K | 131K | $1.40 | $4.40 |
85
+ | GLM 5.2 | Text | 1.0M | 0 | Free | Free |
86
+ | GPT OSS 120B | Text | 131K | 33K | $0.15 | $0.60 |
87
+ | GPT OSS 20B | Text | 131K | 33K | $0.05 | $0.20 |
88
+ | Kimi K2 Instruct | Text | 131K | 16K | $1.00 | $3.00 |
89
+ | Kimi K2 Thinking | Text | 262K | 256K | $0.60 | $2.50 |
90
+ | Kimi K2.5 | Text + Image | 262K | 256K | $0.60 | $3.00 |
91
+ | Kimi K2.5 Fast (router) | Text + Image | 262K | 256K | $0.60 | $3.00 |
92
+ | Kimi K2.6 | Text + Image | 262K | 262K | $0.95 | $4.00 |
93
+ | Kimi K2.6 (router) | Text + Image | 262K | 262K | $0.95 | $4.00 |
94
+ | Kimi K2.6 Turbo (router) | Text + Image | 262K | 262K | $0.95 | $4.00 |
95
+ | Kimi K2.7 Code | Text + Image | 262K | 0 | Free | Free |
96
+ | Llama 3.3 70B Instruct | Text | 131K | 0 | Free | Free |
97
+ | MiniMax M2.7 (router) | Text | 204K | 0 | $0.30 | $1.20 |
98
+ | Minimax M3 | Text + Image | 512K | 0 | Free | Free |
99
+ | MiniMax-M2.1 | Text | 197K | 200K | $0.30 | $1.20 |
100
+ | MiniMax-M2.5 | Text | 197K | 197K | $0.30 | $1.20 |
101
+ | MiniMax-M2.7 | Text | 197K | 197K | $0.30 | $1.20 |
102
+ | NVIDIA Nemotron 3 Ultra NVFP4 | Text | 262K | 0 | Free | Free |
103
+ | Qwen3 8B | Text | 41K | 0 | Free | Free |
104
+ | Qwen3 VL 30B A3B Instruct | Text + Image | 262K | 0 | Free | Free |
105
+ | Qwen3 VL 30B A3B Thinking | Text + Image | 262K | 0 | Free | Free |
106
+ *Costs are per million tokens. Prices subject to change - check [fireworks.ai](https://fireworks.ai) for current pricing.*
107
+
108
+ ## Usage
109
+
110
+ After loading the extension, use the `/model` command in pi to select your preferred model:
111
+
112
+ ```
113
+ /model
114
+ ```
115
+
116
+ Then select "fireworks" as the provider and choose from the available models.
117
+
118
+ ## Authentication
119
+
120
+ The Fireworks API key can be configured in multiple ways (resolved in this order):
121
+
122
+ 1. **`auth.json`** (recommended) — Add to `~/.pi/agent/auth.json`:
123
+ ```json
124
+ { "fireworks": { "type": "api_key", "key": "your-api-key" } }
125
+ ```
126
+ The `key` field supports literal values, env var names, and shell commands (prefix with `!`). See [pi's auth file docs](https://github.com/badlogic/pi-mono) for details.
127
+ 2. **Runtime override** — Use the `--api-key` CLI flag
128
+ 3. **Environment variable** — Set `FIREWORKS_API_KEY`
129
+
130
+ ## Environment Variables
131
+
132
+ | Variable | Required | Description |
133
+ |----------|----------|-------------|
134
+ | `FIREWORKS_API_KEY` | No | Your Fireworks AI API key (fallback if not in auth.json) |
135
+
136
+ ## Configuration
137
+
138
+ Add to your pi configuration for automatic loading:
139
+
140
+ ```json
141
+ {
142
+ "extensions": [
143
+ "/path/to/pi-fireworks-provider"
144
+ ]
145
+ }
146
+ ```
147
+
148
+ ## License
149
+
150
+ MIT
@@ -0,0 +1,151 @@
1
+ [
2
+ {
3
+ "id": "accounts/fireworks/routers/deepseek-v4-pro",
4
+ "name": "DeepSeek V4 Pro (router)",
5
+ "reasoning": true,
6
+ "cost": {
7
+ "input": 0,
8
+ "output": 0,
9
+ "cacheRead": 0,
10
+ "cacheWrite": 0
11
+ },
12
+ "input": [
13
+ "text"
14
+ ],
15
+ "contextWindow": 1048576,
16
+ "maxTokens": 0
17
+ },
18
+ {
19
+ "id": "accounts/fireworks/routers/kimi-k2p5-fast",
20
+ "name": "Kimi K2.5 Fast (router)",
21
+ "reasoning": true,
22
+ "cost": {
23
+ "input": 0,
24
+ "output": 0,
25
+ "cacheRead": 0,
26
+ "cacheWrite": 0
27
+ },
28
+ "input": [
29
+ "text",
30
+ "image"
31
+ ],
32
+ "contextWindow": 262144,
33
+ "maxTokens": 0
34
+ },
35
+ {
36
+ "id": "accounts/fireworks/routers/kimi-k2p6-turbo",
37
+ "name": "Kimi K2.6 Turbo (router)",
38
+ "reasoning": true,
39
+ "cost": {
40
+ "input": 0,
41
+ "output": 0,
42
+ "cacheRead": 0,
43
+ "cacheWrite": 0
44
+ },
45
+ "input": [
46
+ "text",
47
+ "image"
48
+ ],
49
+ "contextWindow": 262144,
50
+ "maxTokens": 0
51
+ },
52
+ {
53
+ "id": "accounts/fireworks/routers/kimi-k2p6",
54
+ "name": "Kimi K2.6 (router)",
55
+ "reasoning": true,
56
+ "cost": {
57
+ "input": 0,
58
+ "output": 0,
59
+ "cacheRead": 0,
60
+ "cacheWrite": 0
61
+ },
62
+ "input": [
63
+ "text",
64
+ "image"
65
+ ],
66
+ "contextWindow": 262144,
67
+ "maxTokens": 262144
68
+ },
69
+ {
70
+ "id": "accounts/fireworks/routers/glm-5p1-fast",
71
+ "name": "GLM 5.1 Fast (router)",
72
+ "reasoning": true,
73
+ "cost": {
74
+ "input": 1.4,
75
+ "output": 4.4,
76
+ "cacheRead": 0.26,
77
+ "cacheWrite": 0
78
+ },
79
+ "input": [
80
+ "text"
81
+ ],
82
+ "contextWindow": 202800,
83
+ "maxTokens": 131072
84
+ },
85
+ {
86
+ "id": "accounts/fireworks/routers/minimax-m2p7",
87
+ "name": "MiniMax M2.7 (router)",
88
+ "reasoning": true,
89
+ "cost": {
90
+ "input": 0.3,
91
+ "output": 1.2,
92
+ "cacheRead": 0.06,
93
+ "cacheWrite": 0
94
+ },
95
+ "input": [
96
+ "text"
97
+ ],
98
+ "contextWindow": 204000,
99
+ "maxTokens": 0
100
+ },
101
+ {
102
+ "id": "accounts/fireworks/routers/glm-5-fast",
103
+ "name": "GLM 5 Fast",
104
+ "reasoning": true,
105
+ "cost": {
106
+ "input": 1,
107
+ "output": 3.2,
108
+ "cacheRead": 0.5,
109
+ "cacheWrite": 0
110
+ },
111
+ "input": [
112
+ "text"
113
+ ],
114
+ "contextWindow": 202752,
115
+ "maxTokens": 131072
116
+ },
117
+ {
118
+ "id": "accounts/fireworks/models/gemma-4-31b-it",
119
+ "name": "Gemma 4 31B IT",
120
+ "reasoning": true,
121
+ "cost": {
122
+ "input": 0,
123
+ "output": 0,
124
+ "cacheRead": 0,
125
+ "cacheWrite": 0
126
+ },
127
+ "input": [
128
+ "text",
129
+ "image"
130
+ ],
131
+ "contextWindow": 262000,
132
+ "maxTokens": 0
133
+ },
134
+ {
135
+ "id": "accounts/fireworks/models/gemma-4-26b-a4b-it",
136
+ "name": "Gemma 4 26B A4B IT",
137
+ "reasoning": true,
138
+ "cost": {
139
+ "input": 0,
140
+ "output": 0,
141
+ "cacheRead": 0,
142
+ "cacheWrite": 0
143
+ },
144
+ "input": [
145
+ "text",
146
+ "image"
147
+ ],
148
+ "contextWindow": 262000,
149
+ "maxTokens": 0
150
+ }
151
+ ]