Skip to content

[3.0] Show readable model names in the Unity Gateway model picker - #2369

Open
louis-johnston-db wants to merge 1 commit into
release/3.xfrom
unity-gateway/readable-model-names
Open

louis-johnston-db wants to merge 1 commit into
release/3.xfrom
unity-gateway/readable-model-names

Conversation

@louis-johnston-db

Copy link
Copy Markdown
Contributor

Changes

UnityGatewayModels.ts: toModel sets name from a new modelDisplayName(id) instead of the bare service name. It strips the system.ai. namespace (the schema the models are listed from), splits on -, title-cases each word, writes a word with no vowel in capitals (read letter by letter, so gpt is GPT, with no per-model list), and joins consecutive numeric segments with dots (claude-sonnet-5-5 is Claude Sonnet 5.5; an existing dot such as gpt-5.1 is kept). listModels passes the models through withUniqueNames, which falls back to the id for any models that would share a name, so the picker never shows two entries it can't tell apart. id and family don't change, so requests and attribution stay the same. The fix over the previous draft: the namespace is removed by stripping the known system.ai. prefix, not by splitting on dots that aren't followed by a digit, which kept Ai. in names whose slug starts with a digit.

Tests

UnityGatewayModels.test.ts: added a test that names models from their service names (Claude Sonnet 5.5, DBRX Instruct, GLM 4.7, GPT 5.1 Codex, Llama 4 Maverick, Model 2026.01.15, and 3 Foo for a slug that starts with a digit, which covers the review finding), and a test that colliding names (gpt-5-1 and gpt-5.1) fall back to their ids while a unique one keeps its name. Updated the existing expectations that pinned the service name as the name to the new readable names, in UnityGatewayModels.test.ts and unityGatewayChat.test.ts, as the gap asks. Ran yarn workspace databricks typecheck and vitest on both test files; all pass, and oxfmt --check is clean on the touched folders.

Evidence:

  • yarn workspace databricks typecheck: passed; oxlint on the changed files: passed.
  • The changed test files pass with the change: 2 of 2.
  • With only the production change reversed, each changed test file fails: 2 of 2.

This pull request and its description were written by Isaac.

Unity Gateway models now get a readable name in the model picker, derived from the service name with a generic transform: the system.ai. namespace is dropped, words are title-cased (vowel-less words such as gpt, glm, dbrx are written in capitals), and a run of numeric segments becomes a dotted version, so system.ai.claude-sonnet-5-5 shows as Claude Sonnet 5.5. The id stays the service name. Models whose names would collide show their ids instead. This builds on the rejected draft and fixes its blocking finding: only the known system.ai. prefix is stripped, so a slug starting with a digit (system.ai.3-foo) becomes 3 Foo rather than keeping part of the namespace.

Co-authored-by: Isaac <no-reply@databricks.com>

This branch was successfully deployed

1 active deployment
test-trigger-is — 4a3599cc Deployed Nov 30, 2026 by louis-johnston-db via Trigger Tests #2641
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant