@@ -87,23 +87,28 @@ function inject_cli_proxy_endpoints!(provider_name::String="cli_proxy_api")
8787 for (or_model_id, meta) in PROXY_ONLY_MODELS
8888 haskey (cache. models, or_model_id) && continue
8989 native_id = get (MODEL_MAP_REVERSE, or_model_id, or_model_id)
90- endpoint = ProviderEndpoint (;
91- name = native_id,
92- model_name = native_id,
93- context_length = meta. context_length,
94- pricing = meta. pricing,
95- provider_name = provider_name,
96- tag = provider_name,
97- quantization = nothing ,
98- max_completion_tokens = meta. context_length,
99- max_prompt_tokens = nothing ,
100- supported_parameters = nothing ,
101- uptime_last_30m = nothing ,
102- supports_implicit_caching = nothing ,
103- status = nothing
104- )
90+ # Derive original provider from model ID (e.g. "openai" from "openai/gpt-5.3-codex-spark")
91+ orig_provider = split (or_model_id, " /" )[1 ]
92+ endpoints = ProviderEndpoint[]
93+ for (pname, ptag) in [(orig_provider, orig_provider), (provider_name, provider_name)]
94+ push! (endpoints, ProviderEndpoint (;
95+ name = native_id,
96+ model_name = native_id,
97+ context_length = meta. context_length,
98+ pricing = meta. pricing,
99+ provider_name = pname,
100+ tag = ptag,
101+ quantization = nothing ,
102+ max_completion_tokens = meta. context_length,
103+ max_prompt_tokens = nothing ,
104+ supported_parameters = nothing ,
105+ uptime_last_30m = nothing ,
106+ supports_implicit_caching = nothing ,
107+ status = nothing
108+ ))
109+ end
105110 model = OpenRouterModel (or_model_id, meta. name, " CLI proxy only model" , meta. context_length, meta. pricing, nothing , nothing )
106- providers = ModelProviders (or_model_id, meta. name, nothing , nothing , nothing , [endpoint] )
111+ providers = ModelProviders (or_model_id, meta. name, nothing , nothing , nothing , endpoints )
107112 cache. models[or_model_id] = CachedModel (model, providers, now (), true )
108113 count += 1
109114 end
@@ -213,12 +218,13 @@ function setup_cli_proxy!(;
213218 " CLI Proxy API - routes to local proxy"
214219 )
215220
221+ # Always register proxy-only models + inject endpoints (even in mutate mode)
222+ count = inject_cli_proxy_endpoints! (provider_name)
223+
216224 if mutate
217225 override_providers! (base_url, api_key_env_var; verbose)
218226 end
219227
220- count = mutate ? 0 : inject_cli_proxy_endpoints! (provider_name)
221-
222228 verbose && @info " CLI Proxy setup complete" provider_name base_url mutate
223229 return count
224230end
0 commit comments