Register a model
Instead of embedding model configuration in every agent, register a model once and reference it by model_ref. This makes credential rotation and model upgrades easier across many agents.
Register a model with the CLI
Section titled “Register a model with the CLI”-
Create a model registration JSON file.
{"registered_model_id": "gpt-4o-mini","provider_id": "openai","name": "GPT-4o mini","vendor": "openai","attribution_id": "openai/gpt-4o-mini","params": {"model": "gpt-4o-mini","temperature": 0.0,"api_key": { "$secretRef": "RESPONSE_PROVIDER_API_KEY" }}}registered_model_idis the stable identifier used formodel_ref.nameandvendorare optional display metadata;vendormust matchprovider_idfor native connectors (openai,anthropic,google,groq,huggingface,ollama) and should beopenshiftorcustomforopenai-compatible.attribution_idis optional and used for provenance when the model proposes knowledge, such as during Boltzmann brain ingestion. It defaults to<provider_id>/<params.model>when that is a usable identifier. -
Add it to an agentspace.
Terminal window alquimia registry models add gpt-4o-mini.json --namespace default -
Verify the registration.
Terminal window alquimia registry models list --namespace default
Register a model programmatically
Section titled “Register a model programmatically”from alquimia.core.registry import Registryfrom alquimia.core.models import ModelRegistration
registry = Registry(registry_dir="/var/lib/alquimia/registry")
registry.add_model( "default", ModelRegistration( registered_model_id="gpt-4o-mini", provider_id="openai", name="GPT-4o mini", vendor="openai", attribution_id="openai/gpt-4o-mini", params={ "model": "gpt-4o-mini", "temperature": 0.0, "api_key": {"$secretRef": "RESPONSE_PROVIDER_API_KEY"}, }, ),)Use a registered model in an agent spec
Section titled “Use a registered model in an agent spec”{ "assistant_id": "support-bot", "response": { "provider_id": "alquimia", "config": { "model_ref": "gpt-4o-mini" }, "profile": { "system_prompt": "You are a helpful support assistant.", "evaluation_strategy": { "evaluation_strategy_id": "one-shoot" } } }}Per-use params override the registered defaults:
{ "response": { "provider_id": "alquimia", "config": { "model_ref": "gpt-4o-mini", "params": { "temperature": 0.7, "max_tokens": 2048 } }, "profile": { ... } }}Use a registered model in a shield
Section titled “Use a registered model in a shield”{ "shields": { "intent-classifier": { "provider_id": "shield-config", "connector": { "provider_id": "alquimia", "profile": { "system_prompt": "Classify user intent.", "evaluation_strategy": { "evaluation_strategy_id": "one-shoot", "structured_output": { "method": "json_schema", "json_schema": { "type": "object", "properties": { "intent": { "type": "string" } }, "required": ["intent"] } } } }, "config": { "model_ref": "gpt-4o-mini" } }, "action": "observe" } }}Supported provider IDs
Section titled “Supported provider IDs”params are validated against a per-provider schema at registration time and again when the merged configuration is instantiated. Passing a parameter that belongs to a different provider — for example, groq_api_key to an openai-compatible connector — is rejected with an error that names the offending keys and the provider they belong to.
| Provider | Typical params |
|---|---|
openai | model, api_key, base_url, temperature, max_tokens, timeout, top_p, max_retries, organization, reasoning, reasoning_effort, output_version, store, extra_body |
openai-compatible | Same as openai; use reasoning for the Responses API. Add harmony_preamble_as_reasoning: true for gpt-oss/vLLM streaming to keep chain-of-thought out of the answer. The adapter round-trips reasoning_content (and reasoning) and passes extra_body through to the model. |
groq | model, api_key, groq_api_key, base_url, temperature, max_tokens, timeout, top_p, max_retries, reasoning_format, reasoning_effort, output_version |
huggingface | model, api_key, base_url, temperature, max_tokens, timeout, top_p, max_retries |
ollama | model, base_url, temperature, max_tokens |
$secretRef markers inside params are accepted at registration and resolved at inference time, including LOCAL-scoped secrets when the registration is loaded for a specific assistant.
OpenAI-compatible extensions
Section titled “OpenAI-compatible extensions”The openai-compatible provider is backed by ChatOpenAIWithReasoningContent, which supports:
- Round-tripping
reasoning_content(and thereasoningalias) in message content. - Passthrough of
extra_bodyto the model, for provider-specific request fields. harmony_preamble_as_reasoning: truefor gpt-oss/vLLM streaming, which keeps chain-of-thought content out of the final answer.
{ "registered_model_id": "qwen3", "provider_id": "openai-compatible", "name": "Qwen3", "vendor": "custom", "params": { "model": "qwen3-235b-a22b", "base_url": "http://localhost:8000/v1", "extra_body": { "enable_thinking": true }, "harmony_preamble_as_reasoning": true }}You can also register audio models (AudioModelRef, STTModelRef, TTSModelRef) and reference them from the agent spec’s audio field as audio_model_ref, stt_model_ref, and tts_model_ref.
See the Agent specification reference for the model_ref schema and Audio adapters for audio model refs.