8000 Add /api/models/size endpoint to report total storage usage by cd-Ishita · Pull Request #13213 · ollama/ollama · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@cd-Ishita
Copy link

Description

Adds a new /api/models/size endpoint that returns the total disk space used by all downloaded models.

Motivation

Users often need to quickly check how much storage their Ollama models are consuming without parsing the full model list. This endpoint provides a simple way to get total storage metrics.

Changes

  • Added ModelsStorageHandler server handler
  • Registered new GET endpoint at /api/models/size
  • Returns JSON with total_size_bytes and models_count
  • Added unit tests
  • Updated API documentation

Testing

  • Ma 8538 nual testing with local endpoint
  • Unit tests pass (go test ./server/...)
  • Documentation updated

Example Response

{
  "total_size_bytes": 4661229568,
  "models_count": 3
}

- Added ModelsStorageHandler in server/routes.go
- Registered new GET endpoint /api/models/size
- Returns total_size_bytes and models_count
- Added unit tests in server/routes_test.go
- Updated API documentation in docs/api.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0