Repository navigation
[3.0] Show readable model names in the Unity Gateway model picker - #2369
Open
louis-johnston-db wants to merge 1 commit into
Open
louis-johnston-db wants to merge 1 commit into
louis-johnston-db wants to merge 1 commit into
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
UnityGatewayModels.ts:toModelsetsnamefrom a newmodelDisplayName(id)instead of the bare service name. It strips thesystem.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, sogptisGPT, with no per-model list), and joins consecutive numeric segments with dots (claude-sonnet-5-5isClaude Sonnet 5.5; an existing dot such asgpt-5.1is kept).listModelspasses the models throughwithUniqueNames, 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.idandfamilydon't change, so requests and attribution stay the same. The fix over the previous draft: the namespace is removed by stripping the knownsystem.ai.prefix, not by splitting on dots that aren't followed by a digit, which keptAi.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 typecheckand 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.This pull request and its description were written by Isaac.