> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lyzr.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Models & Providers

> 12 providers out of the box. Custom endpoints and OpenAI-compatible proxies supported.

Switch providers by changing one line — your agent definition stays the same.

## Supported Providers

| Provider       | Example                                    | Env Var                |
| -------------- | ------------------------------------------ | ---------------------- |
| Anthropic      | `anthropic:claude-sonnet-4-6`              | `ANTHROPIC_API_KEY`    |
| OpenAI         | `openai:gpt-4o`                            | `OPENAI_API_KEY`       |
| Google         | `google:gemini-2.0-flash-001`              | `GOOGLE_API_KEY`       |
| Groq           | `groq:llama-3.3-70b-versatile`             | `GROQ_API_KEY`         |
| xAI            | `xai:grok-2-1212`                          | `XAI_API_KEY`          |
| Mistral        | `mistral:mistral-large-latest`             | `MISTRAL_API_KEY`      |
| OpenRouter     | `openrouter:anthropic/claude-3.5-sonnet`   | `OPENROUTER_API_KEY`   |
| Cerebras       | `cerebras:llama3.1-70b`                    | `CEREBRAS_API_KEY`     |
| DeepSeek       | `deepseek:deepseek-chat`                   | `DEEPSEEK_API_KEY`     |
| Amazon Bedrock | `amazon-bedrock:anthropic.claude-3-sonnet` | AWS credentials        |
| Google Vertex  | `google-vertex:gemini-2.5-flash`           | GCP ADC                |
| Azure OpenAI   | `azure-openai-responses:gpt-4o`            | `AZURE_OPENAI_API_KEY` |

<Note>
  For provider-specific credentials — Azure OpenAI, Amazon Bedrock, Google Vertex AI, and Cloudflare Workers AI all take extra environment variables beyond a single API key. See [Environment Variables](/open-source/gitagent/configuration/environment-variables) for the full list.
</Note>

## Model Resolution Order

When multiple model sources are configured, GitAgent resolves the active model in this priority order:

1. **Environment config `model_override`** — from `config/<env>.yaml`
2. **CLI flag `--model provider:model-id`** — passed at runtime
3. **`agent.yaml` `model.preferred`** — defined in the agent repo

## Custom / OpenAI-Compatible Endpoints

Any OpenAI-compatible endpoint works — point GitAgent at it inline, via an environment variable, or in `agent.yaml`.

```bash theme={null}
# Inline URL
gitagent --model "ollama:llama3@http://localhost:11434/v1" --voice --dir ~/assistant

# Environment variable
export GITAGENT_MODEL_BASE_URL=http://localhost:11434/v1
gitagent --model "ollama:llama3" --voice --dir ~/assistant
```

```yaml theme={null}
# In agent.yaml
model:
  preferred: "custom:my-model@https://my-proxy.com/v1"
```

<Tip>
  Compatible endpoints: Ollama (`:11434`), LM Studio (`:1234`), vLLM (`:8000`), LiteLLM (`:4000`), Lyzr AI Studio, and any other OpenAI-compatible proxy.
</Tip>

## Lyzr AI Studio Integration

Connect to Lyzr's managed agent infrastructure. Your agent runs on Lyzr's servers with full observability.

* **Via installer (easiest)** — Run the interactive installer and select Lyzr when prompted
* **Via CLI flag** — `gitagent --model "lyzr:<AGENT_ID>@https://agent-prod.studio.lyzr.ai/v4" --dir ~/assistant`
* **Via SDK** — Use the `query()` function with a `lyzr:` model string (see example below)

```typescript theme={null}
// sdk-example.ts
import { query } from "@open-gitagent/gitagent";

const result = query({
  prompt: "Hello! What can you help me with?",
  dir: "/path/to/agent",
  model: `lyzr:${LYZR_AGENT_ID}@https://agent-prod.studio.lyzr.ai/v4`,
  constraints: { temperature: 0.7, maxTokens: 2000 },
});
for await (const msg of result) {
  if (msg.type === "assistant") console.log(msg.content);
}
```

<CardGroup cols={2}>
  <Card title="Environment Variables" icon="gear" href="/open-source/gitagent/configuration/environment-variables">
    Full list of provider API keys and runtime config variables
  </Card>

  <Card title="Overview" icon="file-code" href="/open-source/gitagent/overview">
    See how model configuration fits into the wider GitAgent architecture
  </Card>

  <Card title="SDK Reference" icon="code" href="/open-source/gitagent/sdk/overview">
    Pass model strings and constraints to query()
  </Card>

  <Card title="Observability" icon="chart-line" href="/open-source/gitagent/sdk/telemetry">
    Track token usage and cost per model via OpenTelemetry
  </Card>
</CardGroup>
