---
title: "Providers"
description: "Provider-agnostic: same tools, same sessions across Anthropic, OpenAI, Gemini, and configured self-hosted models."
icon: "server"
---

Meerkat is provider-agnostic at the session/config/runtime model level. You can switch providers by changing the model name, and a configured self-hosted alias such as `gemma-4-31b` behaves like any other model ID in the runtime. Tool visibility and multimodal behavior still depend on model capabilities, so provider/model differences can affect the effective tool surface.

<Note>
This page is the concept layer for provider abstraction. Use [Auth](/guides/auth) and [Self-hosting models](/guides/self-hosting-models) for setup workflows, and use reference pages for exact capability and contract details.
</Note>

## Provider setup

<Tabs>
  <Tab title="Anthropic">
    ```bash
    export ANTHROPIC_API_KEY="sk-ant-..."
    ```

    | Model | Context | Max output | Best for |
    |-------|---------|------------|----------|
    | `claude-opus-4-7` | 1M | 128K | Default Anthropic recommendation |
    | `claude-opus-4-6` | 1M | 128K | Supported Opus fallback |
    | `claude-sonnet-4-6` | 1M | 64K | Balanced performance and cost |
    | `claude-sonnet-4-5` | 200K | 64K | Legacy supported Sonnet |

    ```toml config.toml (active realm)
    [agent]
    model = "claude-opus-4-7"
    max_tokens_per_turn = 16384
    ```
  </Tab>
  <Tab title="OpenAI">
    ```bash
    export OPENAI_API_KEY="sk-..."
    ```

    | Model | Context | Best for |
    |-------|---------|----------|
    | `gpt-5.5` | 1.05M | Default OpenAI recommendation |
    | `gpt-5.5-pro` | 1.05M | Long-running pro-tier reasoning |
    | `gpt-5.4` | 1.05M | Supported GPT-5 fallback |
    | `gpt-5.4-mini` | 128K | Smaller fast-path model with compaction support |
    | `gpt-5.3-codex` | 400K | Coding-focused workflows |
    | `gpt-realtime-2` | 128K | Live audio sessions |

    ```toml config.toml (active realm)
    [agent]
    model = "gpt-5.5"
    max_tokens_per_turn = 8192
    ```
  </Tab>
  <Tab title="Gemini">
    ```bash
    export GOOGLE_API_KEY="AIza..."
    ```

    | Model | Context | Best for |
    |-------|---------|----------|
    | `gemini-3.5-flash` | 1M | Default Gemini recommendation, stable fast reasoning |
    | `gemini-3.1-pro-preview` | 1M | Advanced preview reasoning |
    | `gemini-3.1-flash-lite-preview` | 1M | Lightweight fast-path tasks |

    ```toml config.toml (active realm)
    [agent]
    model = "gemini-3.5-flash"
    max_tokens_per_turn = 8192
    ```
  </Tab>
  <Tab title="Self-hosted">
    Configure an OpenAI-compatible local or remote server, then register aliases under `self_hosted.models`.

    ```toml config.toml (active realm)
    [self_hosted.servers.ollama]
    transport = "openai_compatible"
    base_url = "http://127.0.0.1:11434"
    api_style = "chat_completions"

    [self_hosted.models.gemma-4-31b]
    server = "ollama"
    remote_model = "gemma4:31b"
    display_name = "Gemma 4 31B"
    family = "gemma-4"
    tier = "supported"
    context_window = 256000
    max_output_tokens = 8192
    vision = true
    image_tool_results = true
    inline_video = false
    supports_temperature = true
    supports_thinking = true
    supports_reasoning = true
    ```
  </Tab>
</Tabs>

## Environment variables

| Variable | Fallback | Provider |
|----------|----------|----------|
| `RKAT_ANTHROPIC_API_KEY` | `ANTHROPIC_API_KEY` | Anthropic Claude |
| `RKAT_OPENAI_API_KEY` | `OPENAI_API_KEY` | OpenAI GPT |
| `RKAT_AZURE_OPENAI_API_KEY` plus `RKAT_AZURE_OPENAI_ENDPOINT` | `AZURE_OPENAI_API_KEY` plus `AZURE_OPENAI_ENDPOINT` | Azure OpenAI |
| `RKAT_GEMINI_API_KEY` | `GEMINI_API_KEY`, `GOOGLE_API_KEY` | Google Gemini |

<Note>
The `RKAT_*` variants take precedence over provider-native names, so you can run Meerkat with dedicated keys separate from other tools.
</Note>

Self-hosted servers use the configured `bearer_token_env` or `bearer_token` on each server definition instead of the shared provider env vars above.

## Image generation providers

The `generate_image` builtin uses provider-specific image profiles behind a single Meerkat request shape. The active session model does not have to be an image model; image operations can route to a provider default or a forced image target while preserving the original session identity.

