---
title: LLM Providers
slug: litmus-mcp-server/llm-providers
docTags: 
createdAt: 2026-05-11T21:46:05.382Z
---

# LLM Providers

The Web UI works with three LLM providers. The MCP server itself is provider-neutral; the choice only matters when you use the bundled chat interface.

## Supported providers

| Provider         | API key env var     | Default model            |
| ---------------- | ------------------- | ------------------------ |
| Anthropic Claude | `ANTHROPIC_API_KEY` | `claude-sonnet-4-6`      |
| OpenAI           | `OPENAI_API_KEY`    | `gpt-4.1`                |
| Google Gemini    | `GEMINI_API_KEY`    | latest Gemini chat model |

Provide one or more keys at container startup, or enter them from the Web UI's setup screen.

```bash
docker run -d --name litmus-mcp-server \
  -p 8000:8000 -p 9000:9000 \
  -e ANTHROPIC_API_KEY=<key> \
  -e OPENAI_API_KEY=<key> \
  -e GEMINI_API_KEY=<key> \
  ghcr.io/litmusautomation/litmus-mcp-server:latest
```

## Switching provider and model

`/update-env` has a two-panel selector:

- **Left:** provider pills, one per configured key.
- **Right:** scrollable list of models, fetched live from the provider's API (`client.models.list` for Anthropic, `oai.models.list` filtered to chat-capable models for OpenAI).

Selecting a model writes both:

- `PREFERRED_MODEL` - the provider identifier (`anthropic`, `openai`, `gemini`)
- `PREFERRED_MODEL_ID` - the specific model id (e.g., `claude-sonnet-4-6`)

`client_utils._get_model_id(provider)` reads `PREFERRED_MODEL_ID` from env, falling back to the provider's default.

## How the chat uses the provider

The Web UI's `/chat` endpoint streams from the selected provider, parsing tool-use events back into MCP `session.call_tool(...)` calls. The user sees:

- Streamed prose, rendered as markdown.
- A tool-call badge each time the model asks the MCP server to do something.
- A stop button to cancel mid-stream.

## API endpoints (provider-related)

| Endpoint                 | Method | Purpose                                                       |
| ------------------------ | ------ | ------------------------------------------------------------- |
| `/api/models?provider=X` | GET    | Fetch the live model list for a provider.                     |
| `/setup-key`             | POST   | Save one or more API keys (AJAX). Returns `{"saved": [...]}`. |
| `/setup`                 | POST   | Same as `/setup-key`, but used as the `<noscript>` fallback.  |
| `/switch-model`          | POST   | Accepts `provider` and optional `model_id`. Updates `.env`.   |

