brainLanguage Models Guide

Pick, inspect, and configure language models for your agents. Use this guide when you are selecting models, balancing cost versus latency, or migrating from provider-specific IDs to managed catalog entries.

circle-info

Model coverage per interface lives in the AIP capability matrixarrow-up-right. Highlights: selecting by language_model_id and applying runtime overrides are fully supported via REST/SDK, while dedicated CLI flags are still pending—use export/import or SDK helpers for those flows.

Discover Models

When to use: Inventory available providers or confirm new deployments before routing traffic.

from glaip_sdk import Client

client = Client()
for model in client.list_language_models():
    print(model["id"], model["name"], model.get("provider"))

The response includes provider, model name, optional base URL, and any capability flags (context length, streaming support, etc.).

Assign Models to Agents

When to use: Update default models or move from legacy provider/model pairs to catalog-managed IDs.

Preferred Option: language_model_id

from glaip_sdk import Agent

agent = Agent(
    name="analysis",
    instruction="You are a precise analyst.",
)
agent.update(language_model_id="managed-gpt-4")

language_model_id is applied via update() because the Agent constructor does not accept it directly.

If you prefer the Client pattern:

Legacy Option: provider/model Pair

circle-info

When you export an agent, the SDK automatically normalises language_model_id and strips legacy provider/model keys to avoid conflicts.

Runtime Overrides

When to use: Experiment with alternative models, failovers, or cost-saving fallbacks per run.

Use this sparingly: overrides apply to a single run and do not persist on the agent record. For legacy provider/model pairs, pass model="openai/gpt-4".

Common routing issues

Symptom
Likely cause
Fix

Agent still uses the old model

Cached agent config or CLI not updated.

Re-run aip agents update and confirm the agent payload includes the new language_model_id.

400 Unknown model errors

Model ID not available in the target environment.

List models in that environment or request the provider be deployed there.

High latency after switching models

New model has different performance profile.

Adjust timeouts or use runtime overrides for latency-sensitive runs.

Streaming stops mid-response

Model lacks streaming support.

Disable streaming for that agent or choose a streaming-capable model.

Strategy Tips

When to use: Align teams on quality, cost, and latency trade-offs before big migrations.

  1. Use managed IDs where possible — they allow the platform to rotate providers or upgrade models transparently.

  2. Reserve provider/model pairs for experimentation — once you settle on a target, migrate to an LM ID for consistency.

  3. Track limits — model metadata exposes context and throughput limits; use them to set appropriate agent timeouts or chunk sizes.

  4. Document defaults — record which models back each agent so teammates know what to expect during troubleshooting.

Last updated