feat(engine): direct Anthropic/Bedrock provider seam#2
Open
imlach wants to merge 1 commit into
Open
Conversation
Adds LLM_PROVIDER (ReviewerConfig.llm_provider, default "openai-compatible") so an adopter with only an Anthropic API key or AWS credentials can run cora with no LiteLLM/OpenAI-compatible gateway in between. make_review_agent branches on the provider to build a pydantic-ai AnthropicModel or BedrockConverseModel instead of the stock OpenAIChatModel; the default path is untouched. Both direct-SDK paths drop non-default sampling parameters and the vLLM enable_thinking extra_body toggle (current Claude models reject one and no-op the other) via a new build_model_settings() helper, and fall back to the provider response's own model_name for the resolved_model check-run chip when no x-litellm-* headers are present (there's no gateway to emit them). New optional extras cora[anthropic] / cora[bedrock]; both imports are lazy so the default install never requires them.
cora review — skippedMCP server unreachable soft-fail by design |
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
LLM_PROVIDER(ReviewerConfig.llm_provider, defaultopenai-compatible) so an adopter with only an Anthropic API key or AWS credentials can run cora with no LiteLLM/OpenAI-compatible gateway in between —make_review_agentbranches on the provider to build a pydantic-aiAnthropicModel/BedrockConverseModelinstead of the stockOpenAIChatModel; the default path is byte-identical.enable_thinkingextra_body toggle (current Claude models reject one and no-op the other) via a newbuild_model_settings()helper, and fall back to the provider response's ownmodel_namefor theresolved_modelcheck-run chip when there are nox-litellm-*headers to read.cora[anthropic]/cora[bedrock]; both imports are lazy, so the default install never requires them.docs/configuration.md) and CHANGELOG updated.Test plan
pytest -q— 572 passed, 1 skipped (existing 539 untouched + 33 new), on Python 3.11 and the local interpreter, with and without theanthropic/bedrockextras installedruff check .cleanAgentConfig(provider="anthropic")builds anAnthropicModelpointed athttps://api.anthropic.comby default (ignores thelocalhost:4000gateway placeholder) and respects an explicitLITELLM_BASE_URLoverride;AgentConfig(provider="bedrock")builds aBedrockConverseModelwith theanthropic.model-ID prefix applied automaticallyImportErrorwith apip install 'cora[anthropic|bedrock]'message when the extra isn't installed (simulated viasys.modulesinjection, and against a clean venv without the extras)