@f5xc-salesdemos/pi-ai 14.2.1 → 14.3.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/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [14.3.0] - 2026-04-09
6
+
7
+ ### Fixed
8
+
9
+ - Fixed Ollama discovery cache normalization so cached models upgrade to the OpenAI Responses transport after the provider change
10
+
5
11
  ## [14.0.0] - 2026-04-08
6
12
  ### Breaking Changes
7
13
 
@@ -1988,4 +1994,4 @@ _Dedicated to Peter's shoulder ([@steipete](https://twitter.com/steipete))_
1988
1994
 
1989
1995
  ## [0.9.4] - 2025-11-26
1990
1996
 
1991
- Initial release with multi-provider LLM support.
1997
+ Initial release with multi-provider LLM support.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "type": "module",
3
3
  "name": "@f5xc-salesdemos/pi-ai",
4
- "version": "14.2.1",
4
+ "version": "14.3.0",
5
5
  "description": "Unified LLM API with automatic model discovery and provider configuration",
6
6
  "homepage": "https://github.com/f5xc-salesdemos/xcsh",
7
7
  "author": "Can Boluk",
@@ -45,7 +45,7 @@
45
45
  "@aws-sdk/client-bedrock-runtime": "^3",
46
46
  "@bufbuild/protobuf": "^2.11",
47
47
  "@google/genai": "^1.43",
48
- "@f5xc-salesdemos/pi-utils": "14.2.1",
48
+ "@f5xc-salesdemos/pi-utils": "14.3.0",
49
49
  "@sinclair/typebox": "^0.34",
50
50
  "@smithy/node-http-handler": "^4.4",
51
51
  "ajv": "^8.18",
@@ -225,7 +225,7 @@ function toOllamaNativeBaseUrl(baseUrl: string): string {
225
225
  return baseUrl.endsWith("/v1") ? baseUrl.slice(0, -3) : baseUrl;
226
226
  }
227
227
 
228
- async function fetchOllamaNativeModels(baseUrl: string): Promise<Model<"openai-completions">[] | null> {
228
+ async function fetchOllamaNativeModels(baseUrl: string): Promise<Model<"openai-responses">[] | null> {
229
229
  const nativeBaseUrl = toOllamaNativeBaseUrl(baseUrl);
230
230
  let response: Response;
231
231
  try {
@@ -241,7 +241,7 @@ async function fetchOllamaNativeModels(baseUrl: string): Promise<Model<"openai-c
241
241
  }
242
242
  const payload = (await response.json()) as { models?: Array<{ name?: string; model?: string }> };
243
243
  const entries = payload.models ?? [];
244
- const models: Model<"openai-completions">[] = [];
244
+ const models: Model<"openai-responses">[] = [];
245
245
  for (const entry of entries) {
246
246
  const id = entry.model ?? entry.name;
247
247
  if (!id) {
@@ -250,7 +250,7 @@ async function fetchOllamaNativeModels(baseUrl: string): Promise<Model<"openai-c
250
250
  models.push({
251
251
  id,
252
252
  name: entry.name ?? id,
253
- api: "openai-completions",
253
+ api: "openai-responses",
254
254
  provider: "ollama",
255
255
  baseUrl,
256
256
  reasoning: false,
@@ -602,19 +602,15 @@ export interface OllamaModelManagerConfig {
602
602
  baseUrl?: string;
603
603
  }
604
604
 
605
- export function ollamaModelManagerOptions(
606
- config?: OllamaModelManagerConfig,
607
- ): ModelManagerOptions<"openai-completions"> {
605
+ export function ollamaModelManagerOptions(config?: OllamaModelManagerConfig): ModelManagerOptions<"openai-responses"> {
608
606
  const apiKey = config?.apiKey;
609
607
  const baseUrl = normalizeOllamaBaseUrl(config?.baseUrl);
610
- const references = createBundledReferenceMap<"openai-completions">(
611
- "ollama" as Parameters<typeof getBundledModels>[0],
612
- );
608
+ const references = createBundledReferenceMap<"openai-responses">("ollama" as Parameters<typeof getBundledModels>[0]);
613
609
  return {
614
610
  providerId: "ollama",
615
611
  fetchDynamicModels: async () => {
616
612
  const openAiCompatible = await fetchOpenAICompatibleModels({
617
- api: "openai-completions",
613
+ api: "openai-responses",
618
614
  provider: "ollama",
619
615
  baseUrl,
620
616
  apiKey,
@@ -49,7 +49,7 @@ export function detectOpenAICompat(model: Model<"openai-completions">, resolvedB
49
49
 
50
50
  const isCerebras = provider === "cerebras" || baseUrl.includes("cerebras.ai");
51
51
  const isZai = provider === "zai" || baseUrl.includes("api.z.ai");
52
- const isKimiModel = model.id.includes("moonshotai/kimi");
52
+ const isKimiModel = model.id.includes("moonshotai/kimi") || /^kimi[-.]/i.test(model.id);
53
53
  const isAlibaba = provider === "alibaba-coding-plan" || baseUrl.includes("dashscope");
54
54
  const isQwen = model.id.toLowerCase().includes("qwen");
55
55