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.
{"model_id": "gpt-4o-mini","provider_id": "openai","params": {"model": "gpt-4o-mini","temperature": 0.0,"api_key": { "$secretRef": "RESPONSE_PROVIDER_API_KEY" }}} -
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( model_id="gpt-4o-mini", provider_id="openai", 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”As of alquimia-core 0.5.3, 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 (0.5.5+) |
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.
As of alquimia-core 0.5.2, 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.