Reapply "don't require pulling stubs for cloud models" again (#14608)

* Revert "Revert "Reapply "don't require pulling stubs for cloud models"" (#14606)"

This reverts commit 39982a954e.

* fix test + do cloud lookup only when seeing cloud models

---------

Co-authored-by: ParthSareen <parth.sareen@ollama.com>
This commit is contained in:
Jeffrey Morgan
2026-03-06 14:27:47 -08:00
committed by GitHub
parent 1af850e6e3
commit 4eab60c1e2
25 changed files with 2862 additions and 146 deletions

View File

@@ -1276,35 +1276,17 @@ func TestDroidEdit_LocalModelDefaultMaxOutput(t *testing.T) {
func TestDroidEdit_CloudModelLimitsUsed(t *testing.T) {
// Verify that every cloud model in cloudModelLimits has a valid output
// value that would be used for maxOutputTokens when isCloudModel returns true.
// Cloud suffix normalization must also work since integrations may see either
// :cloud or -cloud model names.
// value that would be used for maxOutputTokens when the selected model uses
// the explicit :cloud source tag.
for name, expected := range cloudModelLimits {
t.Run(name, func(t *testing.T) {
l, ok := lookupCloudModelLimit(name)
if !ok {
t.Fatalf("lookupCloudModelLimit(%q) returned false", name)
}
if l.Output != expected.Output {
t.Errorf("output = %d, want %d", l.Output, expected.Output)
}
// Also verify :cloud suffix lookup
cloudName := name + ":cloud"
l2, ok := lookupCloudModelLimit(cloudName)
l, ok := lookupCloudModelLimit(cloudName)
if !ok {
t.Fatalf("lookupCloudModelLimit(%q) returned false", cloudName)
}
if l2.Output != expected.Output {
t.Errorf(":cloud output = %d, want %d", l2.Output, expected.Output)
}
// Also verify -cloud suffix lookup
dashCloudName := name + "-cloud"
l3, ok := lookupCloudModelLimit(dashCloudName)
if !ok {
t.Fatalf("lookupCloudModelLimit(%q) returned false", dashCloudName)
}
if l3.Output != expected.Output {
t.Errorf("-cloud output = %d, want %d", l3.Output, expected.Output)
if l.Output != expected.Output {
t.Errorf("output = %d, want %d", l.Output, expected.Output)
}
})
}