Skip to content

Add AWS Bedrock support to the LLM setup#47

Open
pmanczak wants to merge 1 commit into
IntelLabs:mainfrom
pmanczak:pmanczak/bedrock-token-support
Open

Add AWS Bedrock support to the LLM setup#47
pmanczak wants to merge 1 commit into
IntelLabs:mainfrom
pmanczak:pmanczak/bedrock-token-support

Conversation

@pmanczak

Copy link
Copy Markdown

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.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant