Repository navigation
The Tuner runs on OpenAI, Claude or a local Ollama model - #20
Merged
Merged
Conversation
SLM_AGENT_PROVIDER now picks the model for every agent, the Tuner and its specialists included. tuner/models.py hands Agent(model=...) the provider's model: the OpenAI model name as before (Responses API), a LitellmModel for Claude (the Agents SDK's LiteLLM extension), or an OpenAIChatCompletionsModel on Ollama's OpenAI-compatible endpoint (experimental). The prompts, tools and settings are unchanged for all three. prepare_sdk() replaces the OpenAI-only setup before a turn, raising with the exact .env path when the provider's key is missing; readiness, the key badge and the Tuner header follow the provider. The default Claude model is claude-fable-5-1. Checked live: OpenAI (gpt-6-luna) and Ollama (qwen2.5:1.5b) each streamed text, called a tool, kept session memory and returned a structured report; the LiteLLM route did the same against local Ollama (with drop_params for unsupported settings); and a real Tuner turn ran on Ollama in a scratch server. Anthropic itself wasn't called (no key on this Mac). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: engagepy <42845567+engagepy@users.noreply.github.com>
Validating Claude with the owner's new key, the Anthropic account had no credit, and the Tuner
showed "BadRequestError: litellm.BadRequestError: AnthropicException - b'{...}'". readable_error()
pulls out the provider's own message and names the provider ("Anthropic said: Your credit balance
is too low ..."); errors that aren't from a provider keep their text.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: engagepy <42845567+engagepy@users.noreply.github.com>
Owner
Author
|
Validated with the owner's Anthropic key. The Claude route is wired end to end: LiteLLM reaches Anthropic, which accepts the key and then refuses with Your credit balance is too low to access the Anthropic API. The Anthropic account has no credit yet, so no Claude model answered. The judge's direct Anthropic SDK path reaches the same billing gate. Also added: the Tuner now shows that kind of failure as one plain line ("Anthropic said: …") instead of LiteLLM's wrapped exception, with a regression test. 214 tests pass. Once credit is added, one Tuner message with |
Merged
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.
SLM_AGENT_PROVIDERnow picks the model for every agent, the Tuner and its specialists (DataScout, DataPrep) included. Before, they were OpenAI-only.openai(default)OPENAI_API_KEYgpt-6-lunaon the Responses API, unchangedclaudeANTHROPIC_API_KEYclaude-fable-5-1through the Agents SDK's LiteLLM extension (openai-agents[litellm])ollama(experimental)qwen2.5:7b-instructby defaultHow:
tuner/models.pyreturns what goes inAgent(model=...): a name for OpenAI, aLitellmModelor anOpenAIChatCompletionsModelotherwise. The SDK's runner, sessions, streaming and structured outputs are untouched.prepare_sdk()replaces the OpenAI-only setup before each turn. If the provider's key is missing, it raises with the exact.envpath.Checked live:
gpt-6-luna: ✓qwen2.5:1.5b: ✓drop_params).ANTHROPIC_API_KEYon this Mac. Worth one real turn with a key before calling Claude supported.213 tests pass, ruff clean, web build clean. README, AGENTS.md,
.env.exampleand CHANGELOG updated.🤖 Generated with Claude Code