Model config

The model object stored with a version — provider, model id, and sampling parameters — plus the provider-specific rules enforced on save and how you read it back to call your provider.

The model object stores which model to call and how, versioned atomically with the content — so a model swap or a temperature change ships as a new version, no code deploy. In the dashboard it's edited as raw JSON on the model panel.

Shape

Every field is optional:

model
{
  "provider": "anthropic",
  "model": "claude-opus-4-8",
  "temperature": 0.2,
  "max_tokens": 1024,
  "top_p": 1,
  "top_k": 40,
  "stop": ["\n\nHuman:"],
  "base_url": "https://my-gateway.example.com/v1",
  "credential_id": "cred_abc123"
}
FieldNotes
providerOne of the supported providers below. Optional — a version may leave it unset.
modelThe model id, e.g. gpt-4o or claude-opus-4-8. Optional — a version may leave it unset.
temperatureSampling temperature.
max_tokensMax output tokens. Required for some providers (see below).
top_pNucleus sampling.
top_kTop-k sampling. Rejected by the OpenAI-schema providers (see below).
stopStop sequences.
base_urlCustom endpoint. Required for openai_compat.
credential_idThe stored credential to authenticate the call with.

Both provider and model are optional. A version may leave them unset — the caller reads them back empty and supplies its own. That's why your calling code should treat them as possibly-absent (model.model ?? 'gpt-4o').

Providers

openai, anthropic, gemini, mistral, groq, deepseek, xai, fireworks, openai_compat, azure_openai, vertex_ai, bedrock.

Provider-specific rules

These are validated at save time — an invalid combination is rejected with a specific message rather than accepted and silently ignored:

  • anthropic and bedrock require max_tokens. They reject a call without it, so the version must carry one.
  • openai, azure_openai, and openai_compat reject top_k. It isn't part of their schema.
  • openai_compat requires base_url. There's no default endpoint to infer.

Reading it back

compile() passes model through unchanged — it never calls a model. Read the fields off prompt.model (or compiled.model) and pass them to your provider client yourself.

const { messages, model } = prompt.compile({ question: 'refund status?' });

const answer = await openai.chat.completions.create({
  model: model.model ?? 'gpt-4o',
  temperature: model.temperature ?? 0.2,
  max_tokens: model.max_tokens,
  messages,
});
compiled = prompt.compile(question="refund status?")

answer = openai.chat.completions.create(
    model=compiled.model.get("model", "gpt-4o"),
    temperature=compiled.model.get("temperature", 0.2),
    max_tokens=compiled.model.get("max_tokens"),
    messages=compiled.messages,
)

The model config is a versioned recommendation, not a hosted call. Trodo stores it and hands it back; you route it to whichever provider client you already use.

On this page