Skip to content

Commit 061559d

Browse files
committed
Make setup_cli_proxy! quiet by default, add verbose kwarg
1 parent 4732949 commit 061559d

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

src/OpenRouterCLIProxyAPI.jl

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ end
107107
108108
Override anthropic and openai providers to route through cli_proxy_api.
109109
"""
110-
function override_providers!(base_url::String, api_key_env_var::String)
110+
function override_providers!(base_url::String, api_key_env_var::String; verbose::Bool=false)
111111
schemas = Dict("anthropic" => ChatCompletionAnthropicSchema(), "openai" => ChatCompletionSchema())
112112
for name in ("anthropic", "openai")
113113
set_provider!(
@@ -121,7 +121,7 @@ function override_providers!(base_url::String, api_key_env_var::String)
121121
"$name (overridden to cli_proxy_api)"
122122
)
123123
end
124-
@info "Overrode anthropic and openai providers to route through cli_proxy_api"
124+
verbose && @info "Overrode anthropic and openai providers to route through cli_proxy_api"
125125
end
126126

127127
# ============ Setup ============
@@ -140,12 +140,14 @@ Complete setup for CLI proxy:
140140
141141
Set `mutate=true` to override original providers (anthropic, openai) to route through cli_proxy_api.
142142
This allows `anthropic:anthropic/claude-sonnet-4.5` to transparently route through the proxy.
143+
Set `verbose=true` to log setup details.
143144
"""
144145
function setup_cli_proxy!(;
145146
base_url::String = "http://localhost:8317/v1",
146147
api_key_env_var::String = "CLIPROXYAPI_API_KEY",
147148
provider_name::String = "cli_proxy_api",
148-
mutate::Bool = false
149+
mutate::Bool = false,
150+
verbose::Bool = false
149151
)
150152
# Always register cli_proxy_api provider
151153
add_provider(
@@ -160,12 +162,12 @@ function setup_cli_proxy!(;
160162
)
161163

162164
if mutate
163-
override_providers!(base_url, api_key_env_var)
165+
override_providers!(base_url, api_key_env_var; verbose)
164166
end
165167

166168
count = mutate ? 0 : inject_cli_proxy_endpoints!(provider_name)
167169

168-
@info "CLI Proxy setup complete" provider_name base_url mutate
170+
verbose && @info "CLI Proxy setup complete" provider_name base_url mutate
169171
return count
170172
end
171173

0 commit comments

Comments
 (0)