pi-sakana-provider 0.1.0

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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +64 -0
  3. package/index.ts +58 -0
  4. package/package.json +40 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Jabbslad
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,64 @@
1
+ # pi-sakana-provider
2
+
3
+ Sakana AI custom provider for Pi.
4
+
5
+ This package registers provider id `sakana` via `pi.registerProvider()` and uses Pi's built-in `openai-responses` API implementation against `https://api.sakana.ai/v1`.
6
+
7
+ ## Models
8
+
9
+ | Model | Reasoning | Input | Context window | Max output |
10
+ | --- | --- | --- | --- | --- |
11
+ | `fugu` | yes | text, image | 1,000,000 | 65,536 |
12
+ | `fugu-ultra` | yes | text, image | 1,000,000 | 131,072 |
13
+ | `fugu-ultra-20260615` | yes | text, image | 1,000,000 | 131,072 |
14
+
15
+ All Fugu models are reasoning models. Sakana only accepts reasoning efforts
16
+ `high` and `xhigh` (`max` is an alias of `xhigh`); any other value is rejected.
17
+ Pi thinking levels are mapped accordingly: `minimal`, `low`, `medium`, and
18
+ `high` all send `high`; `xhigh` sends `xhigh`; `off` sends no effort (the API
19
+ then uses its default).
20
+
21
+ Context windows match Sakana's published model catalog. Max-output values are
22
+ not published in the catalog; the values above are conservative defaults.
23
+
24
+ ## Usage
25
+
26
+ Set your Sakana API key:
27
+
28
+ ```bash
29
+ export SAKANA_API_KEY=...
30
+ ```
31
+
32
+ Load once for testing (run from the repo root):
33
+
34
+ ```bash
35
+ pi -e . --provider sakana --model fugu-ultra
36
+ ```
37
+
38
+ Install from npm:
39
+
40
+ ```bash
41
+ pi install npm:pi-sakana-provider
42
+ ```
43
+
44
+ Or install from a local checkout (run from the repo root):
45
+
46
+ ```bash
47
+ pi install .
48
+ ```
49
+
50
+ Or add the package to `~/.pi/agent/settings.json` (the npm name, or a path
51
+ relative to that file / an absolute path):
52
+
53
+ ```json
54
+ {
55
+ "packages": ["pi-sakana-provider"],
56
+ "defaultProvider": "sakana",
57
+ "defaultModel": "fugu-ultra",
58
+ "defaultThinkingLevel": "xhigh"
59
+ }
60
+ ```
61
+
62
+ ## License
63
+
64
+ MIT — see [LICENSE](LICENSE).
package/index.ts ADDED
@@ -0,0 +1,58 @@
1
+ import type { ExtensionAPI, ProviderModelConfig } from "@earendil-works/pi-coding-agent";
2
+
3
+ const SAKANA_BASE_URL = "https://api.sakana.ai/v1";
4
+ const FUGU_COST = { input: 5, output: 30, cacheRead: 0.5, cacheWrite: 0 };
5
+
6
+ // Sakana accepts reasoning.effort values "high", "xhigh" (and "max", an alias of
7
+ // "xhigh"); any other value is rejected. Map pi's thinking levels onto those.
8
+ const FUGU_THINKING = {
9
+ off: null,
10
+ minimal: "high",
11
+ low: "high",
12
+ medium: "high",
13
+ high: "high",
14
+ xhigh: "xhigh",
15
+ };
16
+
17
+ export const SAKANA_MODELS: ProviderModelConfig[] = [
18
+ {
19
+ id: "fugu",
20
+ name: "Fugu",
21
+ reasoning: true,
22
+ thinkingLevelMap: FUGU_THINKING,
23
+ input: ["text", "image"],
24
+ cost: FUGU_COST,
25
+ contextWindow: 1_000_000,
26
+ maxTokens: 65_536,
27
+ },
28
+ {
29
+ id: "fugu-ultra",
30
+ name: "Fugu Ultra",
31
+ reasoning: true,
32
+ thinkingLevelMap: FUGU_THINKING,
33
+ input: ["text", "image"],
34
+ cost: FUGU_COST,
35
+ contextWindow: 1_000_000,
36
+ maxTokens: 131_072,
37
+ },
38
+ {
39
+ id: "fugu-ultra-20260615",
40
+ name: "Fugu Ultra (2026-06-15)",
41
+ reasoning: true,
42
+ thinkingLevelMap: FUGU_THINKING,
43
+ input: ["text", "image"],
44
+ cost: FUGU_COST,
45
+ contextWindow: 1_000_000,
46
+ maxTokens: 131_072,
47
+ },
48
+ ];
49
+
50
+ export default function (pi: ExtensionAPI) {
51
+ pi.registerProvider("sakana", {
52
+ name: "Sakana AI",
53
+ baseUrl: SAKANA_BASE_URL,
54
+ apiKey: "$SAKANA_API_KEY",
55
+ api: "openai-responses",
56
+ models: SAKANA_MODELS,
57
+ });
58
+ }
package/package.json ADDED
@@ -0,0 +1,40 @@
1
+ {
2
+ "name": "pi-sakana-provider",
3
+ "version": "0.1.0",
4
+ "description": "Sakana AI custom provider for Pi.",
5
+ "license": "MIT",
6
+ "author": "Jabbslad",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/Jabbslad/pi-sakana-provider.git"
10
+ },
11
+ "homepage": "https://github.com/Jabbslad/pi-sakana-provider#readme",
12
+ "bugs": {
13
+ "url": "https://github.com/Jabbslad/pi-sakana-provider/issues"
14
+ },
15
+ "type": "module",
16
+ "keywords": [
17
+ "pi-package",
18
+ "pi-extension",
19
+ "sakana",
20
+ "sakana-ai"
21
+ ],
22
+ "files": [
23
+ "index.ts",
24
+ "README.md",
25
+ "LICENSE"
26
+ ],
27
+ "scripts": {
28
+ "clean": "echo 'nothing to clean'",
29
+ "build": "echo 'nothing to build'",
30
+ "check": "echo 'nothing to check'"
31
+ },
32
+ "peerDependencies": {
33
+ "@earendil-works/pi-coding-agent": "*"
34
+ },
35
+ "pi": {
36
+ "extensions": [
37
+ "./index.ts"
38
+ ]
39
+ }
40
+ }