Repository navigation
Conversation
…dpoint Providers that can determine their endpoint now expose it via a `base_url` attribute, discovered from the SDK client or construction arguments: the whole OpenAI-compatible family (via OpenAIAbstractProvider), Anthropic, Google (from the genai client's resolved HTTP options), all three Bedrock flavors, Posit (per-flavor URL), Databricks, and Snowflake (from the connection's account host). Providers that can't determine it leave it as None. Groundwork for richer telemetry (e.g. the OpenTelemetry server.address/server.port attributes), and handy for confirming which endpoint a provider resolved.
The Provider.base_url property is typed str | None; these providers always set it from a required constructor argument, so assert the invariant.
cpsievert
force-pushed
the
provider-base-url
branch
from
October 21, 2026 16:33
7be227e to
c4a46c9
Compare
This branch has not been 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.
Summary
Providers that can determine their endpoint now expose it via a
base_urlattribute (chat.provider.base_url), discovered from the SDK client or construction arguments. This is groundwork for richer telemetry (the OpenTelemetryserver.address/server.portattributes, coming in a follow-up PR) and is handy for confirming which endpoint a provider resolved.Provider.__init__accepts an optionalbase_url, exposed as a property with a setter (providers like LM Studio/Ollama that already assignedself.base_urlkeep working unchanged).OpenAIAbstractProviderconstruction point (plus post-replacement updates in the Azure, Databricks, and Bedrock Responses providers), Anthropic, Google (from the genai client's resolved HTTP options), all three Bedrock flavors, Posit (per-flavor URL), and Snowflake (from the session's account host, best-effort). Providers that can't determine their endpoint leave it asNone.Verification
New
tests/test_provider_base_url.pycovers theNonedefault, OpenAI, a completions-chain provider (Groq), Anthropic, Google, and Bedrock Converse. Full test suite (1346 passed), ruff, and pyright pass locally.