0.21.0: Explicitly pass model, base_url and api_key to agent builder instead of relying on env vars. - #49
Merged
Merged
Conversation
…DEL env var. agent_builder and init_agent now take the model slug as a parameter, and init_observability takes it for the global 'model' metric label (falling back to 'unknown' only for an empty string). The library no longer reads the MODEL environment variable anywhere; BASE_URL and API_KEY remain env-based. All examples read MODEL themselves and pass it through, so their documented .env workflow is unchanged.
agent_builder and init_agent now take the inference endpoint and credentials explicitly, so the library core reads no configuration from the process environment at all. The new agent_builder_from_env / init_agent_from_env conveniences keep the one-liner ergonomics for binaries following the BASE_URL/API_KEY env convention; all examples use them, so their documented .env workflow is unchanged. (The Prometheus exporter's INSTANCE fleet-identity label, with its hostname-pid fallback, deliberately stays env-based.)
MathisWellmann
force-pushed
the
envs
branch
2 times, most recently
from
July 25, 2026 13:41
929f44f to
a2da2bb
Compare
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.
Changes:
modeltoagent_builderinstead of loading it from env varMODELbase_url,api_keyas well inagent_bulder.agent_builder_from_envwhich loadsBASE_URLandAPI_KEYlike before inagent_builder