feat/issue65 llm providers#69
Open
ar7casper wants to merge 2 commits into
Open
Conversation
Collaborator
ar7casper
commented
May 24, 2026
- feat(openant-core,openant-cli): pluggable LLM adapter framework + multi-provider support (issue [feat] Enable OpenAnt to work with non-Claude LLMs (Qwen, Kimi, local models, etc.) #65)
- docs: README + CHANGELOG for multi-provider work
…ti-provider support (issue #65) Replaces the hardcoded AnthropicClient wrapper used across 15+ files with a Protocol-based adapter layer. Each pipeline phase (analyze, enhance, verify, report, dynamic_test, llm_reach, app_context) resolves to a (provider, model) pair via a registry built from ~/.config/openant/config.json. Adapter framework (libs/openant-core/utilities/llm/): * adapter.py LLMAdapter Protocol, unified content blocks, 5-class error taxonomy * config.py v2 schema with v1->v2 migration of legacy api_key * builtins.py frozen openant-default config pinning today's Claude defaults * registry.py PhaseRegistry with eager adapter instantiation + probe validation * helpers.py simple_text + lookup_pricing shortcuts Shipped adapters (providers/): * anthropic.py reference impl, full tool calling, per-model pricing * openai.py Chat Completions, splits one-user-with-N-tool-results into N role=tool messages * google.py Gemini via google-genai, function_call/function_response Part translation All three support tool calling. 33-test contract harness runs against all three. Setup wizard (apps/openant-cli/cmd/setup.go): * `openant setup llm` walks per-phase provider+model selection * Per-phase per-provider model defaults + known-models hint * 1-token probe per unique (provider, model) before save * OpenAI ChatGPT/Codex-vs-API-key heads-up Go CLI: * --model opus/sonnet replaced by --llm-config <name> on analyze/scan/enhance/verify/dynamic-test/report * internal/config/config.go gains WriteLLMConfig + raw-map round-trip preserving v2 fields * set-api-key refactored to share the probe helper now used by the wizard Pipeline migration: * Every AnthropicClient call site (15+ files) replaced with PhaseBinding threading * Scanner builds the registry once and probes upfront; standalone verbs build their own * Defensive _coerce_to_str in reporter so non-string fields from GPT-style responses don't crash report generation (analyze prompt also tightened to require string types) Closes #65. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
README: * Replace "Using a non-Anthropic provider" with "Setting up an LLM" that leads with the `openant setup llm` wizard * Shipped-adapters table (Anthropic, OpenAI, Google) with subscription-vs-API caveats per provider * 7-phase sample config (with `app_context`) * New Roadmap section: more adapters, OAuth subscription auth, cross-provider tool-call quirks, more languages, hosted scan service CHANGELOG: bring [2026-05-24] entry in line with reality — add OpenAI/Google adapters, the setup wizard, the contract harness, the reporter coercion fix, and the seventh `app_context` phase that the original entry didn't mention. Co-Authored-By: Claude Opus 4.7 (1M context) <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.