{"record":{"id":"8076a20746b87e8d","repo":"continuedev/continue","slug":"asksage-does-not-support-fim","errorCode":null,"errorMessage":"AskSage does not support FIM","messagePattern":"AskSage does not support FIM","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/openai-adapters/src/apis/AskSage.ts","lineNumber":485,"sourceCode":"  completionNonStream(\n    _body: CompletionCreateParamsNonStreaming,\n    _signal: AbortSignal,\n  ): Promise<Completion> {\n    throw new Error(\"AskSage does not support legacy completions API\");\n  }\n\n  completionStream(\n    _body: CompletionCreateParamsStreaming,\n    _signal: AbortSignal,\n  ): AsyncGenerator<Completion> {\n    throw new Error(\"AskSage does not support legacy completions API\");\n  }\n\n  fimStream(\n    _body: FimCreateParamsStreaming,\n    _signal: AbortSignal,\n  ): AsyncGenerator<ChatCompletionChunk> {\n    throw new Error(\"AskSage does not support FIM\");\n  }\n\n  async embed(_body: EmbeddingCreateParams): Promise<CreateEmbeddingResponse> {\n    throw new Error(\"AskSage does not support embeddings\");\n  }\n\n  async rerank(_body: RerankCreateParams): Promise<CreateRerankResponse> {\n    throw new Error(\"AskSage does not support reranking\");\n  }\n\n  async list(): Promise<Model[]> {\n    // AskSage has a /get-models endpoint, but it requires authentication\n    // For now, return empty array - models are typically configured explicitly\n    return [];\n  }\n}\n","sourceCodeStart":467,"sourceCodeEnd":502,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/packages/openai-adapters/src/apis/AskSage.ts#L467-L502","documentation":"AskSage's API does not expose a fill-in-the-middle (FIM / code-completion) endpoint, so the AskSage adapter's fimStream method is a stub that always throws. This mirrors the OpenAI-compatible LLM API interface used across the openai-adapters package, where every provider must declare which capabilities it supports. Calling FIM on a provider that lacks it fails fast with an explicit message rather than an opaque upstream 404.","triggerScenarios":"Calling fimStream() (or a client library that routes code-completion requests to it) on a model configured with the AskSage provider, e.g. config.provider === 'asksage' with any FimCreateParamsStreaming body.","commonSituations":"Copying a configuration from another provider (e.g. Continue's tab-autocomplete setup tuned for a FIM-capable provider) and only swapping the base URL/apiKey to AskSage; enabling code autocomplete in an editor plugin backed by AskSage.","solutions":["Switch the FIM/autocomplete model to a provider that supports code completion (e.g. codestral, openai, ollama, deepseek) and keep AskSage only for chat roles","Disable tab-autocomplete / FIM features when the chat provider is AskSage","Request or await native FIM support in AskSage before routing such requests there"],"exampleFix":"// before\nconst provider = new AskSageApi(config);\nfor await (const c of provider.fimStream(fimBody, signal)) { ... }\n\n// after\nconst provider = new CodestralApi(config); // FIM-capable provider\nfor await (const c of provider.fimStream(fimBody, signal)) { ... }","handlingStrategy":"fallback","validationCode":"const supportsFim = (p) => typeof p.fimStream === 'function' && p.constructor.name !== 'AskSageApi';\n// better: consult your provider registry's capabilities table before routing FIM","typeGuard":"const isFimCapable = (api: BaseLlmApi): boolean =>\n  Object.getPrototypeOf(api).fimStream !== AskSageApi.prototype.fimStream;","tryCatchPattern":"try {\n  for await (const c of api.fimStream(body, signal)) { yield c; }\n} catch (e) {\n  if (e instanceof Error && e.message.includes('does not support FIM')) {\n    // degrade: disable autocomplete or switch provider\n  } else throw e;\n}","preventionTips":["Keep a per-provider capability map (chat/fim/embed/rerank) and route requests by capability","Separate chat and autocomplete model roles in config instead of one provider for everything"],"tags":["asksage","fim","unsupported-feature","autocomplete"],"backgroundTag":"unsupported-capability","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}