@oh-my-pi/pi-catalog 15.10.11

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.
Files changed (90) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/dist/types/build.d.ts +3 -0
  3. package/dist/types/compat/anthropic.d.ts +11 -0
  4. package/dist/types/compat/apply.d.ts +7 -0
  5. package/dist/types/compat/openai.d.ts +21 -0
  6. package/dist/types/discovery/antigravity.d.ts +61 -0
  7. package/dist/types/discovery/codex.d.ts +38 -0
  8. package/dist/types/discovery/cursor-gen/agent_pb.d.ts +13022 -0
  9. package/dist/types/discovery/cursor.d.ts +23 -0
  10. package/dist/types/discovery/gemini.d.ts +25 -0
  11. package/dist/types/discovery/index.d.ts +4 -0
  12. package/dist/types/discovery/openai-compatible.d.ts +72 -0
  13. package/dist/types/effort.d.ts +9 -0
  14. package/dist/types/fireworks-model-id.d.ts +10 -0
  15. package/dist/types/hosts.d.ts +128 -0
  16. package/dist/types/identity/bundled.d.ts +6 -0
  17. package/dist/types/identity/classify.d.ts +45 -0
  18. package/dist/types/identity/equivalence.d.ts +46 -0
  19. package/dist/types/identity/family.d.ts +45 -0
  20. package/dist/types/identity/id.d.ts +12 -0
  21. package/dist/types/identity/index.d.ts +9 -0
  22. package/dist/types/identity/markers.d.ts +4 -0
  23. package/dist/types/identity/priority.d.ts +1 -0
  24. package/dist/types/identity/reference.d.ts +22 -0
  25. package/dist/types/identity/selection.d.ts +20 -0
  26. package/dist/types/index.d.ts +15 -0
  27. package/dist/types/model-cache.d.ts +17 -0
  28. package/dist/types/model-manager.d.ts +64 -0
  29. package/dist/types/model-thinking.d.ts +67 -0
  30. package/dist/types/models.d.ts +12 -0
  31. package/dist/types/provider-models/bundled-references.d.ts +11 -0
  32. package/dist/types/provider-models/descriptor-types.d.ts +74 -0
  33. package/dist/types/provider-models/descriptors.d.ts +384 -0
  34. package/dist/types/provider-models/discovery-constants.d.ts +11 -0
  35. package/dist/types/provider-models/google.d.ts +27 -0
  36. package/dist/types/provider-models/index.d.ts +6 -0
  37. package/dist/types/provider-models/ollama.d.ts +9 -0
  38. package/dist/types/provider-models/openai-compat.d.ts +385 -0
  39. package/dist/types/provider-models/special.d.ts +16 -0
  40. package/dist/types/types.d.ts +405 -0
  41. package/dist/types/utils.d.ts +5 -0
  42. package/dist/types/wire/codex.d.ts +26 -0
  43. package/dist/types/wire/gemini-headers.d.ts +18 -0
  44. package/dist/types/wire/github-copilot.d.ts +18 -0
  45. package/package.json +100 -0
  46. package/src/build.ts +40 -0
  47. package/src/compat/anthropic.ts +67 -0
  48. package/src/compat/apply.ts +15 -0
  49. package/src/compat/openai.ts +365 -0
  50. package/src/discovery/antigravity.ts +261 -0
  51. package/src/discovery/codex.ts +371 -0
  52. package/src/discovery/cursor-gen/agent_pb.ts +15274 -0
  53. package/src/discovery/cursor.ts +307 -0
  54. package/src/discovery/gemini.ts +249 -0
  55. package/src/discovery/index.ts +4 -0
  56. package/src/discovery/openai-compatible.ts +224 -0
  57. package/src/effort.ts +16 -0
  58. package/src/fireworks-model-id.ts +30 -0
  59. package/src/hosts.ts +114 -0
  60. package/src/identity/bundled.ts +38 -0
  61. package/src/identity/classify.ts +141 -0
  62. package/src/identity/equivalence.ts +870 -0
  63. package/src/identity/family.ts +88 -0
  64. package/src/identity/id.ts +81 -0
  65. package/src/identity/index.ts +9 -0
  66. package/src/identity/markers.ts +49 -0
  67. package/src/identity/priority.ts +56 -0
  68. package/src/identity/reference.ts +134 -0
  69. package/src/identity/selection.ts +65 -0
  70. package/src/index.ts +15 -0
  71. package/src/model-cache.ts +132 -0
  72. package/src/model-manager.ts +472 -0
  73. package/src/model-thinking.ts +407 -0
  74. package/src/models.json +75308 -0
  75. package/src/models.json.d.ts +9 -0
  76. package/src/models.ts +64 -0
  77. package/src/provider-models/bundled-references.ts +54 -0
  78. package/src/provider-models/descriptor-types.ts +79 -0
  79. package/src/provider-models/descriptors.ts +456 -0
  80. package/src/provider-models/discovery-constants.ts +11 -0
  81. package/src/provider-models/google.ts +105 -0
  82. package/src/provider-models/index.ts +6 -0
  83. package/src/provider-models/ollama.ts +154 -0
  84. package/src/provider-models/openai-compat.ts +3106 -0
  85. package/src/provider-models/special.ts +67 -0
  86. package/src/types.ts +470 -0
  87. package/src/utils.ts +27 -0
  88. package/src/wire/codex.ts +43 -0
  89. package/src/wire/gemini-headers.ts +41 -0
  90. package/src/wire/github-copilot.ts +72 -0
