mirror of
https://github.com/ollama/ollama.git
synced 2026-04-18 01:54:17 +02:00
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:
@@ -20,6 +20,7 @@ import (
|
||||
|
||||
"github.com/ollama/ollama/api"
|
||||
internalcloud "github.com/ollama/ollama/internal/cloud"
|
||||
"github.com/ollama/ollama/internal/modelref"
|
||||
"github.com/ollama/ollama/progress"
|
||||
"github.com/ollama/ollama/readline"
|
||||
"github.com/ollama/ollama/types/model"
|
||||
@@ -43,7 +44,7 @@ const (
|
||||
// isLocalModel checks if the model is running locally (not a cloud model).
|
||||
// TODO: Improve local/cloud model identification - could check model metadata
|
||||
func isLocalModel(modelName string) bool {
|
||||
return !strings.HasSuffix(modelName, "-cloud")
|
||||
return !modelref.HasExplicitCloudSource(modelName)
|
||||
}
|
||||
|
||||
// isLocalServer checks if connecting to a local Ollama server.
|
||||
|
||||
@@ -22,12 +22,22 @@ func TestIsLocalModel(t *testing.T) {
|
||||
},
|
||||
{
|
||||
name: "cloud model",
|
||||
modelName: "gpt-4-cloud",
|
||||
modelName: "gpt-oss:latest-cloud",
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
name: "cloud model with :cloud suffix",
|
||||
modelName: "gpt-oss:cloud",
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
name: "cloud model with version",
|
||||
modelName: "claude-3-cloud",
|
||||
modelName: "gpt-oss:20b-cloud",
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
name: "cloud model with version and :cloud suffix",
|
||||
modelName: "gpt-oss:20b:cloud",
|
||||
expected: false,
|
||||
},
|
||||
{
|
||||
@@ -134,7 +144,7 @@ func TestTruncateToolOutput(t *testing.T) {
|
||||
{
|
||||
name: "long output cloud model - uses 10k limit",
|
||||
output: string(localLimitOutput), // 20k chars, under 10k token limit
|
||||
modelName: "gpt-4-cloud",
|
||||
modelName: "gpt-oss:latest-cloud",
|
||||
host: "",
|
||||
shouldTrim: false,
|
||||
expectedLimit: defaultTokenLimit,
|
||||
@@ -142,7 +152,7 @@ func TestTruncateToolOutput(t *testing.T) {
|
||||
{
|
||||
name: "very long output cloud model - trimmed at 10k",
|
||||
output: string(defaultLimitOutput),
|
||||
modelName: "gpt-4-cloud",
|
||||
modelName: "gpt-oss:latest-cloud",
|
||||
host: "",
|
||||
shouldTrim: true,
|
||||
expectedLimit: defaultTokenLimit,
|
||||
|
||||
Reference in New Issue
Block a user