{"record":{"id":"5b0fe364d5c722f7","repo":"continuedev/continue","slug":"no-api-base-url-provided-please-add-the-apibase","errorCode":null,"errorMessage":"No API base URL provided. Please add the `apiBase` field in your config.json.","messagePattern":"No API base URL provided\\. Please add the `apiBase` field in your config\\.json\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/llm/llms/HuggingFaceInferenceAPI.ts","lineNumber":23,"sourceCode":"class HuggingFaceInferenceAPI extends BaseLLM {\n  static providerName = \"huggingface-inference-api\";\n\n  private _convertArgs(options: CompletionOptions) {\n    return {\n      max_new_tokens: options.maxTokens ?? 1024,\n      temperature: options.temperature,\n      top_k: options.topK,\n      top_p: options.topP,\n    };\n  }\n\n  protected async *_streamComplete(\n    prompt: string,\n    signal: AbortSignal,\n    options: CompletionOptions,\n  ): AsyncGenerator<string> {\n    if (!this.apiBase) {\n      throw new Error(\n        \"No API base URL provided. Please add the `apiBase` field in your config.json.\",\n      );\n    }\n\n    const response = await this.fetch(this.apiBase, {\n      headers: {\n        Authorization: `Bearer ${this.apiKey}`,\n        \"Content-Type\": \"application/json\",\n        Accept: \"application/json\",\n      },\n      method: \"POST\",\n      body: JSON.stringify({\n        inputs: prompt,\n        stream: true,\n        parameters: this._convertArgs(options),\n      }),\n      signal,\n    });","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/core/llm/llms/HuggingFaceInferenceAPI.ts#L5-L41","documentation":"Thrown by HuggingFaceInferenceAPI._streamComplete when the provider has no apiBase configured. Unlike other HuggingFace providers, this one talks to a self-hosted or custom Inference API endpoint, so an explicit base URL is mandatory before any completion request can be made.","triggerScenarios":"Selecting the huggingface-inference-api provider in config.json without an apiBase field, then initiating a chat/autocomplete request that calls _streamComplete.","commonSituations":"Copying an example config that omits apiBase, or assuming the provider uses the public HF endpoint and only setting an API token.","solutions":["Add an apiBase field to the model's config.json entry pointing at your inference endpoint (e.g. https://xxx.endpoints.huggingface.cloud) or local TEI/TGI server","If you meant to use the public HF Inference API, switch provider to a supported one or run your own endpoint","Restart/reload the extension window after editing config.json"],"exampleFix":"// before\n{\n  \"models\": [{\n    \"title\": \"HF\",\n    \"provider\": \"huggingface-inference-api\",\n    \"model\": \"zephyr-7b-beta\",\n    \"apiKey\": \"hf_...\"\n  }]\n}\n// after\n{\n  \"models\": [{\n    \"title\": \"HF\",\n    \"provider\": \"huggingface-inference-api\",\n    \"model\": \"zephyr-7b-beta\",\n    \"apiKey\": \"hf_...\",\n    \"apiBase\": \"https://your-endpoint.endpoints.huggingface.cloud\"\n  }]\n}","handlingStrategy":"validation","validationCode":"const cfg = readConfig();\nif (cfg.provider === 'huggingface-inference-api' && !cfg.apiBase) {\n  failFast('Add apiBase to config.json before using this provider');\n}","typeGuard":"const hasApiBase = (m: Record<string, unknown>): m is Record<string, unknown> & { apiBase: string } =>\n  typeof m.apiBase === 'string' && m.apiBase.length > 0;","tryCatchPattern":"try {\n  for await (const c of llm.streamComplete(prompt, signal)) yield c;\n} catch (e) {\n  if (e instanceof Error && e.message.includes('apiBase')) showConfigWarning();\n  else throw e;\n}","preventionTips":["Lint config.json for required per-provider fields at load time","Document that this provider is self-hosted-endpoint-only"],"tags":["huggingface","config","missing-field","api-base"],"backgroundTag":"missing-config-field","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}