---
title: "Custom AI Providers"
description: "Point any Toolbelt assistant at your own OpenAI-compatible endpoint — Ollama, LM Studio, or any self-hosted model."
updated: 2026-06-09
---

# Custom AI Providers

## Overview

By default, Toolbelt assistants use Anthropic or OpenAI models configured at the platform level. If you need to use a different model — whether that's a locally hosted Ollama instance, LM Studio, or any third-party provider with an OpenAI-compatible API — you can configure that at the organization level.

Each organization can point to its own AI provider independently. One assistant can use Claude, another can use a local Llama model — they coexist without conflict.

---
## When to use a custom provider

- You're running **local models** via Ollama or LM Studio for privacy or cost reasons
- Your organization requires models to stay **on-premises**
- You want to test a **specific model version** not available through the default providers
- You're integrating with a **third-party OpenAI-compatible service**

---
## Configuration

### Via the UI

1. Open your organization **Settings**
2. Go to the **AI Provider & Model** section
3. Select **"Custom (OpenAI-Compatible)"** from the Provider dropdown
4. Fill in the fields that appear:

| Field | Required | Description |
|---|---|---|
| **Base URL** | ✅ | Your OpenAI-compatible API endpoint (e.g. `http://localhost:11434/v1`) |
| **Model Name** | ✅ | The model identifier your endpoint expects (e.g. `llama2`, `local-model`) |
| **API Key** | Optional | Required only if your endpoint enforces authentication |

5. Save your settings. The organization will use your custom endpoint for all subsequent conversations.

### Via the API


```javascript
PUT /api/workspaces/:workspaceId
{
  "provider": "custom",
  "customOpenAIBaseURL": "http://localhost:11434/v1",
  "customOpenAIModel": "llama2",
  "customOpenAIApiKey": "your-api-key"  // optional
}
```


---
## Examples

### Ollama (local)


```javascript
{
  "provider": "custom",
  "customOpenAIBaseURL": "http://localhost:11434/v1",
  "customOpenAIModel": "llama2",
  "customOpenAIApiKey": null  // Ollama doesn't require a key
}
```

### LM Studio (local)


```javascript
{
  "provider": "custom",
  "customOpenAIBaseURL": "http://localhost:1234/v1",
  "customOpenAIModel": "local-model",
  "customOpenAIApiKey": null  // LM Studio doesn't require a key
}
```

### Third-party OpenAI-compatible service


```javascript
{
  "provider": "custom",
  "customOpenAIBaseURL": "https://api.example.com/v1",
  "customOpenAIModel": "custom-model-name",
  "customOpenAIApiKey": "your-actual-api-key"
}
```


---
## How it works

When an organization has `provider` set to `"custom"`, Toolbelt:

1. Checks that both `customOpenAIBaseURL` and `customOpenAIModel` are set
2. Creates a new OpenAI client instance pointed at your endpoint
3. Uses that client for all chat processing in this organization

If either required field is missing, the organization falls back to the platform default provider.

> **Note:** Internally, the custom provider is treated as `"openai"` for compatibility. This means it fully supports tool calling and streaming wherever the standard OpenAI client does.



---
## Fallback behavior

If `provider` is not set to `"custom"`, or the required fields are missing, the organization uses the platform's default configuration — either OpenAI or Anthropic, depending on how Toolbelt is deployed.

---
## Security considerations

- **API keys are stored in the database.** For production deployments, consider encrypting sensitive fields at rest.
- **Validate Base URLs** before saving. Only connect to endpoints you trust.
- Access to organization settings should be restricted to organization admins.