| Provider | Default image target | Notes |
|----------|----------------------|-------|
| OpenAI | `gpt-image-2` | Uses the hosted Responses image tool by default. Other OpenAI-owned `gpt-image*` or `dall-e*` targets use the Images API path. |
| Gemini | `gemini-3.1-flash-image-preview` | Also accepts provider alias `google`. Gemini image targets run through an internal scoped image-model turn. |

Request `provider_params` are provider-specific and do not replace Meerkat's universal image fields. Use top-level `size`, `quality`, `format`, and `intent`; the OpenAI adapter lowers `format` to provider-side `output_format`. For the current `gpt-image-2` default, public callers should only need `background`, `output_compression`, `moderation`, hosted-tool-only `action`, hosted-tool-only `reasoning_effort`, and hosted-tool-only `web_search`; use `background: "auto"` or `"opaque"` (not `"transparent"`), use `output_compression` only with `format: "jpeg"` or `"webp"`, usually omit `action`, and omit `input_fidelity` because Meerkat 0.6.19 rejects unknown OpenAI image provider params. Gemini accepts `aspect_ratio` and `image_size`. See [Image generation](/guides/image-generation) for the exact request shape and troubleshooting.

## SDK feature flags

When using Meerkat as a Rust library, enable only the providers you need:

| Feature | Description | Default |
|---------|-------------|---------|
| `anthropic` | Anthropic Claude support | Yes |
| `openai` | OpenAI GPT support | Yes |
| `gemini` | Google Gemini support | Yes |
| `all-providers` | All LLM providers (convenience alias) | No |

<CodeGroup>

```toml Anthropic only (smallest binary)
meerkat = { version = "0.6.19", features = ["anthropic", "jsonl-store"] }
```

```toml All providers
meerkat = { version = "0.6.19", features = ["all-providers", "jsonl-store"] }
```

</CodeGroup>

## Provider parameters

Provider-specific options can be passed via the `--param` CLI flag or `provider_params` in the SDK:

Provider-native web search is on by default for catalog models that support it.
Disable it in config with the matching `provider_tools.<provider>` search toggle,
or for a single CLI run with `rkat run --no-web-search "..."`.

<Tabs>
  <Tab title="Anthropic">
    | Parameter | Description |
    |-----------|-------------|
    | `thinking_budget` | Token budget for extended thinking (integer) |
    | `top_k` | Top-k sampling parameter (integer) |

    ```bash
    rkat run --model claude-sonnet-4-6 --param thinking_budget=10000 "Solve this problem"
    ```
  </Tab>
  <Tab title="OpenAI">
    | Parameter | Values | Description |
    |-----------|--------|-------------|
    | `reasoning_effort` | `none`, `low`, `medium`, `high`, `xhigh` | Reasoning effort for GPT-5-era OpenAI models and other compatible OpenAI reasoning surfaces |
    | `seed` | Integer | Seed for deterministic outputs |

    ```bash
    rkat run --model gpt-5.5 --param reasoning_effort=high "Prove this theorem"
    ```
  </Tab>
  <Tab title="Gemini">
    | Parameter | Description |
    |-----------|-------------|
    | `thinking_budget` | Token budget for extended thinking (integer) |
    | `top_k` | Top-k sampling parameter (integer) |

    ```bash
    rkat run --model gemini-3.5-flash --param thinking_budget=5000 "Analyze this data"
    ```
  </Tab>
</Tabs>

## Model catalog

Meerkat ships a curated built-in model catalog in `meerkat_core::model_profile` and merges it with any configured self-hosted aliases into one effective runtime registry used for capability detection, provider resolution, and catalog responses. The compatibility `meerkat-models` crate re-exports that catalog surface for consumers that still depend on the older crate boundary.

Query the catalog programmatically from any surface:

- **CLI**: `rkat models`
- **RPC**: `models/catalog`
- **REST**: `GET /models/catalog`
- **MCP**: `meerkat_models_catalog`

Configured self-hosted aliases appear under the `self_hosted` provider group and include their backing `server_id`.

For Gemma 4 specifically, prefer `chat_completions` as the default OpenAI-compatible interface. It is the clearest common path for tool calling across Ollama, LM Studio, and vLLM, while reasoning-trace semantics still vary by server.

## Auto-detection

The provider is resolved from the built-in model catalog and any configured self-hosted aliases:

- `claude-*` models use Anthropic
- `gpt-*`, `chatgpt-*` models use OpenAI
- `gemini-*` models use Gemini

Configured self-hosted aliases are resolved by exact model ID match before prefix inference. That means an alias such as `gemma-4-31b` works without `--provider`.

You can still override this with `--provider` on the CLI or `provider` in API requests.

## See also

- [Auth & bindings](/concepts/auth-and-bindings)
- [Self-hosting models](/guides/self-hosting-models)
- [Built-in tools reference](/reference/builtin-tools)
- [Capability matrix](/reference/capability-matrix)
