Custom Models
Custom Model Configurations
Configure multiple AI providers and assign them to individual agents by name. Use Grok, Gemini, OpenRouter, or any OpenAI-compatible endpoint alongside your default Azure OpenAI model.
Overview
OpenCaddis requires two model configs: default (chat/completions) and embeddings (vector embeddings). Beyond those, you can add any number of custom named model configs — each pointing to a different provider, model, or endpoint.
Custom configs are defined in the Settings UI and stored in fabr.json. Once saved, they appear in the Agent Configuration tab's model dropdown, so you can assign any model to any agent.
GetChatClient("grok")
Supported Providers
| Provider | Endpoint | Notes |
|---|---|---|
| Azure | https://your-resource.services.ai.azure.com/... |
Azure AI Foundry endpoint |
| OpenAI | (leave blank for default) | Standard OpenAI API |
| Grok | https://api.x.ai/v1 |
xAI's Grok API |
| Gemini | https://generativelanguage.googleapis.com/v1beta/openai/ |
Google's OpenAI-compatible endpoint |
| OpenRouter | https://openrouter.ai/api/v1 |
Multi-provider router. Model format: provider/model |
Selecting a provider in the UI auto-fills the endpoint URI where applicable. Any provider that exposes an OpenAI-compatible API can be used by entering its endpoint manually.
Adding a Custom Model
- Go to Settings > Model Configuration
- Scroll to the Additional Models section
- Click Add Model
- Fill in the card:
Field Description Example Name Unique lowercase identifier. Alphanumeric + hyphens. Cannot be defaultorembeddings.grokProvider Select from dropdown. Auto-fills the endpoint. Grok Endpoint URI API endpoint URL for the provider. https://api.x.ai/v1API Key Provider API key. Masked by default with show/hide toggle. xai-...Model Model identifier. grok-4-latestTimeout (s) Request timeout in seconds. 60Max Tokens Optional max output token limit. 4096 - Click Save Configuration
- Go to the Agent Config tab — the new model appears in the Models dropdown
- Assign it to any agent
Names are validated for uniqueness, reserved words, and format. Model and API Key are required fields. Validation errors block saving and display an alert.
fabr.json Structure
Custom models are stored alongside default and embeddings in the ModelConfigurations array:
{
"ModelConfigurations": [
{ "Name": "default", "Provider": "Azure", ... },
{ "Name": "embeddings", "Provider": "Azure", ... },
{
"Name": "grok",
"Provider": "Grok",
"Uri": "https://api.x.ai/v1",
"Model": "grok-4-latest",
"ApiKeyAlias": "grok-key",
"TimeoutSeconds": 60
},
{
"Name": "gemini",
"Provider": "Gemini",
"Uri": "https://generativelanguage.googleapis.com/v1beta/openai/",
"Model": "gemini-2.5-flash",
"ApiKeyAlias": "gemini-key",
"TimeoutSeconds": 60
}
],
"ApiKeys": [
{ "Alias": "default-key", "Value": "..." },
{ "Alias": "grok-key", "Value": "..." },
{ "Alias": "gemini-key", "Value": "..." }
]
}
When saving, the system deduplicates API keys by value. If two model configs use the same key string (e.g. default and embeddings sharing an Azure key), they share the same key alias instead of creating duplicate entries.
Assigning to Agents
Once a custom model is saved, it appears in the Agent Configuration tab's Models dropdown. Select it for any agent to set Args["ModelConfig"] on that agent's configuration.
At runtime, when the agent calls GetChatClient("grok"), FabrCore's ModelConfigController looks up the config by name from fabr.json and creates a client with the matching provider, endpoint, model, and API key.
// In your agent's OnInitialize()
var client = await GetChatClient("grok"); // resolves from fabr.json
_agent = new ChatClientAgent(client)
.AsBuilder()
.UseOpenTelemetry()
.Build(ServiceProvider);
You can have different agents using different providers simultaneously — one agent on Azure OpenAI, another on Grok, another on Gemini — all running in the same OpenCaddis instance.
Import & Export
The Export and Import buttons on the Model Configuration tab handle additional models automatically. Custom model configs are included in the exported JSON and restored on import. This makes it easy to share or back up your multi-provider setup.
Example Configurations
| Config Name | Provider | Model | Use Case |
|---|---|---|---|
default | Azure | gpt-5-nano | Primary chat model for agents |
embeddings | Azure | text-embedding-ada-002 | Vector embeddings |
grok | Grok (xAI) | grok-4-latest | Alternative reasoning model |
gemini | Gemini (Google) | gemini-2.5-flash | Fast, cost-effective tasks |
claude-router | OpenRouter | anthropic/claude-sonnet-4 | Claude via OpenRouter |