fix(ollama): optimize cloud model requests to avoid proxy timeouts#1522
Merged
corvid-agent merged 3 commits intomainfrom Mar 27, 2026
Merged
fix(ollama): optimize cloud model requests to avoid proxy timeouts#1522corvid-agent merged 3 commits intomainfrom
corvid-agent merged 3 commits intomainfrom
Conversation
Cloud-proxied Ollama models (like Nemotron) were timing out because requests included local-only GPU params and oversized system prompts. - Add isCloudModel() helper to detect non-localhost Ollama hosts - Skip num_gpu/num_batch and cap num_predict at 1024 for cloud models - Add compact prompt variants (~1/3 token count) for cloud models - Skip codebase context prompt for cloud models (inferred from reads) - Fix nemotron missing from TEXT_BASED_FAMILIES in tool-prompt-templates - Update spec to document isCloudModel and compact prompts Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
Add getCompactToolInstructionPrompt, getCompactResponseRoutingPrompt, and getCompactCodingToolPrompt to the spec's public API table. Add invariant #12 for cloud model compact prompts. Update Consumed By section. Remove duplicate getCodebaseContextPrompt entry. Update TEXT_BASED_FAMILIES list in invariant #2. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add tests for getCompactToolInstructionPrompt, getCompactResponseRoutingPrompt, getCompactCodingToolPrompt, and OllamaProvider.isCloudModel to satisfy codecov/patch coverage requirements. 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
isCloudModel()static helper to detect non-localhost Ollama hostsnum_gpu,num_batch) and capnum_predictat 1024 for cloud modelsgetCodebaseContextPrompt()for cloud models (inferred from file reads)nemotronmissing fromTEXT_BASED_FAMILIESin tool-prompt-templatesTest plan
bun x tsc --noEmit --skipLibCheck)bun run spec:check)🤖 Generated with Claude Code