microsoft/vscode · error · Error

Failed to fetch models from Ollama. Please ensure Ollama is

Error message

Failed to fetch models from Ollama. Please ensure Ollama is running. If ollama is on another host, please configure the `"github.copilot.chat.byok.ollamaEndpoint"` setting.

What it means

Error "Failed to fetch models from Ollama. Please ensure Ollama is running. If ollama is on another host, please configure the `"github.copilot.chat.byok.ollamaEndpoint"` setting." thrown in microsoft/vscode.

Source

Thrown at extensions/copilot/src/extension/byok/vscode-node/ollamaProvider.ts:133

					maxInputTokens: modelInfo.capabilities.limits?.max_prompt_tokens ?? 4096,
					maxOutputTokens: modelInfo.capabilities.limits?.max_output_tokens ?? 4096,
					name: modelInfo.name,
					toolCalling: !!modelInfo.capabilities.supports.tool_calls,
					vision: !!modelInfo.capabilities.supports.vision
				};
			}

			return byokKnownModelsToAPIInfoWithEffort(this._name, this._knownModels).map(model => ({
				...model,
				url: ollamaBaseUrl
			}));

		} catch (e) {
			// Check if this is our version check error and preserve it
			if (e instanceof Error && e.message.includes('Ollama server version')) {
				throw e;
			}
			throw new Error('Failed to fetch models from Ollama. Please ensure Ollama is running. If ollama is on another host, please configure the `"github.copilot.chat.byok.ollamaEndpoint"` setting.');
		}
	}

	protected override getModelsBaseUrl(configuration: OllamaConfig | undefined): string {
		return configuration?.url ?? 'http://localhost:11434';
	}

	protected override async createOpenAIEndPoint(model: OpenAICompatibleLanguageModelChatInformation<OllamaConfig>): Promise<OpenAIEndpoint> {
		const modelInfo = this.getModelInfo(model.id, model.url);
		const url = `${model.url}/v1/chat/completions`;
		return this._instantiationService.createInstance(OpenAIEndpoint, modelInfo, model.configuration?.apiKey ?? '', url);
	}

	private async _getOllamaModelInfo(ollamaBaseUrl: string, modelId: string): Promise<IChatModelInformation> {
		const modelInfo = await this._fetchOllamaModelInformation(ollamaBaseUrl, modelId);
		const contextWindow = modelInfo?.model_info?.[`${modelInfo.model_info['general.architecture']}.context_length`] ?? 32768;
		const outputTokens = contextWindow < 4096 ? Math.floor(contextWindow / 2) : 4096;
		const modelCapabilities = {

View on GitHub (pinned to a94b963a32)

When it happens

Trigger: Thrown at extensions/copilot/src/extension/byok/vscode-node/ollamaProvider.ts:133 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of microsoft/vscode@a94b963a32 (2026-08-12). Data as JSON: /api/errors/b7aee238f5f25196. Report an issue: GitHub.