Skip to content

Commit ab7cb34

Browse files
committed
add enable/disable all models, improve /chat model picker
1 parent c412691 commit ab7cb34

5 files changed

Lines changed: 488 additions & 250 deletions

File tree

api-docs.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2122,13 +2122,18 @@ Enable/disable models or toggle pinned status.
21222122
**Request Body**:
21232123
```json
21242124
{
2125-
"action": "set" | "togglePinned" | "enableInitial",
2125+
"action": "set" | "togglePinned" | "enableInitial" | "setAll",
21262126
"provider": "string",
21272127
"modelId": "string",
21282128
"enabled": "boolean"
21292129
}
21302130
```
21312131

2132+
`setAll` enables or disables all NanoGPT models at once.
2133+
`provider` must be `"nanogpt"` and `modelId` is optional for this action.
2134+
When `SUBSCRIPTION_MODELS_ONLY=true` and the user uses the server NanoGPT key, only models with
2135+
`subscription.included === true` are enabled.
2136+
21322137
**CURL Example**:
21332138
```bash
21342139
curl -X POST "http://localhost:3432/api/db/user-models" \
@@ -2137,6 +2142,13 @@ curl -X POST "http://localhost:3432/api/db/user-models" \
21372142
-d '{"action": "set", "provider": "openai", "modelId": "gpt-4", "enabled": true}'
21382143
```
21392144

2145+
```bash
2146+
curl -X POST "http://localhost:3432/api/db/user-models" \
2147+
-H "Content-Type: application/json" \
2148+
-b "session_cookie=your_session" \
2149+
-d '{"action": "setAll", "provider": "nanogpt", "enabled": false}'
2150+
```
2151+
21402152
#### GET `/api/models`
21412153
Get all available models with capabilities and user's enabled/pinned status.
21422154

0 commit comments

Comments
 (0)