@@ -0,0 +1,67 @@
1
+ /**
2
+ * Thinking metadata: build-time derivation and runtime field-read helpers.
3
+ *
4
+ * Derivation (`resolveModelThinking`) runs exactly once per model — from
5
+ * `buildModel` for dynamic specs and from the catalog generator for bundled
6
+ * entries. Everything below the "runtime helpers" divider reads baked fields
7
+ * only: no id parsing, no host matching, no compat detection per request.
8
+ */
9
+ import { Effort } from "./effort";
10
+ import type { Api, CompatOf, Model, ModelSpec, ThinkingConfig } from "./types";
11
+ /**
12
+ * Runtime helpers read baked metadata only, so they accept both pre-build
13
+ * specs and built models.
14
+ */
15
+ type ApiModel<TApi extends Api = Api> = ModelSpec<TApi> | Model<TApi>;
16
+ /**
17
+ * Effort → wire-value map for the 5-tier adaptive scale (Opus 4.7+ and
18
+ * Fable/Mythos 5 on the Messages API). User-facing efforts shift up one notch
19
+ * so the top tier reaches the genuine "max" and "high" lands on Anthropic's
20
+ * recommended "xhigh" coding/agentic default.
21
+ */
22
+ export declare const ANTHROPIC_ADAPTIVE_EFFORT_MAP_5_TIER: Readonly<Partial<Record<Effort, string>>>;
23
+ /**
24
+ * Effort → wire-value map for the legacy 4-tier adaptive scale (Opus 4.6,
25
+ * Sonnet 4.6+, and every adaptive model on Bedrock Converse). `low..high` pass
26
+ * through verbatim; there is no real "xhigh", so it aliases the top "max" tier.
27
+ */
28
+ export declare const ANTHROPIC_ADAPTIVE_EFFORT_MAP_4_TIER: Readonly<Partial<Record<Effort, string>>>;
29
+ /**
30
+ * Resolve the canonical thinking metadata for a spec. Called exactly once per
31
+ * model by `buildModel`, after compat resolution.
32
+ *
33
+ * - Non-reasoning models never carry thinking.
34
+ * - Models that reason natively but reject the wire effort param
35
+ * (`compat.supportsReasoningEffort: false` on openai-responses*) carry no
36
+ * thinking either: `reasoning: true, thinking: undefined` IS the encoding
37
+ * for "thinks, but exposes no control surface".
38
+ * - Explicit spec thinking (generator-baked or user-authored) owns the
39
+ * capability surface (`mode`, `efforts`, `defaultLevel`); the wire facts
40
+ * (`effortMap`, `supportsDisplay`) are backfilled from identity when not
41
+ * explicitly set, so configs never need to know Anthropic's tier tables.
42
+ * - Sparse specs go through full inference.
43
+ */
44
+ export declare function resolveModelThinking<TApi extends Api>(spec: ModelSpec<TApi>, compat: CompatOf<TApi>): ThinkingConfig | undefined;
45
+ /** Derive thinking from identity + resolved compat, ignoring any baked value. Generator-side entry. */
46
+ export declare function deriveThinking<TApi extends Api>(spec: ModelSpec<TApi>, compat: CompatOf<TApi>): ThinkingConfig;
47
+ /**
48
+ * Returns the supported thinking efforts declared on the model metadata.
49
+ * Empty for non-reasoning models and for reasoning models without a
50
+ * controllable effort surface (`thinking: undefined`).
51
+ */
52
+ export declare function getSupportedEfforts<TApi extends Api>(model: ApiModel<TApi>): readonly Effort[];
53
+ /**
54
+ * Clamps a requested thinking level against explicit model metadata.
55
+ *
56
+ * Non-reasoning models always resolve to `undefined`.
57
+ */
58
+ export declare function clampThinkingLevelForModel<TApi extends Api>(model: ApiModel<TApi> | undefined, requested: Effort | undefined): Effort | undefined;
59
+ export declare function requireSupportedEffort<TApi extends Api>(model: ApiModel<TApi>, effort: Effort): Effort;
60
+ /** Maps a normalized thinking effort to Google's `thinkingLevel` enum values. */
61
+ export declare function mapEffortToGoogleThinkingLevel(effort: Effort): "MINIMAL" | "LOW" | "MEDIUM" | "HIGH";
62
+ /**
63
+ * Maps a normalized thinking effort to Anthropic adaptive effort values via
64
+ * the model's baked `thinking.effortMap` (identity for unmapped efforts).
65
+ */
66
+ export declare function mapEffortToAnthropicAdaptiveEffort<TApi extends Api>(model: ApiModel<TApi>, effort: Effort): "low" | "medium" | "high" | "xhigh" | "max";
67
+ export {};
@@ -0,0 +1,12 @@
1
+ import MODELS from "./models.json";
2
+ import type { Api, KnownProvider, Model, Usage } from "./types";
3
+ export type GeneratedProvider = keyof typeof MODELS;
4
+ export declare function getBundledModel<TApi extends Api = Api>(provider: GeneratedProvider, modelId: string): Model<TApi>;
5
+ export declare function getBundledProviders(): KnownProvider[];
6
+ export declare function getBundledModels(provider: GeneratedProvider): Model<Api>[];
7
+ export declare function calculateCost<TApi extends Api>(model: Model<TApi>, usage: Usage): Usage["cost"];
8
+ /**
9
+ * Check if two models are equal by comparing both their id and provider.
10
+ * Returns false if either model is null or undefined.
11
+ */
12
+ export declare function modelsAreEqual<TApi extends Api>(a: Model<TApi> | null | undefined, b: Model<TApi> | null | undefined): boolean;
@@ -0,0 +1,11 @@
1
+ import { getBundledModels } from "../models";
2
+ import type { Api, Model, ModelSpec } from "../types";
3
+ /**
4
+ * Project a built `Model` back to spec stage: `compat` becomes the verbatim
5
+ * sparse override record (`compatConfig`), never the resolved view. Discovery
6
+ * mappers spread these references into the specs they hand to the model
7
+ * manager, which rebuilds via `buildModel`.
8
+ */
9
+ export declare function toModelSpec<TApi extends Api>(model: Model<TApi>): ModelSpec<TApi>;
10
+ export declare function createBundledReferenceMap<TApi extends Api>(provider: Parameters<typeof getBundledModels>[0]): Map<string, ModelSpec<TApi>>;
11
+ export declare function createReferenceResolver<TApi extends Api>(providerRefs: Map<string, ModelSpec<TApi>>): (modelId: string) => ModelSpec<TApi> | undefined;
@@ -0,0 +1,74 @@
1
+ import type { ModelManagerOptions } from "../model-manager";
2
+ import type { Api, FetchImpl } from "../types";
3
+ /** Config passed to a provider's runtime model-manager factory. */
4
+ export type ModelManagerConfig = {
5
+ apiKey?: string;
6
+ baseUrl?: string;
7
+ fetch?: FetchImpl;
8
+ };
9
+ /** Catalog discovery configuration for providers that support endpoint-based model listing. */
10
+ export interface CatalogDiscoveryConfig {
11
+ /** Human-readable name for log messages. */
12
+ label: string;
13
+ /**
14
+ * Environment variables to check for API keys during catalog generation.
15
+ * Defaults to the entry-level `envVars` when omitted.
16
+ */
17
+ envVars?: readonly string[];
18
+ /** OAuth provider for credential refresh during catalog generation. */
19
+ oauthProvider?: string;
20
+ /** When true, catalog discovery proceeds even without credentials. */
21
+ allowUnauthenticated?: boolean;
22
+ }
23
+ /** Unified provider descriptor used by both runtime discovery and catalog generation. */
24
+ export interface ProviderDescriptor {
25
+ providerId: string;
26
+ createModelManagerOptions(config: ModelManagerConfig): ModelManagerOptions<Api>;
27
+ /** Preferred model ID when no explicit selection is made. */
28
+ defaultModel: string;
29
+ /** When true, the runtime creates a model manager even without a valid API key (e.g. ollama). */
30
+ allowUnauthenticated?: boolean;
31
+ /** When true, successful runtime discovery replaces bundled provider models instead of merging fallback-only IDs. */
32
+ dynamicModelsAuthoritative?: boolean;
33
+ /** Catalog discovery configuration. Only providers with this field participate in generate-models.ts. */
34
+ catalogDiscovery?: CatalogDiscoveryConfig;
35
+ }
36
+ /** A provider descriptor that has catalog discovery configured. */
37
+ export type CatalogProviderDescriptor = ProviderDescriptor & {
38
+ catalogDiscovery: CatalogDiscoveryConfig;
39
+ };
40
+ /** Type guard for descriptors with catalog discovery. */
41
+ export declare function isCatalogDescriptor(d: ProviderDescriptor): d is CatalogProviderDescriptor;
42
+ /** Whether catalog discovery may run without provider credentials. */
43
+ export declare function allowsUnauthenticatedCatalogDiscovery(descriptor: CatalogProviderDescriptor): boolean;
44
+ /**
45
+ * One model provider's catalog-side description. The auth half of a provider
46
+ * (env keys, OAuth login/refresh flows) lives in `@oh-my-pi/pi-ai`'s registry;
47
+ * the catalog table below is the single source of truth for ids, default
48
+ * models, and discovery wiring.
49
+ *
50
+ * - Every entry is a member of `KnownProvider`.
51
+ * - `createModelManagerOptions` present (and not `specialModelManager`) ⇒
52
+ * appears in `PROVIDER_DESCRIPTORS` for runtime model discovery.
53
+ * - `catalogDiscovery` present ⇒ participates in `generate-models.ts`.
54
+ */
55
+ export interface ProviderCatalogEntry {
56
+ readonly id: string;
57
+ /** Preferred model ID when no explicit selection is made. */
58
+ readonly defaultModel: string;
59
+ /** Environment variables consulted (in order) for the provider's runtime API-key env fallback. */
60
+ readonly envVars?: readonly string[];
61
+ /** Runtime model-manager factory. Omitted for catalog-only providers. */
62
+ readonly createModelManagerOptions?: (config: ModelManagerConfig) => ModelManagerOptions<Api>;
63
+ /** When true, the runtime creates a model manager even without a valid API key. */
64
+ readonly allowUnauthenticated?: boolean;
65
+ /** When true, successful runtime discovery replaces bundled provider models. */
66
+ readonly dynamicModelsAuthoritative?: boolean;
67
+ /** Catalog discovery configuration for generate-models.ts. */
68
+ readonly catalogDiscovery?: CatalogDiscoveryConfig;
69
+ /**
70
+ * Built bespoke by the coding-agent runtime (OAuth-token-driven managers);
71
+ * excluded from `PROVIDER_DESCRIPTORS` even though models are discoverable.
72
+ */
73
+ readonly specialModelManager?: boolean;
74
+ }
@@ -0,0 +1,384 @@
1
+ /**
2
+ * The provider catalog table: one entry per chat-model provider, carrying the
3
+ * catalog half of what used to live in `@oh-my-pi/pi-ai`'s registry definitions
4
+ * (default model, runtime model-manager factory, discovery wiring). The auth
5
+ * half (env keys, OAuth login/refresh) stays in the pi-ai registry, which
6
+ * type-checks itself against `KnownProvider` from this table.
7
+ */
8
+ import type { ModelManagerConfig, ProviderCatalogEntry, ProviderDescriptor } from "./descriptor-types";
9
+ export declare const CATALOG_PROVIDERS: readonly [{
10
+ readonly id: "aimlapi";
11
+ readonly defaultModel: "gpt-4o";
12
+ readonly envVars: readonly ["AIMLAPI_API_KEY"];
13
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
14
+ readonly dynamicModelsAuthoritative: true;
15
+ readonly catalogDiscovery: {
16
+ readonly label: "AIML API";
17
+ };
18
+ }, {
19
+ readonly id: "alibaba-coding-plan";
20
+ readonly defaultModel: "qwen3.5-plus";
21
+ readonly envVars: readonly ["ALIBABA_CODING_PLAN_API_KEY"];
22
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
23
+ readonly catalogDiscovery: {
24
+ readonly label: "Alibaba Coding Plan";
25
+ };
26
+ }, {
27
+ readonly id: "amazon-bedrock";
28
+ readonly defaultModel: "us.anthropic.claude-opus-4-6-v1";
29
+ }, {
30
+ readonly id: "anthropic";
31
+ readonly defaultModel: "claude-opus-4-6";
32
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"anthropic-messages", unknown>;
33
+ }, {
34
+ readonly id: "cerebras";
35
+ readonly defaultModel: "zai-glm-4.6";
36
+ readonly envVars: readonly ["CEREBRAS_API_KEY"];
37
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
38
+ readonly catalogDiscovery: {
39
+ readonly label: "Cerebras";
40
+ };
41
+ }, {
42
+ readonly id: "cloudflare-ai-gateway";
43
+ readonly defaultModel: "claude-sonnet-4-5";
44
+ readonly envVars: readonly ["CLOUDFLARE_AI_GATEWAY_API_KEY"];
45
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"anthropic-messages", unknown>;
46
+ readonly catalogDiscovery: {
47
+ readonly label: "Cloudflare AI Gateway";
48
+ };
49
+ }, {
50
+ readonly id: "cursor";
51
+ readonly defaultModel: "claude-sonnet-4-6";
52
+ readonly envVars: readonly ["CURSOR_ACCESS_TOKEN"];
53
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"cursor-agent", unknown>;
54
+ readonly catalogDiscovery: {
55
+ readonly label: "Cursor";
56
+ readonly envVars: readonly ["CURSOR_API_KEY"];
57
+ readonly oauthProvider: "cursor";
58
+ };
59
+ }, {
60
+ readonly id: "deepseek";
61
+ readonly defaultModel: "deepseek-v4-pro";
62
+ readonly envVars: readonly ["DEEPSEEK_API_KEY"];
63
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
64
+ readonly catalogDiscovery: {
65
+ readonly label: "DeepSeek";
66
+ };
67
+ }, {
68
+ readonly id: "firepass";
69
+ readonly defaultModel: "kimi-k2.6-turbo";
70
+ readonly envVars: readonly ["FIREPASS_API_KEY"];
71
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
72
+ }, {
73
+ readonly id: "fireworks";
74
+ readonly defaultModel: "kimi-k2.6";
75
+ readonly envVars: readonly ["FIREWORKS_API_KEY"];
76
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
77
+ readonly catalogDiscovery: {
78
+ readonly label: "Fireworks";
79
+ };
80
+ }, {
81
+ readonly id: "github-copilot";
82
+ readonly defaultModel: "gpt-4o";
83
+ readonly envVars: readonly ["COPILOT_GITHUB_TOKEN"];
84
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<import("..").Api, unknown>;
85
+ }, {
86
+ readonly id: "gitlab-duo";
87
+ readonly defaultModel: "duo-chat-sonnet-4-5";
88
+ readonly envVars: readonly ["GITLAB_TOKEN"];
89
+ }, {
90
+ readonly id: "google";
91
+ readonly defaultModel: "gemini-2.5-pro";
92
+ readonly envVars: readonly ["GEMINI_API_KEY"];
93
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"google-generative-ai", unknown>;
94
+ }, {
95
+ readonly id: "google-antigravity";
96
+ readonly defaultModel: "gemini-3-pro-high";
97
+ readonly specialModelManager: true;
98
+ }, {
99
+ readonly id: "google-gemini-cli";
100
+ readonly defaultModel: "gemini-2.5-pro";
101
+ readonly specialModelManager: true;
102
+ }, {
103
+ readonly id: "google-vertex";
104
+ readonly defaultModel: "gemini-3-pro-preview";
105
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<import("..").Api, unknown>;
106
+ readonly allowUnauthenticated: true;
107
+ }, {
108
+ readonly id: "groq";
109
+ readonly defaultModel: "openai/gpt-oss-120b";
110
+ readonly envVars: readonly ["GROQ_API_KEY"];
111
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
112
+ }, {
113
+ readonly id: "huggingface";
114
+ readonly defaultModel: "deepseek-ai/DeepSeek-R1";
115
+ readonly envVars: readonly ["HUGGINGFACE_HUB_TOKEN", "HF_TOKEN"];
116
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
117
+ readonly catalogDiscovery: {
118
+ readonly label: "Hugging Face";
119
+ };
120
+ }, {
121
+ readonly id: "kilo";
122
+ readonly defaultModel: "anthropic/claude-sonnet-4.5";
123
+ readonly envVars: readonly ["KILO_API_KEY"];
124
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
125
+ readonly catalogDiscovery: {
126
+ readonly label: "Kilo Gateway";
127
+ readonly allowUnauthenticated: true;
128
+ };
129
+ }, {
130
+ readonly id: "kimi-code";
131
+ readonly defaultModel: "kimi-k2.5";
132
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
133
+ readonly catalogDiscovery: {
134
+ readonly label: "Kimi Code";
135
+ readonly envVars: readonly ["KIMI_API_KEY"];
136
+ };
137
+ }, {
138
+ readonly id: "litellm";
139
+ readonly defaultModel: "claude-opus-4-6";
140
+ readonly envVars: readonly ["LITELLM_API_KEY"];
141
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
142
+ readonly catalogDiscovery: {
143
+ readonly label: "LiteLLM";
144
+ readonly allowUnauthenticated: true;
145
+ };
146
+ }, {
147
+ readonly id: "lm-studio";
148
+ readonly defaultModel: "llama-3-8b";
149
+ readonly envVars: readonly ["LM_STUDIO_API_KEY"];
150
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
151
+ readonly allowUnauthenticated: true;
152
+ }, {
153
+ readonly id: "minimax";
154
+ readonly defaultModel: "MiniMax-M2.5";
155
+ readonly envVars: readonly ["MINIMAX_API_KEY"];
156
+ }, {
157
+ readonly id: "minimax-code";
158
+ readonly defaultModel: "MiniMax-M2.5";
159
+ readonly envVars: readonly ["MINIMAX_CODE_API_KEY"];
160
+ }, {
161
+ readonly id: "minimax-code-cn";
162
+ readonly defaultModel: "MiniMax-M2.5";
163
+ readonly envVars: readonly ["MINIMAX_CODE_CN_API_KEY"];
164
+ }, {
165
+ readonly id: "mistral";
166
+ readonly defaultModel: "devstral-medium-latest";
167
+ readonly envVars: readonly ["MISTRAL_API_KEY"];
168
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
169
+ }, {
170
+ readonly id: "moonshot";
171
+ readonly defaultModel: "kimi-k2.5";
172
+ readonly envVars: readonly ["MOONSHOT_API_KEY"];
173
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
174
+ readonly catalogDiscovery: {
175
+ readonly label: "Moonshot";
176
+ };
177
+ }, {
178
+ readonly id: "nanogpt";
179
+ readonly defaultModel: "openai/gpt-5.4";
180
+ readonly envVars: readonly ["NANO_GPT_API_KEY"];
181
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
182
+ readonly catalogDiscovery: {
183
+ readonly label: "NanoGPT";
184
+ };
185
+ }, {
186
+ readonly id: "nvidia";
187
+ readonly defaultModel: "nvidia/llama-3.1-nemotron-70b-instruct";
188
+ readonly envVars: readonly ["NVIDIA_API_KEY"];
189
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
190
+ readonly catalogDiscovery: {
191
+ readonly label: "NVIDIA";
192
+ };
193
+ }, {
194
+ readonly id: "ollama";
195
+ readonly defaultModel: "gpt-oss:20b";
196
+ readonly envVars: readonly ["OLLAMA_API_KEY"];
197
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-responses", unknown>;
198
+ readonly allowUnauthenticated: true;
199
+ }, {
200
+ readonly id: "ollama-cloud";
201
+ readonly defaultModel: "gpt-oss:120b";
202
+ readonly envVars: readonly ["OLLAMA_CLOUD_API_KEY"];
203
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"ollama-chat", unknown>;
204
+ readonly catalogDiscovery: {
205
+ readonly label: "Ollama Cloud";
206
+ readonly oauthProvider: "ollama-cloud";
207
+ };
208
+ }, {
209
+ readonly id: "openai";
210
+ readonly defaultModel: "gpt-5.4";
211
+ readonly envVars: readonly ["OPENAI_API_KEY"];
212
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-responses", unknown>;
213
+ }, {
214
+ readonly id: "openai-codex";
215
+ readonly defaultModel: "gpt-5.4";
216
+ readonly envVars: readonly ["OPENAI_CODEX_OAUTH_TOKEN"];
217
+ readonly specialModelManager: true;
218
+ }, {
219
+ readonly id: "opencode-go";
220
+ readonly defaultModel: "kimi-k2.5";
221
+ readonly envVars: readonly ["OPENCODE_API_KEY"];
222
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<import("..").Api, unknown>;
223
+ }, {
224
+ readonly id: "opencode-zen";
225
+ readonly defaultModel: "claude-sonnet-4-6";
226
+ readonly envVars: readonly ["OPENCODE_API_KEY"];
227
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<import("..").Api, unknown>;
228
+ }, {
229
+ readonly id: "openrouter";
230
+ readonly defaultModel: "openai/gpt-5.4";
231
+ readonly envVars: readonly ["OPENROUTER_API_KEY"];
232
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
233
+ readonly catalogDiscovery: {
234
+ readonly label: "OpenRouter";
235
+ readonly allowUnauthenticated: true;
236
+ };
237
+ }, {
238
+ readonly id: "qianfan";
239
+ readonly defaultModel: "deepseek-v3.2";
240
+ readonly envVars: readonly ["QIANFAN_API_KEY"];
241
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
242
+ readonly catalogDiscovery: {
243
+ readonly label: "Qianfan";
244
+ };
245
+ }, {
246
+ readonly id: "qwen-portal";
247
+ readonly defaultModel: "coder-model";
248
+ readonly envVars: readonly ["QWEN_OAUTH_TOKEN", "QWEN_PORTAL_API_KEY"];
249
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
250
+ readonly catalogDiscovery: {
251
+ readonly label: "Qwen Portal";
252
+ readonly oauthProvider: "qwen-portal";
253
+ };
254
+ }, {
255
+ readonly id: "synthetic";
256
+ readonly defaultModel: "hf:zai-org/GLM-5.1";
257
+ readonly envVars: readonly ["SYNTHETIC_API_KEY"];
258
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
259
+ readonly dynamicModelsAuthoritative: true;
260
+ readonly catalogDiscovery: {
261
+ readonly label: "Synthetic";
262
+ };
263
+ }, {
264
+ readonly id: "together";
265
+ readonly defaultModel: "moonshotai/Kimi-K2.5";
266
+ readonly envVars: readonly ["TOGETHER_API_KEY"];
267
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
268
+ readonly catalogDiscovery: {
269
+ readonly label: "Together";
270
+ };
271
+ }, {
272
+ readonly id: "venice";
273
+ readonly defaultModel: "llama-3.3-70b";
274
+ readonly envVars: readonly ["VENICE_API_KEY"];
275
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
276
+ readonly catalogDiscovery: {
277
+ readonly label: "Venice";
278
+ readonly allowUnauthenticated: true;
279
+ };
280
+ }, {
281
+ readonly id: "vercel-ai-gateway";
282
+ readonly defaultModel: "anthropic/claude-sonnet-4-6";
283
+ readonly envVars: readonly ["AI_GATEWAY_API_KEY"];
284
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"anthropic-messages", unknown>;
285
+ readonly catalogDiscovery: {
286
+ readonly label: "Vercel AI Gateway";
287
+ readonly envVars: readonly ["VERCEL_AI_GATEWAY_API_KEY"];
288
+ readonly allowUnauthenticated: true;
289
+ };
290
+ }, {
291
+ readonly id: "vllm";
292
+ readonly defaultModel: "gpt-oss-20b";
293
+ readonly envVars: readonly ["VLLM_API_KEY"];
294
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
295
+ readonly catalogDiscovery: {
296
+ readonly label: "vLLM";
297
+ readonly allowUnauthenticated: true;
298
+ };
299
+ }, {
300
+ readonly id: "wafer-pass";
301
+ readonly defaultModel: "GLM-5.1";
302
+ readonly envVars: readonly ["WAFER_PASS_API_KEY"];
303
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
304
+ readonly catalogDiscovery: {
305
+ readonly label: "Wafer Pass";
306
+ readonly oauthProvider: "wafer-pass";
307
+ };
308
+ }, {
309
+ readonly id: "wafer-serverless";
310
+ readonly defaultModel: "GLM-5.1";
311
+ readonly envVars: readonly ["WAFER_SERVERLESS_API_KEY"];
312
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
313
+ readonly catalogDiscovery: {
314
+ readonly label: "Wafer Serverless";
315
+ readonly oauthProvider: "wafer-serverless";
316
+ };
317
+ }, {
318
+ readonly id: "xai";
319
+ readonly defaultModel: "grok-4-fast-non-reasoning";
320
+ readonly envVars: readonly ["XAI_API_KEY"];
321
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
322
+ }, {
323
+ readonly id: "xai-oauth";
324
+ readonly defaultModel: "grok-4.3";
325
+ readonly envVars: readonly ["XAI_OAUTH_TOKEN", "XAI_API_KEY"];
326
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-responses", unknown>;
327
+ readonly catalogDiscovery: {
328
+ readonly label: "xAI Grok OAuth (SuperGrok)";
329
+ readonly oauthProvider: "xai-oauth";
330
+ };
331
+ }, {
332
+ readonly id: "xiaomi";
333
+ readonly defaultModel: "mimo-v2-flash";
334
+ readonly envVars: readonly ["XIAOMI_API_KEY"];
335
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
336
+ readonly catalogDiscovery: {
337
+ readonly label: "Xiaomi";
338
+ };
339
+ }, {
340
+ readonly id: "xiaomi-token-plan-ams";
341
+ readonly defaultModel: "mimo-v2.5";
342
+ readonly envVars: readonly ["XIAOMI_TOKEN_PLAN_AMS_API_KEY"];
343
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
344
+ }, {
345
+ readonly id: "xiaomi-token-plan-cn";
346
+ readonly defaultModel: "mimo-v2.5";
347
+ readonly envVars: readonly ["XIAOMI_TOKEN_PLAN_CN_API_KEY"];
348
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
349
+ }, {
350
+ readonly id: "xiaomi-token-plan-sgp";
351
+ readonly defaultModel: "mimo-v2.5";
352
+ readonly envVars: readonly ["XIAOMI_TOKEN_PLAN_SGP_API_KEY"];
353
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
354
+ }, {
355
+ readonly id: "zai";
356
+ readonly defaultModel: "glm-5.1";
357
+ readonly envVars: readonly ["ZAI_API_KEY"];
358
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"anthropic-messages", unknown>;
359
+ readonly catalogDiscovery: {
360
+ readonly label: "zAI";
361
+ };
362
+ }, {
363
+ readonly id: "zenmux";
364
+ readonly defaultModel: "anthropic/claude-opus-4.6";
365
+ readonly envVars: readonly ["ZENMUX_API_KEY"];
366
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<import("..").Api, unknown>;
367
+ readonly catalogDiscovery: {
368
+ readonly label: "ZenMux";
369
+ };
370
+ }, {
371
+ readonly id: "zhipu-coding-plan";
372
+ readonly defaultModel: "glm-5.1";
373
+ readonly envVars: readonly ["ZHIPU_API_KEY"];
374
+ readonly createModelManagerOptions: (config: ModelManagerConfig) => import("..").ModelManagerOptions<"openai-completions", unknown>;
375
+ readonly catalogDiscovery: {
376
+ readonly label: "Zhipu Coding Plan";
377
+ };
378
+ }];
379
+ /** Chat-model providers — every entry in the catalog table. */
380
+ export type KnownProvider = (typeof CATALOG_PROVIDERS)[number]["id"];
381
+ export declare const PROVIDER_DESCRIPTORS: readonly ProviderDescriptor[];
382
+ /** Default model IDs for all known providers, derived from the catalog table. */
383
+ export declare const DEFAULT_MODEL_PER_PROVIDER: Record<KnownProvider, string>;
384
+ export declare function getCatalogProviderEntry(id: string): ProviderCatalogEntry | undefined;
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Fallback context-window / max-output-token values for models discovered
3
+ * without limit metadata.
4
+ *
5
+ * Kept in a dependency-free leaf module (rather than `openai-compat.ts`) so the
6
+ * model-discovery helpers in `utils/discovery/*` can import them without pulling
7
+ * the package root barrel (`@oh-my-pi/pi-ai`) into the model-manager init graph,
8
+ * which would otherwise form an import cycle through the provider registry.
9
+ */
10
+ export declare const UNK_CONTEXT_WINDOW = 222222;
11
+ export declare const UNK_MAX_TOKENS = 8888;
@@ -0,0 +1,27 @@
1
+ import type { ModelManagerOptions } from "../model-manager";
2
+ import type { FetchImpl } from "../types";
3
+ export interface GoogleModelManagerConfig {
4
+ apiKey?: string;
5
+ fetch?: FetchImpl;
6
+ }
7
+ export interface GoogleVertexModelManagerConfig {
8
+ apiKey?: string;
9
+ project?: string;
10
+ location?: string;
11
+ signal?: AbortSignal;
12
+ fetch?: FetchImpl;
13
+ }
14
+ export interface GoogleAntigravityModelManagerConfig {
15
+ oauthToken?: string;
16
+ endpoint?: string;
17
+ fetch?: FetchImpl;
18
+ }
19
+ export interface GoogleGeminiCliModelManagerConfig {
20
+ oauthToken?: string;
21
+ endpoint?: string;
22
+ fetch?: FetchImpl;
23
+ }
24
+ export declare function googleModelManagerOptions(config?: GoogleModelManagerConfig): ModelManagerOptions<"google-generative-ai">;
25
+ export declare function googleVertexModelManagerOptions(_config?: GoogleVertexModelManagerConfig): ModelManagerOptions;
26
+ export declare function googleAntigravityModelManagerOptions(config?: GoogleAntigravityModelManagerConfig): ModelManagerOptions<"google-gemini-cli">;
27
+ export declare function googleGeminiCliModelManagerOptions(config?: GoogleGeminiCliModelManagerConfig): ModelManagerOptions<"google-gemini-cli">;
@@ -0,0 +1,6 @@
1
+ export * from "./descriptor-types";
2
+ export * from "./descriptors";
3
+ export * from "./google";
4
+ export * from "./ollama";
5
+ export * from "./openai-compat";
6
+ export * from "./special";
@@ -0,0 +1,9 @@
1
+ import type { ModelManagerOptions } from "../model-manager";
2
+ import type { FetchImpl } from "../types";
3
+ export interface OllamaCloudModelManagerConfig {
4
+ apiKey?: string;
5
+ baseUrl?: string;
6
+ fetch?: FetchImpl;
7
+ }
8
+ export declare function normalizeOllamaCloudBaseUrl(baseUrl?: string): string;
9
+ export declare function ollamaCloudModelManagerOptions(config?: OllamaCloudModelManagerConfig): ModelManagerOptions<"ollama-chat">;