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”| Provider | Typical params |
|---|---|
openai | model, api_key, base_url, temperature, max_tokens |
groq | model, groq_api_key, temperature, max_tokens |
huggingface | model, api_key, base_url, temperature, max_tokens |
ollama | model, base_url, temperature, max_tokens |
See the Agent specification reference for the model_ref schema.