@aliou/pi-synthetic 0.0.1 → 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.
- package/.changeset/config.json +11 -0
- package/.github/workflows/ci.yml +32 -0
- package/.github/workflows/publish.yml +143 -0
- package/.husky/pre-commit +3 -0
- package/AGENTS.md +69 -0
- package/CHANGELOG.md +12 -0
- package/README.md +108 -0
- package/biome.json +30 -0
- package/package.json +29 -5
- package/shell.nix +10 -0
- package/src/index.ts +6 -0
- package/src/providers/index.ts +19 -0
- package/src/providers/models.ts +286 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json",
|
|
3
|
+
"changelog": "@changesets/cli/changelog",
|
|
4
|
+
"commit": false,
|
|
5
|
+
"fixed": [],
|
|
6
|
+
"linked": [],
|
|
7
|
+
"access": "public",
|
|
8
|
+
"baseBranch": "main",
|
|
9
|
+
"updateInternalDependencies": "patch",
|
|
10
|
+
"ignore": []
|
|
11
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
10
|
+
cancel-in-progress: true
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
check:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- uses: pnpm/action-setup@v4
|
|
19
|
+
|
|
20
|
+
- uses: actions/setup-node@v4
|
|
21
|
+
with:
|
|
22
|
+
node-version: "22"
|
|
23
|
+
cache: "pnpm"
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: pnpm install --frozen-lockfile
|
|
27
|
+
|
|
28
|
+
- name: Lint
|
|
29
|
+
run: pnpm lint
|
|
30
|
+
|
|
31
|
+
- name: Typecheck
|
|
32
|
+
run: pnpm typecheck
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
name: Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
10
|
+
cancel-in-progress: true
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
check:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
steps:
|
|
16
|
+
- uses: actions/checkout@v4
|
|
17
|
+
|
|
18
|
+
- uses: pnpm/action-setup@v4
|
|
19
|
+
|
|
20
|
+
- uses: actions/setup-node@v4
|
|
21
|
+
with:
|
|
22
|
+
node-version: "22"
|
|
23
|
+
cache: "pnpm"
|
|
24
|
+
|
|
25
|
+
- name: Install dependencies
|
|
26
|
+
run: pnpm install --frozen-lockfile
|
|
27
|
+
|
|
28
|
+
- name: Lint
|
|
29
|
+
run: pnpm lint
|
|
30
|
+
|
|
31
|
+
- name: Typecheck
|
|
32
|
+
run: pnpm typecheck
|
|
33
|
+
|
|
34
|
+
publish:
|
|
35
|
+
name: Publish
|
|
36
|
+
needs: check
|
|
37
|
+
runs-on: ubuntu-latest
|
|
38
|
+
permissions:
|
|
39
|
+
contents: write
|
|
40
|
+
packages: write
|
|
41
|
+
pull-requests: write
|
|
42
|
+
id-token: write
|
|
43
|
+
|
|
44
|
+
steps:
|
|
45
|
+
- name: Checkout
|
|
46
|
+
uses: actions/checkout@v4
|
|
47
|
+
with:
|
|
48
|
+
fetch-depth: 0
|
|
49
|
+
|
|
50
|
+
- name: Setup pnpm
|
|
51
|
+
uses: pnpm/action-setup@v4
|
|
52
|
+
|
|
53
|
+
- name: Setup Node.js
|
|
54
|
+
uses: actions/setup-node@v4
|
|
55
|
+
with:
|
|
56
|
+
node-version: "22"
|
|
57
|
+
registry-url: "https://registry.npmjs.org"
|
|
58
|
+
scope: "@aliou"
|
|
59
|
+
cache: "pnpm"
|
|
60
|
+
|
|
61
|
+
- name: Upgrade npm for OIDC support
|
|
62
|
+
run: npm install -g npm@latest
|
|
63
|
+
|
|
64
|
+
- name: Install dependencies
|
|
65
|
+
run: pnpm install --frozen-lockfile
|
|
66
|
+
|
|
67
|
+
- name: Get release info
|
|
68
|
+
id: release-info
|
|
69
|
+
run: |
|
|
70
|
+
pnpm changeset status --output=release.json 2>/dev/null || echo '{"releases":[]}' > release.json
|
|
71
|
+
node <<NODE
|
|
72
|
+
const fs = require('fs');
|
|
73
|
+
const release = JSON.parse(fs.readFileSync('release.json', 'utf8'));
|
|
74
|
+
const releases = release.releases?.filter(r => r.type !== 'none') || [];
|
|
75
|
+
|
|
76
|
+
let title = 'Version Packages';
|
|
77
|
+
let commit = 'Version Packages';
|
|
78
|
+
if (releases.length === 1) {
|
|
79
|
+
const { name, newVersion } = releases[0];
|
|
80
|
+
title = 'Updating ' + name + ' to version ' + newVersion;
|
|
81
|
+
commit = name + '@' + newVersion;
|
|
82
|
+
} else if (releases.length > 1) {
|
|
83
|
+
const summary = releases.map(r => r.name + '@' + r.newVersion).join(', ');
|
|
84
|
+
title = 'Updating ' + summary;
|
|
85
|
+
commit = summary;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
fs.appendFileSync(process.env.GITHUB_OUTPUT, 'title=' + title + '\n');
|
|
89
|
+
fs.appendFileSync(process.env.GITHUB_OUTPUT, 'commit=' + commit + '\n');
|
|
90
|
+
NODE
|
|
91
|
+
rm -f release.json
|
|
92
|
+
continue-on-error: true
|
|
93
|
+
|
|
94
|
+
- name: Create Release PR or Publish
|
|
95
|
+
id: changesets
|
|
96
|
+
uses: changesets/action@v1
|
|
97
|
+
with:
|
|
98
|
+
version: pnpm changeset version
|
|
99
|
+
publish: pnpm changeset publish
|
|
100
|
+
title: ${{ steps.release-info.outputs.title || 'Version Packages' }}
|
|
101
|
+
commit: ${{ steps.release-info.outputs.commit || 'Version Packages' }}
|
|
102
|
+
env:
|
|
103
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
104
|
+
NPM_CONFIG_PROVENANCE: true
|
|
105
|
+
|
|
106
|
+
- name: Create GitHub releases
|
|
107
|
+
if: steps.changesets.outputs.published == 'true'
|
|
108
|
+
env:
|
|
109
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
110
|
+
PUBLISHED_PACKAGES: ${{ steps.changesets.outputs.publishedPackages }}
|
|
111
|
+
run: |
|
|
112
|
+
node <<'NODE'
|
|
113
|
+
const { execSync } = require("node:child_process");
|
|
114
|
+
|
|
115
|
+
const published = JSON.parse(process.env.PUBLISHED_PACKAGES || "[]");
|
|
116
|
+
|
|
117
|
+
for (const pkg of published) {
|
|
118
|
+
const shortName = pkg.name.replace(/^@[^/]+\//, "");
|
|
119
|
+
const tag = `${shortName}@${pkg.version}`;
|
|
120
|
+
|
|
121
|
+
const existing = execSync(`git tag --list ${tag}`, { encoding: "utf8" }).trim();
|
|
122
|
+
if (!existing) {
|
|
123
|
+
execSync(`git tag ${tag}`);
|
|
124
|
+
execSync(`git push origin ${tag}`);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
let hasRelease = false;
|
|
128
|
+
try {
|
|
129
|
+
const output = execSync(`gh release view ${tag} --json tagName --jq .tagName`, {
|
|
130
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
131
|
+
}).toString().trim();
|
|
132
|
+
hasRelease = output.length > 0;
|
|
133
|
+
} catch {
|
|
134
|
+
hasRelease = false;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (!hasRelease) {
|
|
138
|
+
execSync(`gh release create ${tag} --title ${tag} --notes "Release ${tag}"`, {
|
|
139
|
+
stdio: "inherit",
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
NODE
|
package/AGENTS.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# pi-synthetic
|
|
2
|
+
|
|
3
|
+
Public Pi extension providing open-source language models via Synthetic's API. People could be using this, so consider backwards compatibility when making changes.
|
|
4
|
+
|
|
5
|
+
Pi is pre-1.0.0, so breaking changes can happen between Pi versions. This extension must stay up to date with Pi or things will break.
|
|
6
|
+
|
|
7
|
+
## Stack
|
|
8
|
+
|
|
9
|
+
- TypeScript (strict mode)
|
|
10
|
+
- pnpm 10.26.1
|
|
11
|
+
- Biome for linting/formatting
|
|
12
|
+
- Changesets for versioning
|
|
13
|
+
|
|
14
|
+
## Scripts
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pnpm typecheck # Type check
|
|
18
|
+
pnpm lint # Lint (runs on pre-commit)
|
|
19
|
+
pnpm format # Format
|
|
20
|
+
pnpm changeset # Create changeset for versioning
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Structure
|
|
24
|
+
|
|
25
|
+
```
|
|
26
|
+
src/
|
|
27
|
+
index.ts # Extension entry, registers provider
|
|
28
|
+
providers/
|
|
29
|
+
index.ts # Provider registration
|
|
30
|
+
models.ts # Hardcoded model definitions
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Conventions
|
|
34
|
+
|
|
35
|
+
- API key comes from environment (`SYNTHETIC_API_KEY`)
|
|
36
|
+
- Uses Anthropic-compatible API at `https://api.synthetic.new/anthropic`
|
|
37
|
+
- Models are hardcoded in `src/providers/models.ts`
|
|
38
|
+
- Update model list when Synthetic adds new models
|
|
39
|
+
|
|
40
|
+
## Adding Models
|
|
41
|
+
|
|
42
|
+
Edit `src/providers/models.ts`:
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
{
|
|
46
|
+
id: "hf:vendor/model-name",
|
|
47
|
+
name: "vendor/model-name",
|
|
48
|
+
reasoning: true/false,
|
|
49
|
+
input: ["text"] or ["text", "image"],
|
|
50
|
+
cost: {
|
|
51
|
+
input: 0.55, // $ per million tokens
|
|
52
|
+
output: 2.19,
|
|
53
|
+
cacheRead: 0.55,
|
|
54
|
+
cacheWrite: 0
|
|
55
|
+
},
|
|
56
|
+
contextWindow: 202752,
|
|
57
|
+
maxTokens: 65536
|
|
58
|
+
}
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Get pricing from `https://api.synthetic.new/openai/v1/models`.
|
|
62
|
+
|
|
63
|
+
## Versioning
|
|
64
|
+
|
|
65
|
+
Uses changesets. Run `pnpm changeset` before committing user-facing changes.
|
|
66
|
+
|
|
67
|
+
- `patch`: bug fixes, model updates
|
|
68
|
+
- `minor`: new models, features
|
|
69
|
+
- `major`: breaking changes
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# @aliou/pi-synthetic
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 4a32d18: Initial release with 19 open-source models
|
|
8
|
+
|
|
9
|
+
- Add Synthetic provider with Anthropic-compatible API
|
|
10
|
+
- Support for DeepSeek, Qwen, MiniMax, Kimi, Llama, GLM models
|
|
11
|
+
- Vision and reasoning capabilities where available
|
|
12
|
+
- Hardcoded model definitions with per-token pricing
|
package/README.md
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# Pi Synthetic Extension
|
|
2
|
+
|
|
3
|
+
A Pi extension that adds [Synthetic](https://synthetic.new) as a model provider, giving you access to open-source models through an Anthropic-compatible API.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
### Get API Key
|
|
8
|
+
|
|
9
|
+
Sign up at [synthetic.new](https://synthetic.new/?referral=NDWw1u3UDWiFyDR) to get an API key (referral link).
|
|
10
|
+
|
|
11
|
+
### Set Environment Variable
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
export SYNTHETIC_API_KEY="your-api-key-here"
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Add to shell profile for persistence:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
echo 'export SYNTHETIC_API_KEY="your-api-key-here"' >> ~/.zshrc
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
### Install Extension
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# From npm
|
|
27
|
+
pi install npm:@aliou/pi-synthetic
|
|
28
|
+
|
|
29
|
+
# From git
|
|
30
|
+
pi install git:github.com/aliou/pi-synthetic
|
|
31
|
+
|
|
32
|
+
# Local development
|
|
33
|
+
pi -e ./src/index.ts
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Usage
|
|
37
|
+
|
|
38
|
+
Once installed, select `synthetic` as your provider and choose from available models:
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
/model synthetic hf:moonshotai/Kimi-K2.5
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Adding or Updating Models
|
|
45
|
+
|
|
46
|
+
Models are hardcoded in `src/providers/models.ts`. To add or update models:
|
|
47
|
+
|
|
48
|
+
1. Edit `src/providers/models.ts`
|
|
49
|
+
2. Add the model configuration following the `SyntheticModelConfig` interface
|
|
50
|
+
3. Run `pnpm run typecheck` to verify
|
|
51
|
+
|
|
52
|
+
## Development
|
|
53
|
+
|
|
54
|
+
### Setup
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
git clone https://github.com/aliou/pi-synthetic.git
|
|
58
|
+
cd pi-synthetic
|
|
59
|
+
|
|
60
|
+
# Install dependencies (sets up pre-commit hooks)
|
|
61
|
+
pnpm install && pnpm prepare
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Pre-commit hooks run on every commit:
|
|
65
|
+
- TypeScript type checking
|
|
66
|
+
- Biome linting
|
|
67
|
+
- Biome formatting with auto-fix
|
|
68
|
+
|
|
69
|
+
### Commands
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Type check
|
|
73
|
+
pnpm run typecheck
|
|
74
|
+
|
|
75
|
+
# Lint
|
|
76
|
+
pnpm run lint
|
|
77
|
+
|
|
78
|
+
# Format
|
|
79
|
+
pnpm run format
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### Test Locally
|
|
83
|
+
|
|
84
|
+
```bash
|
|
85
|
+
pi -e ./src/index.ts
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Release
|
|
89
|
+
|
|
90
|
+
This repository uses [Changesets](https://github.com/changesets/changesets) for versioning.
|
|
91
|
+
|
|
92
|
+
**Note:** Automatic NPM publishing is currently disabled. To publish manually:
|
|
93
|
+
|
|
94
|
+
1. Create a changeset: `pnpm changeset`
|
|
95
|
+
2. Version packages: `pnpm version`
|
|
96
|
+
3. Publish (when ready): Uncomment the publish job in `.github/workflows/publish.yml`
|
|
97
|
+
|
|
98
|
+
## Requirements
|
|
99
|
+
|
|
100
|
+
- Pi coding agent v0.50.0+
|
|
101
|
+
- SYNTHETIC_API_KEY environment variable
|
|
102
|
+
|
|
103
|
+
## Links
|
|
104
|
+
|
|
105
|
+
- [Synthetic](https://synthetic.new)
|
|
106
|
+
- [Synthetic Models](https://synthetic.new/models)
|
|
107
|
+
- [Synthetic API Docs](https://dev.synthetic.new/docs/api/overview)
|
|
108
|
+
- [Pi Documentation](https://buildwithpi.ai/)
|
package/biome.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.3.13/schema.json",
|
|
3
|
+
"vcs": {
|
|
4
|
+
"enabled": true,
|
|
5
|
+
"clientKind": "git",
|
|
6
|
+
"useIgnoreFile": true
|
|
7
|
+
},
|
|
8
|
+
"files": {
|
|
9
|
+
"includes": ["**/*.ts", "**/*.json"],
|
|
10
|
+
"ignoreUnknown": true
|
|
11
|
+
},
|
|
12
|
+
"assist": {
|
|
13
|
+
"actions": {
|
|
14
|
+
"source": {
|
|
15
|
+
"organizeImports": "on"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"linter": {
|
|
20
|
+
"enabled": true,
|
|
21
|
+
"rules": {
|
|
22
|
+
"recommended": true
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"formatter": {
|
|
26
|
+
"enabled": true,
|
|
27
|
+
"indentStyle": "space",
|
|
28
|
+
"indentWidth": 2
|
|
29
|
+
}
|
|
30
|
+
}
|
package/package.json
CHANGED
|
@@ -1,9 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aliou/pi-synthetic",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"repository": {
|
|
5
|
+
"type": "git",
|
|
6
|
+
"url": "https://github.com/aliou/pi-synthetic"
|
|
7
|
+
},
|
|
5
8
|
"keywords": [
|
|
6
9
|
"pi-package"
|
|
7
|
-
]
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
],
|
|
11
|
+
"pi": {
|
|
12
|
+
"extensions": [
|
|
13
|
+
"./src/index.ts"
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
"devDependencies": {
|
|
17
|
+
"@biomejs/biome": "^2.3.13",
|
|
18
|
+
"@changesets/cli": "^2.27.11",
|
|
19
|
+
"@mariozechner/pi-coding-agent": "^0.50.1",
|
|
20
|
+
"@mariozechner/pi-tui": "^0.50.1",
|
|
21
|
+
"@types/node": "^25.0.10",
|
|
22
|
+
"husky": "^9.1.7",
|
|
23
|
+
"typescript": "^5.9.3"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"typecheck": "tsc --noEmit",
|
|
27
|
+
"lint": "biome check",
|
|
28
|
+
"format": "biome check --write",
|
|
29
|
+
"changeset": "changeset",
|
|
30
|
+
"version": "changeset version",
|
|
31
|
+
"release": "pnpm changeset publish"
|
|
32
|
+
}
|
|
33
|
+
}
|
package/shell.nix
ADDED
package/src/index.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ExtensionAPI } from "@mariozechner/pi-coding-agent";
|
|
2
|
+
import { SYNTHETIC_MODELS } from "./models.js";
|
|
3
|
+
|
|
4
|
+
export function registerSyntheticProvider(pi: ExtensionAPI): void {
|
|
5
|
+
pi.registerProvider("synthetic", {
|
|
6
|
+
baseUrl: "https://api.synthetic.new/anthropic",
|
|
7
|
+
apiKey: "SYNTHETIC_API_KEY",
|
|
8
|
+
api: "anthropic-messages",
|
|
9
|
+
models: SYNTHETIC_MODELS.map((model) => ({
|
|
10
|
+
id: model.id,
|
|
11
|
+
name: model.name,
|
|
12
|
+
reasoning: model.reasoning,
|
|
13
|
+
input: model.input,
|
|
14
|
+
cost: model.cost,
|
|
15
|
+
contextWindow: model.contextWindow,
|
|
16
|
+
maxTokens: model.maxTokens,
|
|
17
|
+
})),
|
|
18
|
+
});
|
|
19
|
+
}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
// Hardcoded models from Synthetic API
|
|
2
|
+
// Source: https://api.synthetic.new/openai/v1/models
|
|
3
|
+
|
|
4
|
+
export interface SyntheticModelConfig {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
reasoning: boolean;
|
|
8
|
+
input: ("text" | "image")[];
|
|
9
|
+
cost: {
|
|
10
|
+
input: number;
|
|
11
|
+
output: number;
|
|
12
|
+
cacheRead: number;
|
|
13
|
+
cacheWrite: number;
|
|
14
|
+
};
|
|
15
|
+
contextWindow: number;
|
|
16
|
+
maxTokens: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const SYNTHETIC_MODELS: SyntheticModelConfig[] = [
|
|
20
|
+
{
|
|
21
|
+
id: "hf:zai-org/GLM-4.7",
|
|
22
|
+
name: "zai-org/GLM-4.7",
|
|
23
|
+
reasoning: true,
|
|
24
|
+
input: ["text"],
|
|
25
|
+
cost: {
|
|
26
|
+
input: 0.55,
|
|
27
|
+
output: 2.19,
|
|
28
|
+
cacheRead: 0.55,
|
|
29
|
+
cacheWrite: 0,
|
|
30
|
+
},
|
|
31
|
+
contextWindow: 202752,
|
|
32
|
+
maxTokens: 65536,
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: "hf:MiniMaxAI/MiniMax-M2.1",
|
|
36
|
+
name: "MiniMaxAI/MiniMax-M2.1",
|
|
37
|
+
reasoning: true,
|
|
38
|
+
input: ["text"],
|
|
39
|
+
cost: {
|
|
40
|
+
input: 0.55,
|
|
41
|
+
output: 2.19,
|
|
42
|
+
cacheRead: 0.55,
|
|
43
|
+
cacheWrite: 0,
|
|
44
|
+
},
|
|
45
|
+
contextWindow: 196608,
|
|
46
|
+
maxTokens: 65536,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: "hf:meta-llama/Llama-3.3-70B-Instruct",
|
|
50
|
+
name: "meta-llama/Llama-3.3-70B-Instruct",
|
|
51
|
+
reasoning: false,
|
|
52
|
+
input: ["text"],
|
|
53
|
+
cost: {
|
|
54
|
+
input: 0.9,
|
|
55
|
+
output: 0.9,
|
|
56
|
+
cacheRead: 0.9,
|
|
57
|
+
cacheWrite: 0,
|
|
58
|
+
},
|
|
59
|
+
contextWindow: 131072,
|
|
60
|
+
maxTokens: 4096,
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: "hf:deepseek-ai/DeepSeek-V3-0324",
|
|
64
|
+
name: "deepseek-ai/DeepSeek-V3-0324",
|
|
65
|
+
reasoning: false,
|
|
66
|
+
input: ["text"],
|
|
67
|
+
cost: {
|
|
68
|
+
input: 1.2,
|
|
69
|
+
output: 1.2,
|
|
70
|
+
cacheRead: 1.2,
|
|
71
|
+
cacheWrite: 0,
|
|
72
|
+
},
|
|
73
|
+
contextWindow: 131072,
|
|
74
|
+
maxTokens: 4096,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
id: "hf:deepseek-ai/DeepSeek-R1-0528",
|
|
78
|
+
name: "deepseek-ai/DeepSeek-R1-0528",
|
|
79
|
+
reasoning: true,
|
|
80
|
+
input: ["text"],
|
|
81
|
+
cost: {
|
|
82
|
+
input: 3,
|
|
83
|
+
output: 8,
|
|
84
|
+
cacheRead: 3,
|
|
85
|
+
cacheWrite: 0,
|
|
86
|
+
},
|
|
87
|
+
contextWindow: 131072,
|
|
88
|
+
maxTokens: 4096,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: "hf:deepseek-ai/DeepSeek-V3.1",
|
|
92
|
+
name: "deepseek-ai/DeepSeek-V3.1",
|
|
93
|
+
reasoning: false,
|
|
94
|
+
input: ["text"],
|
|
95
|
+
cost: {
|
|
96
|
+
input: 0.56,
|
|
97
|
+
output: 1.68,
|
|
98
|
+
cacheRead: 0.56,
|
|
99
|
+
cacheWrite: 0,
|
|
100
|
+
},
|
|
101
|
+
contextWindow: 131072,
|
|
102
|
+
maxTokens: 4096,
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
id: "hf:deepseek-ai/DeepSeek-V3.1-Terminus",
|
|
106
|
+
name: "deepseek-ai/DeepSeek-V3.1-Terminus",
|
|
107
|
+
reasoning: false,
|
|
108
|
+
input: ["text"],
|
|
109
|
+
cost: {
|
|
110
|
+
input: 1.2,
|
|
111
|
+
output: 1.2,
|
|
112
|
+
cacheRead: 1.2,
|
|
113
|
+
cacheWrite: 0,
|
|
114
|
+
},
|
|
115
|
+
contextWindow: 131072,
|
|
116
|
+
maxTokens: 4096,
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
id: "hf:deepseek-ai/DeepSeek-V3.2",
|
|
120
|
+
name: "deepseek-ai/DeepSeek-V3.2",
|
|
121
|
+
reasoning: false,
|
|
122
|
+
input: ["text"],
|
|
123
|
+
cost: {
|
|
124
|
+
input: 0.56,
|
|
125
|
+
output: 1.68,
|
|
126
|
+
cacheRead: 0.56,
|
|
127
|
+
cacheWrite: 0,
|
|
128
|
+
},
|
|
129
|
+
contextWindow: 162816,
|
|
130
|
+
maxTokens: 4096,
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
id: "hf:Qwen/Qwen3-VL-235B-A22B-Instruct",
|
|
134
|
+
name: "Qwen/Qwen3-VL-235B-A22B-Instruct",
|
|
135
|
+
reasoning: true,
|
|
136
|
+
input: ["text", "image"],
|
|
137
|
+
cost: {
|
|
138
|
+
input: 0.22,
|
|
139
|
+
output: 0.88,
|
|
140
|
+
cacheRead: 0.22,
|
|
141
|
+
cacheWrite: 0,
|
|
142
|
+
},
|
|
143
|
+
contextWindow: 256000,
|
|
144
|
+
maxTokens: 4096,
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
id: "hf:moonshotai/Kimi-K2-Instruct-0905",
|
|
148
|
+
name: "moonshotai/Kimi-K2-Instruct-0905",
|
|
149
|
+
reasoning: true,
|
|
150
|
+
input: ["text"],
|
|
151
|
+
cost: {
|
|
152
|
+
input: 1.2,
|
|
153
|
+
output: 1.2,
|
|
154
|
+
cacheRead: 1.2,
|
|
155
|
+
cacheWrite: 0,
|
|
156
|
+
},
|
|
157
|
+
contextWindow: 262144,
|
|
158
|
+
maxTokens: 4096,
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
id: "hf:moonshotai/Kimi-K2-Thinking",
|
|
162
|
+
name: "moonshotai/Kimi-K2-Thinking",
|
|
163
|
+
reasoning: true,
|
|
164
|
+
input: ["text"],
|
|
165
|
+
cost: {
|
|
166
|
+
input: 0.6,
|
|
167
|
+
output: 2.5,
|
|
168
|
+
cacheRead: 0.6,
|
|
169
|
+
cacheWrite: 0,
|
|
170
|
+
},
|
|
171
|
+
contextWindow: 262144,
|
|
172
|
+
maxTokens: 4096,
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
id: "hf:openai/gpt-oss-120b",
|
|
176
|
+
name: "openai/gpt-oss-120b",
|
|
177
|
+
reasoning: false,
|
|
178
|
+
input: ["text"],
|
|
179
|
+
cost: {
|
|
180
|
+
input: 0.1,
|
|
181
|
+
output: 0.1,
|
|
182
|
+
cacheRead: 0.1,
|
|
183
|
+
cacheWrite: 0,
|
|
184
|
+
},
|
|
185
|
+
contextWindow: 131072,
|
|
186
|
+
maxTokens: 4096,
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
id: "hf:Qwen/Qwen3-Coder-480B-A35B-Instruct",
|
|
190
|
+
name: "Qwen/Qwen3-Coder-480B-A35B-Instruct",
|
|
191
|
+
reasoning: false,
|
|
192
|
+
input: ["text"],
|
|
193
|
+
cost: {
|
|
194
|
+
input: 0.45,
|
|
195
|
+
output: 1.8,
|
|
196
|
+
cacheRead: 0.45,
|
|
197
|
+
cacheWrite: 0,
|
|
198
|
+
},
|
|
199
|
+
contextWindow: 262144,
|
|
200
|
+
maxTokens: 4096,
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
id: "hf:Qwen/Qwen3-235B-A22B-Instruct-2507",
|
|
204
|
+
name: "Qwen/Qwen3-235B-A22B-Instruct-2507",
|
|
205
|
+
reasoning: false,
|
|
206
|
+
input: ["text"],
|
|
207
|
+
cost: {
|
|
208
|
+
input: 0.22,
|
|
209
|
+
output: 0.88,
|
|
210
|
+
cacheRead: 0.22,
|
|
211
|
+
cacheWrite: 0,
|
|
212
|
+
},
|
|
213
|
+
contextWindow: 262144,
|
|
214
|
+
maxTokens: 4096,
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
id: "hf:zai-org/GLM-4.6",
|
|
218
|
+
name: "zai-org/GLM-4.6",
|
|
219
|
+
reasoning: true,
|
|
220
|
+
input: ["text"],
|
|
221
|
+
cost: {
|
|
222
|
+
input: 0.55,
|
|
223
|
+
output: 2.19,
|
|
224
|
+
cacheRead: 0.55,
|
|
225
|
+
cacheWrite: 0,
|
|
226
|
+
},
|
|
227
|
+
contextWindow: 202752,
|
|
228
|
+
maxTokens: 4096,
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
id: "hf:MiniMaxAI/MiniMax-M2",
|
|
232
|
+
name: "MiniMaxAI/MiniMax-M2",
|
|
233
|
+
reasoning: true,
|
|
234
|
+
input: ["text"],
|
|
235
|
+
cost: {
|
|
236
|
+
input: 0.3,
|
|
237
|
+
output: 1.2,
|
|
238
|
+
cacheRead: 0.3,
|
|
239
|
+
cacheWrite: 0,
|
|
240
|
+
},
|
|
241
|
+
contextWindow: 196608,
|
|
242
|
+
maxTokens: 4096,
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
id: "hf:moonshotai/Kimi-K2.5",
|
|
246
|
+
name: "moonshotai/Kimi-K2.5",
|
|
247
|
+
reasoning: true,
|
|
248
|
+
input: ["text", "image"],
|
|
249
|
+
cost: {
|
|
250
|
+
input: 1.2,
|
|
251
|
+
output: 1.2,
|
|
252
|
+
cacheRead: 1.2,
|
|
253
|
+
cacheWrite: 0,
|
|
254
|
+
},
|
|
255
|
+
contextWindow: 262144,
|
|
256
|
+
maxTokens: 4096,
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
id: "hf:deepseek-ai/DeepSeek-V3",
|
|
260
|
+
name: "deepseek-ai/DeepSeek-V3",
|
|
261
|
+
reasoning: false,
|
|
262
|
+
input: ["text"],
|
|
263
|
+
cost: {
|
|
264
|
+
input: 1.25,
|
|
265
|
+
output: 1.25,
|
|
266
|
+
cacheRead: 1.25,
|
|
267
|
+
cacheWrite: 0,
|
|
268
|
+
},
|
|
269
|
+
contextWindow: 131072,
|
|
270
|
+
maxTokens: 4096,
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
id: "hf:Qwen/Qwen3-235B-A22B-Thinking-2507",
|
|
274
|
+
name: "Qwen/Qwen3-235B-A22B-Thinking-2507",
|
|
275
|
+
reasoning: true,
|
|
276
|
+
input: ["text"],
|
|
277
|
+
cost: {
|
|
278
|
+
input: 0.65,
|
|
279
|
+
output: 3,
|
|
280
|
+
cacheRead: 0.65,
|
|
281
|
+
cacheWrite: 0,
|
|
282
|
+
},
|
|
283
|
+
contextWindow: 262144,
|
|
284
|
+
maxTokens: 4096,
|
|
285
|
+
},
|
|
286
|
+
];
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"forceConsistentCasingInFileNames": true,
|
|
10
|
+
"resolveJsonModule": true,
|
|
11
|
+
"noEmit": true
|
|
12
|
+
},
|
|
13
|
+
"include": ["src/**/*"],
|
|
14
|
+
"exclude": ["node_modules"]
|
|
15
|
+
}
|