Configuration
Configuration
FabrCore uses fabrcore.json for LLM provider settings and AgentConfiguration objects to define agents programmatically or via REST API.
fabrcore.json
ModelConfigurations
An array of model definitions. Each entry defines a named model that agents can reference.
| Property | Type | Description |
|---|---|---|
Name | string | Unique name for this model config (e.g., "default", "embeddings") |
Provider | string | "OpenAI", "Azure", "OpenRouter", "Grok", or "Gemini" |
Uri | string | Endpoint URL (required for Azure, ignored for OpenAI) |
Model | string | Model deployment name (e.g., "gpt-4o", "text-embedding-ada-002") |
ApiKeyAlias | string | References an alias in the ApiKeys array |
TimeoutSeconds | int | Request timeout (default: 120) |
MaxOutputTokens | int | Maximum tokens in response |
ContextWindowTokens | int | Total context window size for the model. Used by chat history compaction |
ApiKeys
An array of API key definitions. Keys are encrypted in memory at runtime.
| Property | Type | Description |
|---|---|---|
Alias | string | Name referenced by ApiKeyAlias in model configs |
Value | string | The API key value |
Full Example: Azure OpenAI
{
"ModelConfigurations": [
{
"Name": "default",
"Provider": "Azure",
"Uri": "https://your-resource.openai.azure.com/",
"Model": "gpt-4o",
"ApiKeyAlias": "azure-key",
"TimeoutSeconds": 120,
"MaxOutputTokens": 16384,
"ContextWindowTokens": 128000
},
{
"Name": "embeddings",
"Provider": "Azure",
"Uri": "https://your-resource.openai.azure.com/",
"Model": "text-embedding-ada-002",
"ApiKeyAlias": "azure-key"
}
],
"ApiKeys": [
{ "Alias": "azure-key", "Value": "your-api-key-here" }
]
}
Full Example: OpenAI
{
"ModelConfigurations": [
{
"Name": "default",
"Provider": "OpenAI",
"Model": "gpt-4o",
"ApiKeyAlias": "openai-key",
"TimeoutSeconds": 120,
"MaxOutputTokens": 16384,
"ContextWindowTokens": 128000
}
],
"ApiKeys": [
{ "Alias": "openai-key", "Value": "sk-your-api-key-here" }
]
}
Full Example: Grok
{
"ModelConfigurations": [
{
"Name": "default",
"Provider": "Grok",
"Model": "grok-3",
"ApiKeyAlias": "grok-key",
"TimeoutSeconds": 120,
"MaxOutputTokens": 16384,
"ContextWindowTokens": 131072
}
],
"ApiKeys": [
{ "Alias": "grok-key", "Value": "xai-your-api-key-here" }
]
}
The Grok provider connects to xAI Grok models. No Uri is required — FabrCore uses the default xAI endpoint automatically. Note that Grok does not support embeddings.
Full Example: Gemini
{
"ModelConfigurations": [
{
"Name": "default",
"Provider": "Gemini",
"Model": "gemini-2.5-pro",
"ApiKeyAlias": "gemini-key",
"TimeoutSeconds": 120,
"MaxOutputTokens": 8192,
"ContextWindowTokens": 1048576
},
{
"Name": "embeddings",
"Provider": "Gemini",
"Model": "text-embedding-004",
"ApiKeyAlias": "gemini-key"
}
],
"ApiKeys": [
{ "Alias": "gemini-key", "Value": "your-gemini-api-key-here" }
]
}
The Gemini provider connects to Google Gemini models. No Uri is required. Gemini supports both chat completions and embeddings.
Supported Providers
| Provider | Uri Required | Embeddings | Notes |
|---|---|---|---|
OpenAI | No | Yes | Uses default OpenAI endpoint |
Azure | Yes | Yes | Azure OpenAI resource URL |
OpenRouter | No | Yes | Uses OpenRouter endpoint |
Grok | No | No | xAI Grok models |
Gemini | No | Yes | Google Gemini models |
AgentConfiguration
Agents are created programmatically using AgentConfiguration objects passed via the REST API or ClientContext.
| Property | Type | Description |
|---|---|---|
Handle | string | Unique agent identifier |
AgentType | string | Agent type alias (from [AgentAlias]) |
Models | string | Model configuration name from fabrcore.json |
Streams | List<string> | Orleans streams to subscribe to |
SystemPrompt | string | System-level instructions for the agent |
Args | Dictionary<string, string> | Additional configuration arguments |
Model Providers
Orleans Configuration
Configure Orleans clustering in appsettings.json:
{
"Orleans": {
"ClusterId": "fabrcore-cluster",
"ServiceId": "fabrcore-service",
"ClusteringMode": "Localhost",
"ConnectionString": null
}
}
| ClusteringMode | Description | Use Case |
|---|---|---|
Localhost | In-memory clustering | Development only |
SqlServer | SQL Server (ADO.NET) | Production with SQL Server |
AzureStorage | Azure Table Storage | Production with Azure |
When using SqlServer clustering mode, FabrCore includes an OrleansSqlServerInitializer that automatically creates the required Orleans database tables on startup if they do not already exist. No manual SQL scripts or database preparation is needed — just provide a valid connection string and the initializer handles the rest.
Configuration Validation Checklist
Verify your fabrcore.json before running to avoid cryptic runtime errors:
- Valid JSON: No trailing commas, missing quotes, or unclosed braces
- At least one ModelConfiguration: The
ModelConfigurationsarray must not be empty - ApiKeyAlias references resolve: Every
ApiKeyAliasvalue must match anAliasin theApiKeysarray - No placeholder values: Replace
"your-api-key-here"and"sk-..."with actual keys - ContextWindowTokens set: Required for chat history compaction
File Storage
{
"FileStorage": {
"StoragePath": "/tmp/fabrcorefiles",
"DefaultTtlSeconds": 300,
"CleanupIntervalMinutes": 1
}
}
The default StoragePath uses a Windows path format. On Linux, WSL, or macOS, you must configure this explicitly to a Unix-style path (e.g., /tmp/fabrcorefiles). Otherwise, a literal c:\temp\fabrcorefiles directory will be created in your working directory.