api: return model capabilities from the show endpoint (#10066)

With support for multimodal models becoming more varied and common it is important for clients to be able to easily see what capabilities a model has. Retuning these from the show endpoint will allow clients to easily see what a model can do.
This commit is contained in:
Bruce MacDonald 2025-04-01 15:21:46 -07:00 committed by GitHub
parent c001b98087
commit e172f095ba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 521 additions and 69 deletions

View file

@ -20,6 +20,7 @@ import (
"github.com/ollama/ollama/format"
"github.com/ollama/ollama/fs/ggml"
"github.com/ollama/ollama/llm"
"github.com/ollama/ollama/types/model"
)
type LlmRequest struct {
@ -195,7 +196,7 @@ func (s *Scheduler) processPending(ctx context.Context) {
}
// Embedding models should always be loaded with parallel=1
if pending.model.CheckCapabilities(CapabilityCompletion) != nil {
if pending.model.CheckCapabilities(model.CapabilityCompletion) != nil {
numParallel = 1
}