feat: add Claude Code CLI as LLM backend#460
Open
themoddedcube wants to merge 2 commits intoalgorithmicsuperintelligence:mainfrom
Open
feat: add Claude Code CLI as LLM backend#460themoddedcube wants to merge 2 commits intoalgorithmicsuperintelligence:mainfrom
themoddedcube wants to merge 2 commits intoalgorithmicsuperintelligence:mainfrom
Conversation
Adds ClaudeCodeLLM, a new LLM provider that uses the Claude Code CLI (`claude -p`) for generation. This enables OpenEvolve to use Anthropic's Claude models without requiring direct API keys — authentication is handled by the CLI's existing OAuth session. Users can configure it via `provider: "claude_code"` in config.yaml or by injecting `init_claude_code_client` programmatically. Includes a provider registry in LLMEnsemble for automatic backend selection. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
|
…laude Code backend Add retry/retry_delay support to ClaudeCodeLLM mirroring the OpenAI backend pattern. Expose max_budget_usd in LLMModelConfig so it can be set via YAML. Add claude_code_quickstart example and document the Claude Code CLI provider in the README. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
ClaudeCodeLLM, a new LLM provider that uses the Claude Code CLI (claude -p) as a subprocess for generationclaude login)providerfield toLLMModelConfigand a provider registry inLLMEnsemblefor automatic backend selectionUsage
Config-based (no code changes needed):
Programmatic (for custom setups):
Files changed
openevolve/llm/claude_code.pyClaudeCodeLLMclass +init_claude_code_clientfactoryopenevolve/llm/__init__.pyopenevolve/llm/ensemble.py_create_model()dispatchopenevolve/config.pyproviderfield toLLMModelConfigtests/test_claude_code_llm.pyTest plan
requestsmodule, integration tests needing API keys)claudeCLI installed and authenticated🤖 Generated with Claude Code