Select models or use Smart Routing

Unity Gateway lets you use different models in your coding agent. Choose and switch models with the agent's model picker, or let Smart Routing select models for delegated tasks.

Choose a model

ug discovers the models available through your workspace. What you can choose depends on the agent's model support, your organization's configuration, and the access granted to you.

Launch Codex CLI with ug codex, Claude Code with ug claude, or GitHub Copilot CLI with ug copilot. In the agent, enter:

/model

Select an available model from the picker and continue working. Use the same picker for supported open-source models, such as GLM 5.3 (system.ai.glm-5-3). Enter /model again whenever you want to switch, such as choosing a faster model for routine edits or a more capable model for a complex task.

See Use open-source models for setup examples and Control spending for the cost rationale.

For scripted launches, see the ug CLI reference.

In ChatGPT desktop, use the model picker in a Codex conversation to choose a model, including supported open-source models. See Use open-source models in ChatGPT desktop. In GitHub Copilot in Visual Studio Code, select a model from the Databricks group in the Copilot Chat model picker. In other agents, check the help menu for the model picker.

Copilot Chat model picker in VSC with the Databricks group selected

To use your organization's registered provider account, see Bring your own model providers.

Use Smart Routing

Important

Smart Routing is in Beta. An account admin must enable the Enhanced Unity Gateway preview from the account console Previews page. See Manage Azure Databricks previews.

Smart Routing selects the lowest-cost model capable of handling your task, so you don't choose a model for every request. It works with Claude Code. Smart Routing for Codex is paused in the Unity Gateway CLI. GitHub Copilot doesn't support Smart Routing.

Requirements

  • The Enhanced Unity Gateway preview enabled for your account. An account admin enables it from the account console Previews page. See Manage Azure Databricks previews. Allow 1–2 minutes after enablement for it to propagate to your workspace.
  • EXECUTE access to every candidate model Smart Routing can select. Smart Routing chooses only among system.ai-prefixed model services. If access is missing, routing fails with an error that identifies the required models.

Use Smart Routing with the Unity Gateway CLI

If your admin enables Smart Routing in your agent's workspace configuration, ug applies it automatically. Launch Claude Code as usual:

ug claude

To turn on Smart Routing yourself for a launch, add --enable-smart-routing:

ug claude --enable-smart-routing

To turn it off for a launch, including when your admin enables it, launch with --disable-smart-routing.

To turn Smart Routing off or back on during a session, enter /smart-router off or /smart-router on.

With Smart Routing on, your agent hands off tasks to subagents. Each subagent's task is routed independently and can use a different model. The agent shows each subagent's selected model and, when available, the reason for the choice. The main session stays on its default model: your admin's default or smart default if one is set, otherwise the agent's configured default. To keep a task in the main session, ask the agent not to use subagents.

For automatic tool-call safety checks with Claude Code subagents using non-Anthropic foundation models hosted by Azure Databricks, see Auto mode.

To choose the model yourself, turn off Smart Routing with the session command above, then use /model. Changing the model with /model alone doesn't turn off Smart Routing.

Use Smart Routing in Omnigent

Omnigent can select both the coding harness and the model for a task, including work delegated to subagents. Use version v0.8.0 or later.

Configure Claude Code and Codex for your Azure Databricks workspace:

omni setup

Connect your computer to the Omnigent server:

omni host --server <workspace-url>

Replace <workspace-url> with your Azure Databricks workspace URL.

In the Omnigent UI, select Smart Routing as the harness to let it choose both the harness and model:

Selecting Smart Routing as the harness in Omnigent

To keep Claude Code or Codex, select that harness, open its gear menu, and choose Smart Routing for the model:

Selecting Smart Routing as the model in Omnigent

You can also enable model routing from the CLI for a chosen harness:

omni claude --smart-routing --server <workspace-url>
omni codex --smart-routing --server <workspace-url>

The Unity Gateway CLI routes among models within the selected supported harness. Omnigent also selects across harnesses; the omni claude and omni codex examples explicitly choose a harness.

Next steps