浏览代码

API PS Documentation (#4822)

* API PS Documentation
royjhan 11 月之前
父节点
当前提交
28c7813ac4
共有 1 个文件被更改,包括 46 次插入0 次删除
  1. 46 0
      docs/api.md

+ 46 - 0
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
+    }
+  ]
+}
+```