@linxiraos/pi-catalog 1.1.6 → 1.1.7

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.
@@ -12,6 +12,7 @@ import { FIREWORKS_FAST_SUFFIX, toFireworksPublicModelId } from "../fireworks-mo
12
12
  import { getBundledModelReferenceIndex } from "../identity/bundled";
13
13
  import {
14
14
  anthropicModelSupportsThinking,
15
+ isGlm52ReasoningEffortModelId,
15
16
  isGlmVisionModelId,
16
17
  isGrokReasoningEffortCapable,
17
18
  isKimiK3ModelId,
@@ -36,6 +37,7 @@ import type {
36
37
  } from "../types";
37
38
  import { discoveryFetch, isAnthropicOAuthToken, isRecord, toBoolean, toNumber, toPositiveNumber } from "../utils";
38
39
  import { ALIBABA_TOKEN_PLAN_BASE_URL, parseAlibabaTokenPlanCredential } from "../wire/alibaba-token-plan";
40
+ import { CLOUDFLARE_AI_GATEWAY_COMPAT_BASE_URL } from "../wire/cloudflare-ai-gateway";
39
41
  import { coreWeaveProjectHeaders } from "../wire/coreweave";
40
42
  import {
41
43
  COPILOT_API_HEADERS,
@@ -656,6 +658,7 @@ type OpenAICompatibleModelManagerBuilderOptions<TApi extends Api> = {
656
658
  headers?: SimpleProviderDiscoveryHeaders;
657
659
  dynamicModelsAuthoritative?: true;
658
660
  requireApiKey?: true;
661
+ dropCachedModelIdsOnStaticMismatch?: readonly string[];
659
662
  filterModel?: (
660
663
  entry: OpenAICompatibleModelRecord,
661
664
  model: ModelSpec<TApi>,
@@ -678,6 +681,9 @@ function createOpenAICompatibleModelManagerOptions<TApi extends Api>(
678
681
  return {
679
682
  providerId: options.providerId,
680
683
  ...(options.dynamicModelsAuthoritative && { dynamicModelsAuthoritative: true }),
684
+ ...(options.dropCachedModelIdsOnStaticMismatch && {
685
+ dropCachedModelIdsOnStaticMismatch: options.dropCachedModelIdsOnStaticMismatch,
686
+ }),
681
687
  ...((!options.requireApiKey || apiKey) && {
682
688
  fetchDynamicModels: () =>
683
689
  fetchOpenAICompatibleModels({
@@ -4073,10 +4079,19 @@ export function syntheticModelManagerOptions(
4073
4079
  name: toModelName(entry.name, reference?.name ?? defaults.name),
4074
4080
  reasoning,
4075
4081
  ...(thinking ? { thinking } : {}),
4082
+ // Advertised `input_modalities` are authoritative, mirroring the
4083
+ // effort vocabulary above: a wire that names its modalities (even
4084
+ // text-only) must not regrow `image` from the bundled reference.
4085
+ // Only when the wire omits them do `supports_vision` and the
4086
+ // reference get a vote.
4076
4087
  input:
4077
- modalities.includes("image") || entry.supports_vision === true || referenceSupportsImage
4078
- ? ["text", "image"]
4079
- : ["text"],
4088
+ modalities.length > 0
4089
+ ? modalities.includes("image")
4090
+ ? ["text", "image"]
4091
+ : ["text"]
4092
+ : entry.supports_vision === true || referenceSupportsImage
4093
+ ? ["text", "image"]
4094
+ : ["text"],
4080
4095
  // A present `supported_features` list (even empty) is the route's
4081
4096
  // whole advertised surface: no `tools` entry means no tool
4082
4097
  // support. The reference still wins when it already vouched for
@@ -4145,6 +4160,11 @@ export interface BasetenModelManagerConfig {
4145
4160
  fetch?: FetchImpl;
4146
4161
  }
4147
4162
 
4163
+ // A previous version of OMP shipped this model without reasoning levels. We've
4164
+ // since fixed that. This const lets us bust the cache so that users on that
4165
+ // version of OMP pick up the reasoning levels immediately.
4166
+ const BASETEN_CACHE_MIGRATION_MODEL_IDS = ["zai-org/GLM-5.3", "zai-org/GLM-5.3-Flash"] as const;
4167
+
4148
4168
  export function basetenModelManagerOptions(
4149
4169
  config?: BasetenModelManagerConfig,
4150
4170
  ): ModelManagerOptions<"openai-completions"> {
@@ -4155,6 +4175,7 @@ export function basetenModelManagerOptions(
4155
4175
  config,
4156
4176
  dynamicModelsAuthoritative: true,
4157
4177
  requireApiKey: true,
4178
+ dropCachedModelIdsOnStaticMismatch: BASETEN_CACHE_MIGRATION_MODEL_IDS,
4158
4179
  mapModel: (entry, defaults, reference) => {
4159
4180
  const raw = entry as Record<string, unknown> & {
4160
4181
  supported_features?: unknown;
@@ -4170,10 +4191,9 @@ export function basetenModelManagerOptions(
4170
4191
  // vocabulary, which OMP must not guess.
4171
4192
  const isSupportedBasetenReasoningModel =
4172
4193
  isKimiK3ModelId(defaults.id) ||
4194
+ isGlm52ReasoningEffortModelId(defaults.id) ||
4173
4195
  defaults.id === "openai/gpt-oss-120b" ||
4174
- defaults.id === "deepseek-ai/DeepSeek-V4-Pro" ||
4175
- defaults.id === "zai-org/GLM-5.2" ||
4176
- defaults.id === "zai-org/GLM-5.2-Fast";
4196
+ defaults.id === "deepseek-ai/DeepSeek-V4-Pro";
4177
4197
  const reasoning =
4178
4198
  isSupportedBasetenReasoningModel &&
4179
4199
  (features.includes("reasoning") || features.includes("reasoning_effort"));
@@ -6758,6 +6778,15 @@ const MODELS_DEV_PROVIDER_DESCRIPTORS_SPECIALIZED: readonly ModelsDevProviderDes
6758
6778
  "cloudflare-ai-gateway",
6759
6779
  "https://gateway.ai.cloudflare.com/v1/<account>/<gateway>/anthropic",
6760
6780
  ),
6781
+ openAiCompletionsDescriptor(
6782
+ "cloudflare-workers-ai",
6783
+ "cloudflare-ai-gateway",
6784
+ CLOUDFLARE_AI_GATEWAY_COMPAT_BASE_URL,
6785
+ {
6786
+ filterModel: filterActiveToolCallModels,
6787
+ transformModel: model => ({ ...model, id: `workers-ai/${model.id}` }),
6788
+ },
6789
+ ),
6761
6790
  // --- Mistral ---
6762
6791
  openAiCompletionsDescriptor("mistral", "mistral", "https://api.mistral.ai/v1"),
6763
6792
  // --- OpenCode Zen / Go ---