mirror of
https://github.com/ollama/ollama.git
synced 2026-04-18 00:03:27 +02:00
cmd/config: fix cloud model limit lookups in integrations (#14650)
This commit is contained in:
@@ -26,17 +26,15 @@ type cloudModelLimit struct {
|
||||
}
|
||||
|
||||
// lookupCloudModelLimit returns the token limits for a cloud model.
|
||||
// It tries the exact name first, then strips the ":cloud" suffix.
|
||||
// It normalizes common cloud suffixes before checking the shared limit map.
|
||||
func lookupCloudModelLimit(name string) (cloudModelLimit, bool) {
|
||||
// TODO(parthsareen): migrate to using cloud check instead.
|
||||
for _, suffix := range []string{"-cloud", ":cloud"} {
|
||||
name = strings.TrimSuffix(name, suffix)
|
||||
}
|
||||
if l, ok := cloudModelLimits[name]; ok {
|
||||
return l, true
|
||||
}
|
||||
base := strings.TrimSuffix(name, ":cloud")
|
||||
if base != name {
|
||||
if l, ok := cloudModelLimits[base]; ok {
|
||||
return l, true
|
||||
}
|
||||
}
|
||||
return cloudModelLimit{}, false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user