Skip to content

Switch model display format from model__provider to provider__model#28

Merged
BillJr99 merged 1 commit into
mainfrom
claude/reverse-provider-model-format
May 25, 2026
Merged

Switch model display format from model__provider to provider__model#28
BillJr99 merged 1 commit into
mainfrom
claude/reverse-provider-model-format

Conversation

@BillJr99
Copy link
Copy Markdown
Owner

Summary

This PR changes the model display format advertised by GET /v1/models from model__provider to provider__model, making it consistent with the canonical provider/model slash form used throughout the codebase. The change improves readability in logs, configs, and client menus by putting the provider name first in both formats.

Key Changes

  • Display format change: Virtual and proxied models now advertise as provider__model instead of model__provider

    • Example: ollama__qwen2.5vl:3b instead of qwen2.5vl:3b__ollama
    • Virtual models: llmproxy__free, llmproxy__standard/local, etc. instead of llmproxy/free, llmproxy/standard/local
  • Backward compatibility: All three legacy input formats continue to resolve:

  • Virtual model handling: Split _VIRTUAL_MODELS into _NEW_VIRTUAL_MODELS (advertised) and _LEGACY_VIRTUAL_MODELS (accepted as input), with the combined set used for membership checks

  • Resolver logic: Updated _resolve_provider() to try the new provider__model form first, then fall back to legacy model__provider form when parsing double-underscore IDs

  • Helper function: Added _strip_virtual_prefix() to handle both llmproxy__ and legacy llmproxy/ prefixes when dispatching virtual model requests

Implementation Details

  • The display format change is purely cosmetic for the advertised form; routing and upstream forwarding logic remains unchanged
  • The route cache is populated by /v1/models with the new format, so cache lookups work correctly without parsing
  • Cold-cache fallback parsing intelligently detects which side of __ is the provider by checking against configured providers
  • All test files and documentation updated to reflect the new primary form while acknowledging legacy input support
  • Virtual model IDs use the same __ separator as regular models for consistency and to ensure strict client validators accept them

https://claude.ai/code/session_018vws2p6bhd3xESL3Jx4S3h

…xy__

Display form changes:
- Provider models: model__provider -> provider__model
  (e.g. qwen2.5vl:3b__ollama -> ollama__qwen2.5vl:3b)
- Virtual models: llmproxy/* -> llmproxy__*
  (e.g. llmproxy/deep/free -> llmproxy__deep/free; inner / kept)

Putting the namespace prefix on the left mirrors the canonical
provider/model slash form, so display ids and configs read in the
same order everywhere.

Input compatibility widened: every endpoint resolves all four forms:
  provider/model               (canonical slash form)
  provider__model              (current display form)
  model__provider              (PR #27 legacy form)
  model (provider)             (pre-PR #27 legacy form)

The legacy llmproxy/free, llmproxy/deep/free, etc. virtual ids stay
in _VIRTUAL_MODELS so pinned client configs keep working; only the
new llmproxy__* form is advertised in /v1/models.

Tests, README, smoke client, and the test_tui helper updated to use
the new forms while exercising legacy compatibility paths.
@BillJr99 BillJr99 merged commit 34d798a into main May 25, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants