pi-provider-freellmapi 1.0.0 → 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.
- package/README.md +5 -5
- package/freellmapi.example.json +1 -1
- package/index.ts +2 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ cp freellmapi.example.json ~/.pi/agent/freellmapi.json
|
|
|
29
29
|
```json
|
|
30
30
|
{
|
|
31
31
|
"name": "freellmapi",
|
|
32
|
-
"label": "
|
|
32
|
+
"label": "FreeLLM API",
|
|
33
33
|
"baseUrl": "https://freeapi.n.cofire.cn/v1",
|
|
34
34
|
"apiKey": "freellmapi-...",
|
|
35
35
|
"fetchModels": true,
|
|
@@ -41,7 +41,7 @@ cp freellmapi.example.json ~/.pi/agent/freellmapi.json
|
|
|
41
41
|
|
|
42
42
|
The `apiKey` supports pi's value syntax: a literal, `$ENV_VAR`, `${ENV_VAR}`,
|
|
43
43
|
or `!command`. You can also skip the config file entirely and just export
|
|
44
|
-
`
|
|
44
|
+
`FREELLM_API_KEY`.
|
|
45
45
|
|
|
46
46
|
- Override the config path with `PI_FREELMAPI_CONFIG=/path/to/config.json`.
|
|
47
47
|
- Set `"fetchModels": false` to use only the static `models` list.
|
|
@@ -53,16 +53,16 @@ pi --provider freellmapi --model auto
|
|
|
53
53
|
pi --provider freellmapi --model deepseek-v4-flash
|
|
54
54
|
```
|
|
55
55
|
|
|
56
|
-
Or open `/model` in the TUI and pick from the `
|
|
56
|
+
Or open `/model` in the TUI and pick from the `FreeLLM API` group.
|
|
57
57
|
|
|
58
58
|
## Config reference
|
|
59
59
|
|
|
60
60
|
| Field | Default | Description |
|
|
61
61
|
|-------|---------|-------------|
|
|
62
62
|
| `name` | `freellmapi` | Provider id (`--provider <name>`) |
|
|
63
|
-
| `label` | `
|
|
63
|
+
| `label` | `FreeLLM API` | Display label shown in `/model` |
|
|
64
64
|
| `baseUrl` | `https://freeapi.n.cofire.cn/v1` | OpenAI-compatible endpoint |
|
|
65
|
-
| `apiKey` | `$
|
|
65
|
+
| `apiKey` | `$FREELLM_API_KEY` | API key (literal / env / command) |
|
|
66
66
|
| `fetchModels` | `true` | Discover models from `{baseUrl}/models` |
|
|
67
67
|
| `contextWindow` | `131072` | Fallback context window per model |
|
|
68
68
|
| `maxTokens` | `16384` | Fallback max output tokens |
|
package/freellmapi.example.json
CHANGED
package/index.ts
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* ```json
|
|
17
17
|
* {
|
|
18
18
|
* "name": "freellmapi", // provider id → --provider freellmapi
|
|
19
|
-
* "label": "
|
|
19
|
+
* "label": "FreeLLM API", // display label in /model
|
|
20
20
|
* "baseUrl": "https://freeapi.n.cofire.cn/v1",
|
|
21
21
|
* "apiKey": "freellmapi-...", // literal, $ENV_VAR, or ${ENV_VAR}
|
|
22
22
|
* "fetchModels": true, // discover models from {baseUrl}/models
|
|
@@ -71,7 +71,7 @@ const DEFAULT_CONFIG_PATH = resolve(homedir(), ".pi", "agent", "freellmapi.json"
|
|
|
71
71
|
|
|
72
72
|
const DEFAULTS = {
|
|
73
73
|
name: "freellmapi",
|
|
74
|
-
label: "
|
|
74
|
+
label: "FreeLLM API",
|
|
75
75
|
baseUrl: "https://freeapi.n.cofire.cn/v1",
|
|
76
76
|
contextWindow: 131072,
|
|
77
77
|
maxTokens: 16384,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-provider-freellmapi",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "Register the FreeLLM API gateway (freeapi.n.cofire.cn) as an OpenAI-compatible provider in pi, with automatic model discovery",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi",
|
|
@@ -32,4 +32,4 @@
|
|
|
32
32
|
"@earendil-works/pi-tui": "*",
|
|
33
33
|
"typebox": "*"
|
|
34
34
|
}
|
|
35
|
-
}
|
|
35
|
+
}
|