pi-gigachat-models 0.0.0-stage → 0.2.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/README.md +189 -2
- package/certs/russian-trusted-root-ca.pem +33 -0
- package/certs/russian-trusted-sub-ca.pem +41 -0
- package/eslint.config.js +15 -0
- package/package.json +56 -4
- package/src/auth.ts +356 -0
- package/src/constants.ts +64 -0
- package/src/index.ts +66 -0
- package/src/models.ts +165 -0
- package/src/stream.ts +477 -0
- package/src/tls.ts +147 -0
- package/src/wire.ts +446 -0
package/README.md
CHANGED
|
@@ -1,3 +1,190 @@
|
|
|
1
|
-
#
|
|
1
|
+
# pi-gigachat-models
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
GigaChat provider (models and chat completions) for [pi](https://pi.dev). The package registers a `gigachat` provider with
|
|
4
|
+
Authorization-key login (`/login gigachat`), live model discovery, SSE token
|
|
5
|
+
streaming and function calling.
|
|
6
|
+
|
|
7
|
+
The wire protocol follows the public GigaChat OpenAPI description:
|
|
8
|
+
<https://developers.sber.ru/docs/files/openapi/gigachat/api.yml>
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
# Try it without installing
|
|
14
|
+
pi -e /path/to/gigachat
|
|
15
|
+
|
|
16
|
+
# Install as a personal package
|
|
17
|
+
pi install /path/to/gigachat
|
|
18
|
+
|
|
19
|
+
# Or from npm once published
|
|
20
|
+
pi install npm:pi-gigachat-models
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Sign in
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
/login gigachat
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
The flow asks for:
|
|
30
|
+
|
|
31
|
+
1. **API scope** — `GIGACHAT_API_PERS` (individual), `GIGACHAT_API_B2B` or
|
|
32
|
+
`GIGACHAT_API_CORP` (legal entities).
|
|
33
|
+
2. **Authorization key** — the Base64 `client_id:client_secret` value from the
|
|
34
|
+
GigaChat API console. Pasting a full `Basic ...` header or a quoted value is
|
|
35
|
+
fine; it is normalized.
|
|
36
|
+
|
|
37
|
+
The key is exchanged for a 30-minute access token immediately (so a wrong key
|
|
38
|
+
fails during login, not on the first prompt). The Authorization key is stored in
|
|
39
|
+
`~/.pi/agent/auth.json`; access tokens are cached in memory and renewed
|
|
40
|
+
automatically.
|
|
41
|
+
|
|
42
|
+
GigaChat endpoints are signed by the Russian Trusted CA of the Ministry of
|
|
43
|
+
Digital Development. Those certificates ship with the package and are used for
|
|
44
|
+
the provider's own requests only — see [TLS and certificates](#tls-and-certificates).
|
|
45
|
+
|
|
46
|
+
After login:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
/model gigachat/GigaChat-2-Max
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
`/logout gigachat` removes the stored key.
|
|
53
|
+
|
|
54
|
+
Legal-entity scopes (`B2B`, `CORP`) additionally require a GigaChat API client
|
|
55
|
+
certificate (mTLS) on the token endpoint. That is not implemented: the provider
|
|
56
|
+
uses `fetch`, which has no portable way to present a client certificate.
|
|
57
|
+
Individual (`PERS`) keys need no client certificate.
|
|
58
|
+
|
|
59
|
+
## TLS and certificates
|
|
60
|
+
|
|
61
|
+
`ngw.devices.sberbank.ru:9443` and `api.giga.chat` present certificates issued
|
|
62
|
+
by the **Russian Trusted Sub CA** under the **Russian Trusted Root CA**
|
|
63
|
+
(Ministry of Digital Development). Node's default trust store does not contain
|
|
64
|
+
them, so a plain `fetch` fails with `fetch failed` and, as the cause,
|
|
65
|
+
`self-signed certificate in certificate chain`.
|
|
66
|
+
|
|
67
|
+
The provider bundles both certificates in `certs/` as verbatim copies of the
|
|
68
|
+
files published at <https://www.gosuslugi.ru/landing/crt_linux>
|
|
69
|
+
(<https://gu-st.ru/content/lending/russian_trusted_root_ca_pem.crt> and
|
|
70
|
+
`russian_trusted_sub_ca_pem.crt`), so nothing has to be installed manually:
|
|
71
|
+
|
|
72
|
+
- the certificates are added to an undici dispatcher that is attached to the
|
|
73
|
+
token, `GET /models` and chat requests of this provider only,
|
|
74
|
+
- system settings and other tools' trust are untouched, and certificate
|
|
75
|
+
verification stays enabled,
|
|
76
|
+
- Node's own roots are kept, so overriding `GIGACHAT_BASE_URL` with a host that
|
|
77
|
+
uses a public CA still works.
|
|
78
|
+
|
|
79
|
+
Extra CAs (corporate proxy, private endpoint) can be added without touching the
|
|
80
|
+
package: `GIGACHAT_CA_BUNDLE=/path/to/ca.pem` (several paths separated by the
|
|
81
|
+
platform path separator, `:` on Unix and `;` on Windows), or with
|
|
82
|
+
`NODE_EXTRA_CA_CERTS`, which Node already applies.
|
|
83
|
+
|
|
84
|
+
Fingerprints of the bundled files (SHA-256, verify with
|
|
85
|
+
`openssl x509 -in certs/<file> -noout -fingerprint -sha256`):
|
|
86
|
+
|
|
87
|
+
| File | SHA-256 fingerprint |
|
|
88
|
+
|---|---|
|
|
89
|
+
| `russian-trusted-root-ca.pem` | `D2:6D:2D:02:31:B7:C3:9F:92:CC:73:85:12:BA:54:10:35:19:E4:40:5D:68:B5:BD:70:3E:97:88:CA:8E:CF:31` |
|
|
90
|
+
| `russian-trusted-sub-ca.pem` | `BB:BD:E2:10:3E:79:0B:99:9E:C6:2B:D0:3C:F6:25:A5:A2:E7:C3:16:E1:0A:FE:6A:49:0E:ED:EA:D8:B3:FD:9B` |
|
|
91
|
+
|
|
92
|
+
The certificates are public data, not secrets. They are imported by `npm test`,
|
|
93
|
+
which fails if a bundled file is replaced or corrupted.
|
|
94
|
+
|
|
95
|
+
## Environment variables
|
|
96
|
+
|
|
97
|
+
`/login` is optional when the environment already provides a credential:
|
|
98
|
+
|
|
99
|
+
| Variable | Meaning |
|
|
100
|
+
|---|---|
|
|
101
|
+
| `GIGACHAT_CREDENTIALS` | Authorization key (same name as the official SDK) |
|
|
102
|
+
| `GIGACHAT_AUTHORIZATION_KEY` | Alias for the Authorization key |
|
|
103
|
+
| `GIGACHAT_ACCESS_TOKEN` | Ready-made access token; skips the token exchange |
|
|
104
|
+
| `GIGACHAT_SCOPE` | `GIGACHAT_API_PERS` (default), `GIGACHAT_API_B2B`, `GIGACHAT_API_CORP` |
|
|
105
|
+
| `GIGACHAT_BASE_URL` | REST root, default `https://api.giga.chat/v1` |
|
|
106
|
+
| `GIGACHAT_AUTH_URL` | OAuth endpoint, default `https://ngw.devices.sberbank.ru:9443/api/v2/oauth` |
|
|
107
|
+
| `GIGACHAT_CA_BUNDLE` | Extra PEM file(s) trusted for GigaChat requests, `:`-separated (`;` on Windows) |
|
|
108
|
+
|
|
109
|
+
A stored credential always wins over the environment. `GIGACHAT_BASE_URL` and
|
|
110
|
+
`GIGACHAT_AUTH_URL` are read when the provider is registered (extension load or
|
|
111
|
+
`/reload`); the credential variables are read on every request.
|
|
112
|
+
|
|
113
|
+
## Models
|
|
114
|
+
|
|
115
|
+
The provider starts with the models documented at
|
|
116
|
+
<https://developers.sber.ru/docs/ru/gigachat/models/main> — GigaChat 3 Ultra,
|
|
117
|
+
GigaChat 2 Max, GigaChat 2 Pro, GigaChat 2 Lite — and refreshes the list from
|
|
118
|
+
`GET /models` at startup, when `/model` opens and after `/login`. Models the
|
|
119
|
+
service returns additionally are added with documented defaults (128K context,
|
|
120
|
+
8K output).
|
|
121
|
+
|
|
122
|
+
GigaChat bills in rubles per million tokens, which pi cannot express in its USD
|
|
123
|
+
cost estimate, so every model reports zero cost. Use the console for spend.
|
|
124
|
+
|
|
125
|
+
## Capabilities and limits
|
|
126
|
+
|
|
127
|
+
Supported:
|
|
128
|
+
|
|
129
|
+
- system prompt plus multi-turn history (GigaChat accepts exactly one leading
|
|
130
|
+
system message; later system messages are folded into it),
|
|
131
|
+
- SSE token streaming with usage accounting (`precached_prompt_tokens` maps to
|
|
132
|
+
cache reads),
|
|
133
|
+
- user-defined functions: pi tools are sent as `functions` with
|
|
134
|
+
`function_call: "auto"`, responses are converted to pi tool calls, and
|
|
135
|
+
`functions_state_id` is replayed on the next request so the model keeps the
|
|
136
|
+
call context,
|
|
137
|
+
- aborting a request, request timeouts (`timeoutMs`), context-overflow
|
|
138
|
+
normalization so pi can compact, and clear `401`/`429` error messages,
|
|
139
|
+
- `samplingParams` passthrough (`top_p`, `repetition_penalty`, …).
|
|
140
|
+
|
|
141
|
+
Not supported yet:
|
|
142
|
+
|
|
143
|
+
- **image input** — GigaChat expects uploaded file ids in `attachments`, so
|
|
144
|
+
models are declared text-only and image blocks are replaced with a
|
|
145
|
+
`[image omitted]` note,
|
|
146
|
+
- parallel tool calls in a single turn (`GigaChat-3-Ultra` only, v2 protocol) —
|
|
147
|
+
an assistant turn with several tool calls is replayed as one
|
|
148
|
+
`function_call` + `function` pair per call,
|
|
149
|
+
- mid-stream tool-argument deltas — GigaChat sends the whole `function_call` in
|
|
150
|
+
one fragment anyway,
|
|
151
|
+
- client-certificate (mTLS) authentication for legal-entity scopes.
|
|
152
|
+
|
|
153
|
+
## Development
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
npm install # host packages are peers, installed as dev dependencies
|
|
157
|
+
npm run typecheck # strict TypeScript check, no emit
|
|
158
|
+
npm test # node --test, no network access required
|
|
159
|
+
npm run coverage # node's built-in coverage report for the test suite
|
|
160
|
+
npm run lint # ESLint on src/ and test/
|
|
161
|
+
```
|
|
162
|
+
|
|
163
|
+
Layout:
|
|
164
|
+
|
|
165
|
+
| File | Purpose |
|
|
166
|
+
|---|---|
|
|
167
|
+
| `src/index.ts` | extension entry: registers the provider |
|
|
168
|
+
| `src/auth.ts` | Authorization-key login, token exchange, token cache |
|
|
169
|
+
| `src/models.ts` | model catalog and `GET /models` discovery |
|
|
170
|
+
| `src/tls.ts` | Russian Trusted CA trust and the per-request undici dispatcher |
|
|
171
|
+
| `src/wire.ts` | pi transcript → GigaChat messages, SSE parsing, finish reasons |
|
|
172
|
+
| `src/stream.ts` | `streamSimple` implementation and event emission |
|
|
173
|
+
| `certs/` | Bundled Russian Trusted Root CA and Sub CA (public certificates) |
|
|
174
|
+
|
|
175
|
+
## Troubleshooting
|
|
176
|
+
|
|
177
|
+
- **`401 Unauthorized` during login** — the value is probably the client secret
|
|
178
|
+
instead of the Base64 Authorization key from the console.
|
|
179
|
+
- **`fetch failed` / `self-signed certificate in certificate chain`** — the TLS
|
|
180
|
+
trust for the Russian Trusted CA did not apply. Check that `certs/` is present
|
|
181
|
+
next to `src/`, or point `GIGACHAT_CA_BUNDLE` at a copy of
|
|
182
|
+
`russian_trusted_root_ca_pem.crt`. The error message names the missing file.
|
|
183
|
+
- **`401` while chatting** — the token expired and could not be renewed; run
|
|
184
|
+
`/login gigachat` again.
|
|
185
|
+
- **`429 Too many requests`** — GigaChat quotas per second are low; retry, or
|
|
186
|
+
switch to a smaller model.
|
|
187
|
+
- **`context_length_exceeded`** — pi compacts and retries once automatically.
|
|
188
|
+
Very large tool outputs may need to be trimmed.
|
|
189
|
+
- **`GigaChat is not configured`** — no credential is stored and no environment
|
|
190
|
+
variable is set.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
-----BEGIN CERTIFICATE-----
|
|
2
|
+
MIIFwjCCA6qgAwIBAgICEAAwDQYJKoZIhvcNAQELBQAwcDELMAkGA1UEBhMCUlUx
|
|
3
|
+
PzA9BgNVBAoMNlRoZSBNaW5pc3RyeSBvZiBEaWdpdGFsIERldmVsb3BtZW50IGFu
|
|
4
|
+
ZCBDb21tdW5pY2F0aW9uczEgMB4GA1UEAwwXUnVzc2lhbiBUcnVzdGVkIFJvb3Qg
|
|
5
|
+
Q0EwHhcNMjIwMzAxMjEwNDE1WhcNMzIwMjI3MjEwNDE1WjBwMQswCQYDVQQGEwJS
|
|
6
|
+
VTE/MD0GA1UECgw2VGhlIE1pbmlzdHJ5IG9mIERpZ2l0YWwgRGV2ZWxvcG1lbnQg
|
|
7
|
+
YW5kIENvbW11bmljYXRpb25zMSAwHgYDVQQDDBdSdXNzaWFuIFRydXN0ZWQgUm9v
|
|
8
|
+
dCBDQTCCAiIwDQYJKoZIhvcNA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hOaexI/99c14dyiuk1+6QhdwKaCRTc1mdfNQmnfWNRbfWhWBlK3h4GGE9JK33
|
|
34
|
+
Gk8ZS8DMrkdAh0xby4xAQ/mSWAfWrBmfzlOqGyoB1U47WTOeqNbWkkoAP2ys94+s
|
|
35
|
+
Jg4NTkiDVtXRF6nr6fYi0bSOvOFg0IQrMXO2Y8gyg9ARdPJwKtvWX8VPADCYMiWH
|
|
36
|
+
h4n8bZokIrImVKLDQKHY4jCsND2HHdJfnrdL2YJw1qFskNO4cSNmZydw0Wkgjv9k
|
|
37
|
+
F+KxqrDKlB8MZu2Hclph6v/CZ0fQ9YuE8/lsHZ0Qc2HyiSMnvjgK5fDc3TD4fa8F
|
|
38
|
+
E8gMNurM+kV8PT8LNIM+4Zs+LKEV8nqRWBaxkIVJGekkVKO8xDBOG/aN62AZKHOe
|
|
39
|
+
GcyIdu7yNMMRihGVZCYr8rYiJoKiOzDqOkPkLOPdhtVlgnhowzHDxMHND/E2WA5p
|
|
40
|
+
ZHuNM/m0TXt2wTTPL7JH2YC0gPz/BvvSzjksgzU5rLbRyUKQkgU=
|
|
41
|
+
-----END CERTIFICATE-----
|
package/eslint.config.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import js from "@eslint/js";
|
|
2
|
+
import tseslint from "typescript-eslint";
|
|
3
|
+
|
|
4
|
+
export default tseslint.config(
|
|
5
|
+
{ ignores: ["node_modules/**"] },
|
|
6
|
+
js.configs.recommended,
|
|
7
|
+
...tseslint.configs.recommended,
|
|
8
|
+
{
|
|
9
|
+
files: ["src/**/*.ts", "test/**/*.ts"],
|
|
10
|
+
rules: {
|
|
11
|
+
"no-unused-vars": "off",
|
|
12
|
+
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }],
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,58 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-gigachat-models",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "GigaChat provider for pi: Authorization-key login, streaming chat completions and function calling",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"pi-package",
|
|
9
|
+
"gigachat",
|
|
10
|
+
"sber",
|
|
11
|
+
"provider"
|
|
12
|
+
],
|
|
13
|
+
"files": [
|
|
14
|
+
"src",
|
|
15
|
+
"certs",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"pi": {
|
|
19
|
+
"extensions": [
|
|
20
|
+
"./src/index.ts"
|
|
21
|
+
]
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"typecheck": "tsc -p tsconfig.json",
|
|
25
|
+
"test": "node --test test/*.test.ts",
|
|
26
|
+
"coverage": "node --experimental-test-coverage --test test/*.test.ts",
|
|
27
|
+
"lint": "eslint src test"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"@earendil-works/pi-ai": "*",
|
|
31
|
+
"@earendil-works/pi-coding-agent": "*"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@earendil-works/pi-ai": "1.6.1",
|
|
35
|
+
"@earendil-works/pi-coding-agent": "1.6.1",
|
|
36
|
+
"@eslint/js": "^10.0.1",
|
|
37
|
+
"@types/node": "^22.10.0",
|
|
38
|
+
"eslint": "^10.16.0",
|
|
39
|
+
"typescript": "^5.9.0",
|
|
40
|
+
"typescript-eslint": "^8.74.0"
|
|
41
|
+
},
|
|
42
|
+
"dependencies": {
|
|
43
|
+
"undici": "^8.12.4"
|
|
44
|
+
},
|
|
45
|
+
"main": "eslint.config.js",
|
|
46
|
+
"directories": {
|
|
47
|
+
"test": "test"
|
|
48
|
+
},
|
|
49
|
+
"repository": {
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": "git+https://github.com/khanton/pi-gigachat-models.git"
|
|
52
|
+
},
|
|
53
|
+
"author": "",
|
|
54
|
+
"bugs": {
|
|
55
|
+
"url": "https://github.com/khanton/pi-gigachat-models/issues"
|
|
56
|
+
},
|
|
57
|
+
"homepage": "https://github.com/khanton/pi-gigachat-models#readme"
|
|
58
|
+
}
|