Add AWS Bedrock provider support - #26
Merged
Merged
Conversation
Route Nerve through AWS Bedrock instead of direct Anthropic API. All 4 API call paths (SDK sessions, memU, source condensation, title generation) now support the bedrock provider via a unified ProviderConfig and client factory methods on NerveConfig. - Add ProviderConfig dataclass with type/aws_region/aws_profile - Add create_anthropic_client() / create_async_anthropic_client() factory methods that return AnthropicBedrock when configured - Extend _build_env() to set CLAUDE_CODE_USE_BEDROCK=1 for the Claude Code CLI subprocess - Rewrite title generation to use SDK client (removes raw httpx) - Add configurable title_model to AgentConfig - Update bootstrap wizard with Bedrock option (interactive + non-interactive) - Update source condensation to support bedrock provider
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
bedrock:InvokeModel*is needed — zero API keysNERVE_PROVIDER=bedrock)Changes
nerve/config.py— NewProviderConfigdataclass (type,aws_region,aws_profile, optional explicit creds).create_anthropic_client()/create_async_anthropic_client()factory methods onNerveConfigthat returnAnthropicBedrockor standardAnthropicbased on config. Newtitle_modelfield onAgentConfig.nerve/agent/engine.py—_build_env()setsCLAUDE_CODE_USE_BEDROCK=1+ AWS env vars for the CLI subprocess. Title generation rewritten to use SDK client (removes raw httpx, uses configurabletitle_model).nerve/memory/memu_bridge.py—_get_anthropic_client()delegates to config factory.nerve/sources/runner.py+registry.py— Condense client supportsprovider=bedrock→AsyncAnthropicBedrock.nerve/bootstrap.py— Option 3 (Bedrock) in wizard,_step_bedrock_setup(), Bedrock model IDs in generated config,NERVE_PROVIDER=bedrockfor non-interactive/Docker setup.Usage
Test plan
pytest tests/ -v— 325 passed (1 pre-existing HoA failure, unrelated)provider:YAML block →ProviderConfigwith defaults_build_env()setsCLAUDE_CODE_USE_BEDROCK=1when provider is bedrock