From 28c7813ac4c5316fc65d83bece4f21aeaeb51d66 Mon Sep 17 00:00:00 2001 From: royjhan <65097070+royjhan@users.noreply.github.com> Date: Wed, 5 Jun 2024 11:06:53 -0700 Subject: [PATCH] API PS Documentation (#4822) * API PS Documentation --- docs/api.md | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/docs/api.md b/docs/api.md index 0f11c388..64bfbed8 100644 --- a/docs/api.md +++ b/docs/api.md @@ -12,6 +12,7 @@ - [Pull a Model](#pull-a-model) - [Push a Model](#push-a-model) - [Generate Embeddings](#generate-embeddings) +- [List Running Models](#list-running-models) ## Conventions @@ -1035,3 +1036,48 @@ curl http://localhost:11434/api/embeddings -d '{ ] } ``` + +## List Running Models +```shell +GET /api/ps +``` + +List models that are currently loaded into memory. + +\* If a model is loaded completely into system memory, `size_vram` is omitted from the response. + +#### Examples + +### Request +```shell +curl http://localhost:11434/api/ps +``` + +#### Response + +A single JSON object will be returned. + +```json +{ + "models": [ + { + "name": "mistral:latest", + "model": "mistral:latest", + "size": 5137025024, + "digest": "2ae6f6dd7a3dd734790bbbf58b8909a606e0e7e97e94b7604e0aa7ae4490e6d8", + "details": { + "parent_model": "", + "format": "gguf", + "family": "llama", + "families": [ + "llama" + ], + "parameter_size": "7.2B", + "quantization_level": "Q4_0" + }, + "expires_at": "2024-06-04T14:38:31.83753-07:00", + "size_vram": 5137025024 + } + ] +} +``` \ No newline at end of file