# How to Troubleshoot LLM Connection Issues in Continue: A Complete Guide

> Fix LLM connection issues in Continue with this complete guide. Learn how to troubleshoot errors and configure local runtimes like Ollama and Lemonade effectively.

- Repository: [Continue/continue](https://github.com/continuedev/continue)
- Tags: how-to-guide
- Published: 2026-06-24

---

**Continue automatically routes LLM connection errors through the `handleLLMError` function in [`extensions/vscode/src/util/errorHandling.ts`](https://github.com/continuedev/continue/blob/main/extensions/vscode/src/util/errorHandling.ts), which surfaces actionable UI prompts to download, start, or configure local runtimes like Ollama and Lemonade.**

When working with the `continuedev/continue` VS Code extension, connectivity problems with Large Language Models (LLMs) can interrupt your development workflow. Whether you are using local runtimes such as Ollama and Lemonade or remote APIs like OpenAI and Groq, understanding how to troubleshoot LLM connection issues in Continue will help you resolve failures quickly without leaving your editor.

## Understanding Continue's LLM Error Handling Architecture

Continue implements a centralized error handling system that intercepts connectivity failures and transforms them into user-friendly recovery options. When the LLM client throws an exception, the error bubbles up from the Redux thunk `streamNormalInput` through the UI layer before reaching the dedicated handler.

### The Error Propagation Flow

The journey of a connection error follows a specific path through the codebase:

1. **Request Initiation** – The `constructLlmApi` factory in [`packages/openai-adapters/src/index.ts`](https://github.com/continuedev/continue/blob/main/packages/openai-adapters/src/index.ts) creates a provider-specific client based on your [`config.yaml`](https://github.com/continuedev/continue/blob/main/config.yaml) settings.
2. **Network Failure** – If the target server is unreachable, the HTTP client throws an `Error` containing diagnostic text such as "Ollama may not be installed" or "Lemonade server may not be running".
3. **UI Routing** – The [`webviewProtocol.ts`](https://github.com/continuedev/continue/blob/main/webviewProtocol.ts) file catches the exception and forwards it to `handleLLMError` for processing.

```ts
// extensions/vscode/src/webviewProtocol.ts
import { handleLLMError } from "./util/errorHandling";

try {
  // … LLM request logic …
} catch (e) {
  if (await handleLLMError(e)) {
    // UI already displayed a helpful message – stop further processing
    return;
  }
  // otherwise re‑throw or log generic error
}

```

## Common Connection Issues and Automated Fixes

Continue's error handler recognizes specific failure patterns and presents contextual solutions. Here are the primary scenarios you will encounter when you troubleshoot LLM connection issues in Continue.

### Ollama Not Installed or Running

When the error message contains "Ollama may not be installed", Continue displays a **Download Ollama** button that opens `https://ollama.ai/download` in your default browser. If the message indicates "Ollama may not be running", the UI offers a **Start Ollama** button that executes the `continue.startLocalOllama` VS Code command.

### Missing Models in Ollama

If you request a model that has not been pulled locally, Continue detects the pattern `ollama run {modelName}` in the error text. The handler checks whether the model is already installing via the `isModelInstaller` interface, then prompts you with **Install Model**. Clicking this invokes `continue.installModel`, which runs `ollama pull` for the specific model.

### Lemonade Server Issues

On Windows platforms, when Continue detects "Lemonade server may not be running", it provides **Start Lemonade** and **Setup Instructions** options. The start command triggers `continue.startLocalLemonade`, while the documentation link opens `https://lemonade-server.ai`. On other operating systems, only the setup link appears.

### Remote Provider Failures

For remote APIs such as OpenAI, Groq, or Azure, connection failures typically manifest as HTTP-level errors like `ECONNREFUSED`. These require manual verification of your API keys in [`config.yaml`](https://github.com/continuedev/continue/blob/main/config.yaml), validation of the `apiBase` URL, and inspection of `requestOptions.proxy` settings defined in [`packages/openai-adapters/src/types.ts`](https://github.com/continuedev/continue/blob/main/packages/openai-adapters/src/types.ts).

## Technical Deep Dive: The handleLLMError Implementation

The core logic resides in [`extensions/vscode/src/util/errorHandling.ts`](https://github.com/continuedev/continue/blob/main/extensions/vscode/src/util/errorHandling.ts). This function inspects error messages using string matching, determines the provider context, and returns a boolean indicating whether the error was handled.

```ts
// extensions/vscode/src/util/errorHandling.ts
export async function handleLLMError(error: unknown): Promise<boolean> {
  if (!error || !(error instanceof Error) || !error.message) {
    return false;
  }

  // ---- Lemonade errors -------------------------------------------------
  if (error.message.toLowerCase().includes("lemonade")) {
    let message = error.message;
    let options: string[] | undefined;
    if (process.platform === "win32" &&
        message.includes("Lemonade server may not be running")) {
      options = ["Start Lemonade", "Setup Instructions"];
    } else {
      options = ["Setup Instructions"];
    }
    vscode.window.showErrorMessage(message, ...options).then(val => {
      if (val === "Setup Instructions") {
        vscode.env.openExternal(vscode.Uri.parse("https://lemonade-server.ai"));
      } else if (val === "Start Lemonade") {
        vscode.commands.executeCommand("continue.startLocalLemonade");
      }
    });
    return true;
  }

  // ---- Ollama errors ----------------------------------------------------
  if (!error.message.toLowerCase().includes("ollama")) {
    return false;
  }
  let message = error.message;
  let options: string[] | undefined;
  let modelName: string | undefined;

  if (message.includes("Ollama may not be installed")) {
    options = ["Download Ollama"];
  } else if (message.includes("Ollama may not be running")) {
    options = ["Start Ollama"];
  } else if (message.includes("ollama run") && "llm" in error) {
    modelName = message.match(/`ollama run (.*)`/)?.[1];
    const llm = (error as any).llm as ILLM;
    if (isModelInstaller(llm) && await llm.isInstallingModel(modelName!)) {
      console.log(`${llm.providerName} already installing ${modelName}`);
      return false;
    }
    message = `Model "${modelName}" is not found in Ollama. You need to install it.`;
    options = ["Install Model"];
  }

  if (options === undefined) {
    console.log("Found an unhandled Ollama error: ", message);
    return false;
  }

  vscode.window.showErrorMessage(message, ...options).then(val => {
    if (val === "Download Ollama") {
      vscode.env.openExternal(vscode.Uri.parse("https://ollama.ai/download"));
    } else if (val === "Start Ollama") {
      vscode.commands.executeCommand("continue.startLocalOllama");
    } else if (val === "Install Model" && "llm" in error) {
      vscode.commands.executeCommand("continue.installModel", modelName, (error as any).llm);
    }
  });
  return true;
}

```

The function uses platform detection (`process.platform`) to conditionally show Windows-specific Lemonade controls and regular expressions to extract model names from Ollama error strings.

## Manual Debugging and Advanced Recovery

You can programmatically invoke the error handler to verify your setup or build custom debugging tools.

### Testing the Error Handler

To manually trigger the handler for testing purposes, import the function and pass a synthetic error:

```ts
import { handleLLMError } from "extensions/vscode/src/util/errorHandling";

async function testOllamaError() {
  const fakeError = new Error("Ollama may not be installed");
  const handled = await handleLLMError(fakeError);
  console.log(`Error was handled? ${handled}`);
}
testOllamaError();

```

### Validating Provider Configurations

Connection issues often stem from misconfigured schemas. The [`packages/openai-adapters/src/types.ts`](https://github.com/continuedev/continue/blob/main/packages/openai-adapters/src/types.ts) file defines strict Zod schemas for each provider, including `OpenAIConfigSchema`, `AzureConfigSchema`, and `OllamaConfig`. Ensure your [`config.yaml`](https://github.com/continuedev/continue/blob/main/config.yaml) values match these expected structures, particularly the `provider` field which determines which implementation `constructLlmApi` instantiates.

### Programmatic Model Installation

You can register custom commands that leverage Continue's model installation infrastructure:

```ts
vscode.commands.registerCommand(
  "continue.installModel",
  async (modelName: string, llm: ILLM) => {
    await llm.installModel?.(modelName);
    vscode.window.showInformationMessage(`Model ${modelName} installation started`);
  }
);

```

## Summary

- **Centralized handling** – All LLM connection errors route through `handleLLMError` in [`extensions/vscode/src/util/errorHandling.ts`](https://github.com/continuedev/continue/blob/main/extensions/vscode/src/util/errorHandling.ts), which returns `true` if it displays a recovery UI.
- **Local runtime support** – Continue provides one-click fixes for Ollama (download, start, install model) and Lemonade (start server, open docs) through VS Code command execution.
- **Configuration validation** – Provider schemas in [`packages/openai-adapters/src/types.ts`](https://github.com/continuedev/continue/blob/main/packages/openai-adapters/src/types.ts) enforce correct API keys, endpoints, and proxy settings.
- **Extensible architecture** – The error handling system uses string pattern matching and platform detection to provide context-aware solutions without requiring manual log inspection.

## Frequently Asked Questions

### Where does Continue handle LLM connection errors?

Continue handles LLM connection errors in the `handleLLMError` function located at [`extensions/vscode/src/util/errorHandling.ts`](https://github.com/continuedev/continue/blob/main/extensions/vscode/src/util/errorHandling.ts). This function is called from [`extensions/vscode/src/webviewProtocol.ts`](https://github.com/continuedev/continue/blob/main/extensions/vscode/src/webviewProtocol.ts) after the Redux thunk `streamNormalInput` catches an exception from the LLM client. It inspects the error message to determine whether it relates to Ollama, Lemonade, or another provider before presenting specific UI actions.

### How do I fix "Ollama may not be running" errors?

When you see "Ollama may not be running", click the **Start Ollama** button in the VS Code notification. This executes the `continue.startLocalOllama` command, which attempts to launch the Ollama service. Alternatively, you can open the VS Code Command Palette and run `continue.startLocalOllama` manually, or start Ollama from your terminal before retrying the request.

### Can I manually trigger the error handler for testing?

Yes, you can import `handleLLMError` from `extensions/vscode/src/util/errorHandling` and pass it a synthetic Error object with a specific message. For example, creating `new Error("Ollama may not be installed")` will trigger the download prompt, allowing you to verify that the UI integration works correctly without waiting for an actual network failure.

### Where are LLM provider configurations defined?

LLM provider configurations are defined in [`packages/openai-adapters/src/types.ts`](https://github.com/continuedev/continue/blob/main/packages/openai-adapters/src/types.ts) using Zod schemas such as `OpenAIConfigSchema` and `OllamaConfig`. These schemas specify required fields like `apiKey`, `apiBase`, and `provider`. The `constructLlmApi` factory in [`packages/openai-adapters/src/index.ts`](https://github.com/continuedev/continue/blob/main/packages/openai-adapters/src/index.ts) uses these definitions to instantiate the correct client based on your [`config.yaml`](https://github.com/continuedev/continue/blob/main/config.yaml) settings.