[GH-ISSUE #13756] Incorrect response schema in documentation for /api/ps and /api/tags #34778

Closed
opened 2026-04-22 18:36:55 -05:00 by GiteaMirror · 0 comments
Owner

Originally created by @songyang-dev on GitHub (Jan 17, 2026).
Original GitHub issue: https://github.com/ollama/ollama/issues/13756

What is the issue?

The documentation for the API endpoints /api/ps and /api/tags is incomplete. The response schemas are not correct.

/api/tags uses "name" for the model name, while /api/ps uses "model" for the model name. In reality, both are used in the schema according to the source code in 12719b6e87/api/types.go (L796):

// ListModelResponse is a single model description in [ListResponse].
type ListModelResponse struct {
	Name        string       `json:"name"`
	Model       string       `json:"model"`
	RemoteModel string       `json:"remote_model,omitempty"`
	RemoteHost  string       `json:"remote_host,omitempty"`
	ModifiedAt  time.Time    `json:"modified_at"`
	Size        int64        `json:"size"`
	Digest      string       `json:"digest"`
	Details     ModelDetails `json:"details,omitempty"`
}

// ProcessModelResponse is a single model description in [ProcessResponse].
type ProcessModelResponse struct {
	Name          string       `json:"name"`
	Model         string       `json:"model"`
	Size          int64        `json:"size"`
	Digest        string       `json:"digest"`
	Details       ModelDetails `json:"details,omitempty"`
	ExpiresAt     time.Time    `json:"expires_at"`
	SizeVRAM      int64        `json:"size_vram"`
	ContextLength int          `json:"context_length"`
}

I suggest an update to the schemas in the documentation pages for https://docs.ollama.com/api/ps and https://docs.ollama.com/api/tags to reflect the actual schema used by the source code!

Relevant log output


OS

No response

GPU

No response

CPU

No response

Ollama version

No response

Originally created by @songyang-dev on GitHub (Jan 17, 2026). Original GitHub issue: https://github.com/ollama/ollama/issues/13756 ### What is the issue? The documentation for the API endpoints `/api/ps` and `/api/tags` is incomplete. The response schemas are not correct. `/api/tags` uses "name" for the model name, while `/api/ps` uses "model" for the model name. In reality, both are used in the schema according to the source code in https://github.com/ollama/ollama/blob/12719b6e87e738f76d0456dd9a9d7571be58cb68/api/types.go#L796: ```ts // ListModelResponse is a single model description in [ListResponse]. type ListModelResponse struct { Name string `json:"name"` Model string `json:"model"` RemoteModel string `json:"remote_model,omitempty"` RemoteHost string `json:"remote_host,omitempty"` ModifiedAt time.Time `json:"modified_at"` Size int64 `json:"size"` Digest string `json:"digest"` Details ModelDetails `json:"details,omitempty"` } // ProcessModelResponse is a single model description in [ProcessResponse]. type ProcessModelResponse struct { Name string `json:"name"` Model string `json:"model"` Size int64 `json:"size"` Digest string `json:"digest"` Details ModelDetails `json:"details,omitempty"` ExpiresAt time.Time `json:"expires_at"` SizeVRAM int64 `json:"size_vram"` ContextLength int `json:"context_length"` } ``` I suggest an update to the schemas in the documentation pages for https://docs.ollama.com/api/ps and https://docs.ollama.com/api/tags to reflect the actual schema used by the source code! ### Relevant log output ```shell ``` ### OS _No response_ ### GPU _No response_ ### CPU _No response_ ### Ollama version _No response_
GiteaMirror added the bug label 2026-04-22 18:36:55 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#34778