Summary#
app.DefaultModel declares the application's default large-language model as one app-level config block. You name a
provider, a model string, the API key (a Secret.X handle), and an optional custom BaseUrl. It is a
per-app singleton — declared once — and it self-reconciles against source: removing it clears the default.
app.Secrets = [ new Secret("Anthropic") ];
app.DefaultModel = new LlmConfig {
Provider = LlmProvider.Anthropic,
Model = "claude-opus-4-8",
ApiKey = Secret.Anthropic,
};Signature#
app.Secrets = [ new Secret("Anthropic") ]; // the handle the config below reads
app.DefaultModel = new LlmConfig {
Provider = LlmProvider.Anthropic, // Anthropic | OpenAI | Gemini | OpenAICompatible
Model = "claude-opus-4-8", // the provider's model id
ApiKey = Secret.Anthropic, // a handle declared in app.Secrets
BaseUrl = "https://api.anthropic.com", // optional — required for OpenAICompatible
};A single app-level assignment. It is a singleton — declaring it twice is a compile error.
Description#
LlmConfig has four members:
Provider— a qualifiedLlmProviderenum member.Anthropic,OpenAI, andGeminiare first-party providers reached at their default endpoints.OpenAICompatibletargets any OpenAI-wire-compatible server (a self-hosted model, a proxy, or an OpenRouter-style gateway) and requires aBaseUrl.Model— the provider's model identifier (e.g.claude-opus-4-8,gpt-4o,gemini-2.5-flash).ApiKey— aSecret.Xhandle. The secret must be declared inapp.Secrets; the key is resolved at runtime from the secret store and never inlined in source.BaseUrl(optional) — a custom endpoint. Optional for the first-party providers (they default to their own endpoints); required forOpenAICompatible.
Because it self-reconciles against source, the config behaves like a switch: declaring it upserts the singleton, removing it sweeps the row and clears the app default (no prune step needed). Every LLM call the platform makes on your behalf is metered against your budget regardless of which provider you choose.
Examples#
Point the app at an OpenAI-compatible endpoint you host yourself — OpenAICompatible plus a BaseUrl:
app.Secrets = [ new Secret("LocalLlm") ];
app.DefaultModel = new LlmConfig {
Provider = LlmProvider.OpenAICompatible,
Model = "llama-3.1-70b",
ApiKey = Secret.LocalLlm,
BaseUrl = "https://llm.internal.example.com/v1",
};See also#
- [Searchable] —
[Searchable], the field-search surface; semantic ranking uses the app embedding configured the same way