{"record":{"id":"f0e54c9633ecae91","repo":"earendil-works/pi","slug":"stream","errorCode":"stream","errorMessage":"Provider ${input.id} has no API implementation for \"${model.api}\"","messagePattern":"Provider (.+?) has no API implementation for \"(.+?)\"","errorType":"exception","errorClass":"ModelsError","httpStatus":null,"severity":"error","filePath":"packages/ai/src/models.ts","lineNumber":788,"sourceCode":"\t\t\tif (index >= 0) merged[index] = model;\n\t\t\telse merged.push(model);\n\t\t}\n\t\treturn merged;\n\t};\n\tconst single =\n\t\ttypeof (input.api as ProviderStreams).stream === \"function\" ? (input.api as ProviderStreams) : undefined;\n\tconst byApi = single ? undefined : (input.api as Partial<Record<string, ProviderStreams>>);\n\n\tconst apiFor = (model: Model<Api>): ProviderStreams | undefined => single ?? byApi?.[model.api];\n\n\tconst dispatch = (\n\t\tmodel: Model<Api>,\n\t\trun: (streams: ProviderStreams) => AssistantMessageEventStream,\n\t): AssistantMessageEventStream => {\n\t\tconst streams = apiFor(model);\n\t\tif (!streams) {\n\t\t\treturn lazyStream(model, async () => {\n\t\t\t\tthrow new ModelsError(\"stream\", `Provider ${input.id} has no API implementation for \"${model.api}\"`);\n\t\t\t});\n\t\t}\n\t\treturn run(streams);\n\t};\n\n\tconst provider: Provider<TApi> = {\n\t\tid: input.id,\n\t\tname: input.name ?? input.id,\n\t\tbaseUrl: input.baseUrl,\n\t\theaders: input.headers,\n\t\tauth: input.auth,\n\t\tgetModels: currentModels,\n\t\trefreshModels: fetchModels\n\t\t\t? async (context) => {\n\t\t\t\t\tif (context.stored) {\n\t\t\t\t\t\tconst restored = context.stored.models\n\t\t\t\t\t\t\t.filter((model) => model.provider === input.id)\n\t\t\t\t\t\t\t.map((model) => model as Model<TApi>);","sourceCodeStart":770,"sourceCodeEnd":806,"githubUrl":"https://github.com/earendil-works/pi/blob/4af9d21d3b4d664e4a29fcabfec85171077248e3/packages/ai/src/models.ts#L770-L806","documentation":"Dispatch guard in the Models stream wiring: the registered provider has no stream implementation for the specific model's api (the byApi record lacks that key and no single stream exists), so requests for that model cannot be routed.","triggerScenarios":"Thrown at packages/ai/src/models.ts:788 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose a model.api the provider implements, or register an implementation for that api."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4af9d21d3b4d664e4a29fcabfec85171077248e3","analyzedAt":"2026-08-24T13:07:14.692Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}