@bastani/pi-ai 0.9.78 → 0.9.79-alpha.1
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/CHANGELOG.md +6 -0
- package/README.md +4 -4
- package/dist/api/anthropic-messages.d.ts.map +1 -1
- package/dist/api/anthropic-messages.js +3 -4
- package/dist/api/anthropic-messages.js.map +1 -1
- package/dist/providers/compat-schema.js +1 -1
- package/dist/providers/compat-schema.js.map +1 -1
- package/dist/providers/data/.manifest.json +1 -1
- package/dist/providers/data/openrouter.json +1 -1
- package/dist/providers/data/vercel-ai-gateway.json +1 -1
- package/dist/utils/version.d.ts +1 -1
- package/dist/utils/version.d.ts.map +1 -1
- package/dist/utils/version.js +1 -1
- package/dist/utils/version.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,12 @@ This package is a Bastani fork of `@earendil-works/pi-ai`. Upstream history at t
|
|
|
4
4
|
|
|
5
5
|
## [Unreleased]
|
|
6
6
|
|
|
7
|
+
## [0.9.79-alpha.1] - 2026-11-11
|
|
8
|
+
|
|
9
|
+
### Fixed
|
|
10
|
+
|
|
11
|
+
- Fixed Anthropic message threads staying off for providers other than `anthropic` whose `baseUrl` is on `api.anthropic.com`, such as a second Anthropic API provider; the default now follows the endpoint, not the provider ID (upstream [#11987](https://github.com/earendil-works/pi/issues/11987))
|
|
12
|
+
|
|
7
13
|
## [0.9.78] - 2026-11-11
|
|
8
14
|
|
|
9
15
|
GitHub Copilot's newest Gemini and Claude models are always in the catalog.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @bastani/pi-ai
|
|
2
2
|
|
|
3
|
-
Bastani-branded fork of [`@earendil-works/pi-ai`](https://www.npmjs.com/package/@earendil-works/pi-ai) from [earendil-works/pi](https://github.com/earendil-works/pi). Originally forked at **v0.84.2** (`914cf1472e715297caa30db4b9535d534a9eb718`); applicable upstream Pi AI fixes and the unified model catalog are synced through [`
|
|
3
|
+
Bastani-branded fork of [`@earendil-works/pi-ai`](https://www.npmjs.com/package/@earendil-works/pi-ai) from [earendil-works/pi](https://github.com/earendil-works/pi). Originally forked at **v0.84.2** (`914cf1472e715297caa30db4b9535d534a9eb718`); applicable upstream Pi AI fixes and the unified model catalog are synced through [`4b519d3bb19b57a368129b167a48da16e447d9f6`](https://github.com/earendil-works/pi/commit/4b519d3bb19b57a368129b167a48da16e447d9f6). `@bastani/pi-ai` publishes at the same version as Atomic. `npm run build` refreshes the models.dev catalog, same as upstream.
|
|
4
4
|
|
|
5
5
|
The public API is a drop-in replacement: install `@bastani/pi-ai` and import from `@bastani/pi-ai` instead of `@earendil-works/pi-ai`. See [NOTICE.md](NOTICE.md). This package lives in the Atomic monorepo and publishes from `.github/workflows/publish.yml`. The first npm version must be published by hand so trusted publishing can be attached.
|
|
6
6
|
|
|
@@ -1068,7 +1068,7 @@ const provider = createProvider({
|
|
|
1068
1068
|
name: 'Qwen3 4B',
|
|
1069
1069
|
api: 'llama-cpp-classify',
|
|
1070
1070
|
provider: 'local-llama',
|
|
1071
|
-
baseUrl: 'http://127.0.0.1:
|
|
1071
|
+
baseUrl: 'http://127.0.0.1:9931',
|
|
1072
1072
|
input: ['text'],
|
|
1073
1073
|
cost: { input: 0, output: 0, cacheRead: 0, cacheWrite: 0 },
|
|
1074
1074
|
contextWindow: 32768
|
|
@@ -1418,7 +1418,7 @@ const llamacpp = createProvider({
|
|
|
1418
1418
|
id: 'llamacpp',
|
|
1419
1419
|
auth: { apiKey: { name: 'llama.cpp', resolve: async () => ({ auth: {} }) } },
|
|
1420
1420
|
models: [],
|
|
1421
|
-
fetchModels: async ({ signal }) => fetchModelsFromServer('http://localhost:
|
|
1421
|
+
fetchModels: async ({ signal }) => fetchModelsFromServer('http://localhost:9931', signal),
|
|
1422
1422
|
api: openAICompletionsApi(),
|
|
1423
1423
|
});
|
|
1424
1424
|
|
|
@@ -1499,7 +1499,7 @@ Built-in API implementations live under `./api/<api-id>`:
|
|
|
1499
1499
|
|
|
1500
1500
|
Importing an implementation module loads its SDK. The `./api/<id>.lazy` wrappers (used by the provider factories) defer that load to the first request when the runtime or bundler supports dynamic import chunking. Legacy raw API subpaths from older releases (`./anthropic`, `./google`, `./mistral`, `./openai-completions`, ...) were removed; use `@bastani/pi-ai/api/<api-id>`.
|
|
1501
1501
|
|
|
1502
|
-
**Anthropic message threads (beta):** with `sessionId` set and `cacheRetention` not `"none"`, Anthropic requests continue from the previous reply on the server (`message-threads-2026-08-12` beta) and send only the new messages. When anything earlier in the request changed, or the server can't continue, the full request is sent. Token counts and prompt caching are unchanged. On by default only for
|
|
1502
|
+
**Anthropic message threads (beta):** with `sessionId` set and `cacheRetention` not `"none"`, Anthropic requests continue from the previous reply on the server (`message-threads-2026-08-12` beta) and send only the new messages. When anything earlier in the request changed, or the server can't continue, the full request is sent. Token counts and prompt caching are unchanged. On by default only for a `baseUrl` on `api.anthropic.com`; set `compat.supportsMessageThreads` to change that, for example for gateways that forward the `thread` field. Requests made with a caller-supplied `client` never use threads. Set `disableContinuation: true` on requests that repeat an earlier one, such as cache warming. Call `cleanupSessionResources(sessionId)` when a session ends.
|
|
1503
1503
|
|
|
1504
1504
|
### OpenAI Compatibility Settings
|
|
1505
1505
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"anthropic-messages.d.ts","sourceRoot":"","sources":["../../src/api/anthropic-messages.ts"],"names":[],"mappings":"AAAA,OAAO,SAAkD,MAAM,mBAAmB,CAAC;AAqBnF,OAAO,KAAK,EASX,mBAAmB,EAEnB,cAAc,EACd,aAAa,EAMb,MAAM,aAAa,CAAC;AA2LrB,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAE1E,MAAM,MAAM,wBAAwB,GAAG,YAAY,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"anthropic-messages.d.ts","sourceRoot":"","sources":["../../src/api/anthropic-messages.ts"],"names":[],"mappings":"AAAA,OAAO,SAAkD,MAAM,mBAAmB,CAAC;AAqBnF,OAAO,KAAK,EASX,mBAAmB,EAEnB,cAAc,EACd,aAAa,EAMb,MAAM,aAAa,CAAC;AA2LrB,MAAM,MAAM,eAAe,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAE1E,MAAM,MAAM,wBAAwB,GAAG,YAAY,GAAG,SAAS,CAAC;AAgfhE,MAAM,WAAW,gBAAiB,SAAQ,aAAa;IACtD;;;;;;OAMG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAE,eAAe,CAAC;IACzB;;;;;;;;;;;OAWG;IACH,eAAe,CAAC,EAAE,wBAAwB,CAAC;IAC3C;;;;;OAKG;IACH,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACtE;;;;OAIG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;CACnB;AAqVD,eAAO,MAAM,MAAM,EAAE,cAAc,CAAC,oBAAoB,EAAE,gBAAgB,CAobzE,CAAC;AA+CF,eAAO,MAAM,YAAY,EAAE,cAAc,CAAC,oBAAoB,EAAE,mBAAmB,CAgDlF,CAAC"}
|
|
@@ -337,10 +337,9 @@ function getAnthropicCompat(model) {
|
|
|
337
337
|
supportsMidConvoSystemMessages: model.compat?.supportsMidConvoSystemMessages ?? false,
|
|
338
338
|
supportsMidConvoToolChanges: model.compat?.supportsMidConvoToolChanges ?? false,
|
|
339
339
|
// Gateways that drop unknown request fields would silently turn a `continue` into a request
|
|
340
|
-
// without the earlier conversation, so the default is limited to
|
|
341
|
-
//
|
|
342
|
-
supportsMessageThreads: model.compat?.supportsMessageThreads ??
|
|
343
|
-
(model.provider === "anthropic" && isAnthropicApiHost(model.baseUrl)),
|
|
340
|
+
// without the earlier conversation, so the default is limited to Anthropic's own host.
|
|
341
|
+
// Copilot's endpoint does not accept the threads beta.
|
|
342
|
+
supportsMessageThreads: model.compat?.supportsMessageThreads ?? isAnthropicApiHost(model.baseUrl),
|
|
344
343
|
};
|
|
345
344
|
}
|
|
346
345
|
/** Whether `baseUrl` is Anthropic's own API host, compared by parsed hostname (not a substring). */
|