Add AWS Bedrock support to the LLM setup#47
Open
pmanczak wants to merge 1 commit into
Open
Conversation
Extract the DSPy/LiteLLM configuration shared by the CLI and the pipeline into a new xe_forge.llm_setup.configure_dspy helper, and add an AWS Bedrock path selected automatically when the model id is prefixed with "bedrock/". The OpenAI-compatible path is unchanged (still uses the Responses API and an optional api_base/api_key). Bedrock uses the Converse (chat) API instead, omits the OpenAI api_base, and resolves its region from AWS_REGION_NAME/AWS_REGION (default us-east-1). Credentials are never read or stored in code: LiteLLM picks them up from the standard AWS env vars (AWS_BEARER_TOKEN_BEDROCK or AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY). Both call sites (_setup_dspy in cli.py and _setup_llm in pipeline.py) now delegate to the shared helper, removing the duplicated setup. Co-authored-by: Claude
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.
Extract the DSPy/LiteLLM configuration shared by the CLI and the pipeline into a new xe_forge.llm_setup.configure_dspy helper, and add an AWS Bedrock path selected automatically when the model id is prefixed with "bedrock/".
The OpenAI-compatible path is unchanged (still uses the Responses API and an optional api_base/api_key). Bedrock uses the Converse (chat) API instead, omits the OpenAI api_base, and resolves its region from AWS_REGION_NAME/AWS_REGION (default us-east-1). Credentials are never read or stored in code: LiteLLM picks them up from the standard AWS env vars (AWS_BEARER_TOKEN_BEDROCK or AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY).
Both call sites (_setup_dspy in cli.py and _setup_llm in pipeline.py) now delegate to the shared helper, removing the duplicated setup.