Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

We don’t pass the anthropic base URL to the LiteLLM AnthropicCompletion class #893

@alex-mcgovern

Description

@alex-mcgovern

Describe the issue

While debugging prompt caching for Cline+Anthropic, we noticed that we aren't actually passing the Anthropic base URL from config / CLI flags to the litellm AnthropicCompletion class.

e.g. poetry run codegate serve --anthropic-url=http://127.0.0.1:8080/
e.g. CODEGATE_PROVIDER_ANTHROPIC_URL=http://127.0.0.1:8080/ poetry run codegate serve

You can workaround this by setting ANTHROPIC_BASE_URL, which is an in-built behaviour of litellm (and also undocumented). @kantord figured this out from this docs link for langsmith

Steps to Reproduce

  • export a CODEGATE_PROVIDER_ANTHROPIC_URL (as mentioned in config.yaml.example
    OR
  • start the server with --anthropic-url flag

If, for example, you've pointed the URL at something like mitmproxy, you should notice that the requests pass straight through to anthropic, without respecting your config.

Operating System

Linux (Intel)

IDE and Version

VS CODE 1.9.5.3

Extension and Version

Cline v3.2.12

Provider

Anthropic

Model

claude-3-5-sonnet

Codegate version

CodeGate 0.1.7 (as returned by codegate version), 0ed1365

Logs

No response

Additional Context

No response

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions