Home / Docs / Custom Models

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.

1. Configure
Add models in Settings UI
2. Assign
Pick a model per agent
3. Run
GetChatClient("grok")

Supported Providers

ProviderEndpointNotes
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

  1. Go to Settings > Model Configuration
  2. Scroll to the Additional Models section
  3. Click Add Model
  4. Fill in the card:
    FieldDescriptionExample
    NameUnique lowercase identifier. Alphanumeric + hyphens. Cannot be default or embeddings.grok
    ProviderSelect from dropdown. Auto-fills the endpoint.Grok
    Endpoint URIAPI endpoint URL for the provider.https://api.x.ai/v1
    API KeyProvider API key. Masked by default with show/hide toggle.xai-...
    ModelModel identifier.grok-4-latest
    Timeout (s)Request timeout in seconds.60
    Max TokensOptional max output token limit.4096
  5. Click Save Configuration
  6. Go to the Agent Config tab — the new model appears in the Models dropdown
  7. Assign it to any agent
Validation

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:

fabr.json
{
  "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": "..." }
  ]
}
API Key Deduplication

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.

Agent using a custom model
// 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 NameProviderModelUse Case
defaultAzuregpt-5-nanoPrimary chat model for agents
embeddingsAzuretext-embedding-ada-002Vector embeddings
grokGrok (xAI)grok-4-latestAlternative reasoning model
geminiGemini (Google)gemini-2.5-flashFast, cost-effective tasks
claude-routerOpenRouteranthropic/claude-sonnet-4Claude via OpenRouter
Documentation