You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -169,12 +236,14 @@ curl -X POST http://localhost:8000/generate \
169
236
170
237
**Request Body:**
171
238
-`code` (required): Python function code as a string
172
-
-`max_new_tokens` (optional): Maximum number of tokens to generate (default: 256)
239
+
-`max_new_tokens` (optional): Maximum number of tokens to generate (uses model default if not specified)
240
+
-`model` (optional): Model key or Ollama model name to use for this request
173
241
174
242
**Response (200 OK):**
175
243
```json
176
244
{
177
-
"docstring": "\"\"\"Compute the sum of two numbers.\n\nParameters\n----------\nx : int\n First number.\ny : int\n Second number.\n\nReturns\n-------\nint\n Sum of x and y.\n\"\"\""
245
+
"docstring": "\"\"\"Compute the sum of two numbers.\n\nParameters\n----------\nx : int\n First number.\ny : int\n Second number.\n\nReturns\n-------\nint\n Sum of x and y.\"\"\"",
246
+
"model": "qwen2.5-coder:32b"
178
247
}
179
248
```
180
249
@@ -185,12 +254,57 @@ curl -X POST http://localhost:8000/generate \
185
254
}
186
255
```
187
256
257
+
#### List Models
258
+
259
+
Get available model configurations:
260
+
261
+
```bash
262
+
curl http://localhost:8000/models
263
+
```
264
+
265
+
**Response (200 OK):**
266
+
```json
267
+
{
268
+
"default": "qwen2.5-coder-32b",
269
+
"active": "qwen2.5-coder-32b",
270
+
"models": [
271
+
{
272
+
"key": "qwen2.5-coder-32b",
273
+
"name": "Qwen 2.5 Coder 32B",
274
+
"ollama_model": "qwen2.5-coder:32b",
275
+
"context_window": 32768,
276
+
"architecture": "dense",
277
+
"memory_q4": "~18GB",
278
+
"description": "Dense 32B model, good balance of quality and speed"
279
+
}
280
+
]
281
+
}
282
+
```
283
+
284
+
### CLI Tool
285
+
286
+
The CLI tool allows testing docstring generation directly:
287
+
288
+
```bash
289
+
# Use default model
290
+
python scripts/run_ollama.py --user "def add(x, y): return x + y"
0 commit comments