|
1234 | 1234 | }, |
1235 | 1235 | "/v1/engines/{name}": { |
1236 | 1236 | "get": { |
1237 | | - "operationId": "EnginesController_findOne", |
1238 | | - "summary": "Get an engine", |
1239 | | - "description": "Retrieves an engine instance, providing basic information about the engine.", |
| 1237 | + "operationId": "EnginesController_listInstalledEngines", |
| 1238 | + "summary": "List installed engines", |
| 1239 | + "description": "List installed engines for a particular engine type.", |
1240 | 1240 | "parameters": [ |
1241 | 1241 | { |
1242 | 1242 | "name": "name", |
|
1292 | 1292 | } |
1293 | 1293 | }, |
1294 | 1294 | "tags": ["Engines"] |
1295 | | - }, |
1296 | | - "post": { |
1297 | | - "summary": "Install an engine", |
1298 | | - "description": "Install an engine of a specific type, with optional version and variant", |
| 1295 | + } |
| 1296 | + }, |
| 1297 | + "/v1/engines/{name}/releases": { |
| 1298 | + "get": { |
| 1299 | + "summary": "List released engines", |
| 1300 | + "description": "List released engines of a specific engine type.", |
1299 | 1301 | "parameters": [ |
1300 | 1302 | { |
1301 | 1303 | "name": "name", |
|
1307 | 1309 | "default": "llama-cpp" |
1308 | 1310 | }, |
1309 | 1311 | "description": "The type of engine" |
1310 | | - }, |
| 1312 | + } |
| 1313 | + ], |
| 1314 | + "responses": { |
| 1315 | + "200": { |
| 1316 | + "description": "Successful installation", |
| 1317 | + "content": { |
| 1318 | + "application/json": { |
| 1319 | + "schema": { |
| 1320 | + "type": "array", |
| 1321 | + "items": { |
| 1322 | + "type": "object", |
| 1323 | + "properties": { |
| 1324 | + "draft": { |
| 1325 | + "type": "boolean", |
| 1326 | + "example": false |
| 1327 | + }, |
| 1328 | + "name": { |
| 1329 | + "type": "string", |
| 1330 | + "example": "v0.1.39-20.11.24" |
| 1331 | + }, |
| 1332 | + "prerelease": { |
| 1333 | + "type": "boolean", |
| 1334 | + "example": true |
| 1335 | + }, |
| 1336 | + "published_at": { |
| 1337 | + "type": "string", |
| 1338 | + "format": "date-time", |
| 1339 | + "example": "2024-11-20T17:39:40Z" |
| 1340 | + }, |
| 1341 | + "url": { |
| 1342 | + "type": "string", |
| 1343 | + "example": "https://api.github.com/repos/janhq/cortex.llamacpp/releases/186479804" |
| 1344 | + } |
| 1345 | + } |
| 1346 | + } |
| 1347 | + } |
| 1348 | + } |
| 1349 | + } |
| 1350 | + } |
| 1351 | + }, |
| 1352 | + "tags": ["Engines"] |
| 1353 | + } |
| 1354 | + }, |
| 1355 | + "/v1/engines/{name}/releases/latest": { |
| 1356 | + "get": { |
| 1357 | + "summary": "Get latest release", |
| 1358 | + "description": "Return variants for the latest engine release of a specific engine type.", |
| 1359 | + "parameters": [ |
1311 | 1360 | { |
1312 | | - "name": "version", |
1313 | | - "in": "query", |
1314 | | - "required": false, |
| 1361 | + "name": "name", |
| 1362 | + "in": "path", |
| 1363 | + "required": true, |
1315 | 1364 | "schema": { |
1316 | | - "type": "string" |
| 1365 | + "type": "string", |
| 1366 | + "enum": ["llama-cpp", "onnxruntime", "tensorrt-llm"], |
| 1367 | + "default": "llama-cpp" |
1317 | 1368 | }, |
1318 | | - "description": "The version of the engine to install (optional)" |
1319 | | - }, |
| 1369 | + "description": "The type of engine" |
| 1370 | + } |
| 1371 | + ], |
| 1372 | + "responses": { |
| 1373 | + "200": { |
| 1374 | + "description": "Successful installation", |
| 1375 | + "content": { |
| 1376 | + "application/json": { |
| 1377 | + "schema": { |
| 1378 | + "type": "array", |
| 1379 | + "items": { |
| 1380 | + "type": "object", |
| 1381 | + "properties": { |
| 1382 | + "created_at": { |
| 1383 | + "type": "string", |
| 1384 | + "format": "date-time", |
| 1385 | + "example": "2024-11-15T10:39:39Z" |
| 1386 | + }, |
| 1387 | + "download_count": { |
| 1388 | + "type": "integer", |
| 1389 | + "example": 76 |
| 1390 | + }, |
| 1391 | + "name": { |
| 1392 | + "type": "string", |
| 1393 | + "example": "0.1.39-linux-amd64-avx-cuda-11-7" |
| 1394 | + }, |
| 1395 | + "size": { |
| 1396 | + "type": "integer", |
| 1397 | + "example": 151215080 |
| 1398 | + } |
| 1399 | + } |
| 1400 | + } |
| 1401 | + } |
| 1402 | + } |
| 1403 | + } |
| 1404 | + } |
| 1405 | + }, |
| 1406 | + "tags": ["Engines"] |
| 1407 | + } |
| 1408 | + }, |
| 1409 | + "/v1/engines/{name}/install": { |
| 1410 | + "post": { |
| 1411 | + "summary": "Install an engine", |
| 1412 | + "description": "Install an engine of a specific type, with optional version and variant. If none are provided, the latest version and most suitable variant will be installed.", |
| 1413 | + "parameters": [ |
1320 | 1414 | { |
1321 | | - "name": "variant", |
1322 | | - "in": "query", |
1323 | | - "required": false, |
| 1415 | + "name": "name", |
| 1416 | + "in": "path", |
| 1417 | + "required": true, |
1324 | 1418 | "schema": { |
1325 | | - "type": "string" |
| 1419 | + "type": "string", |
| 1420 | + "enum": ["llama-cpp", "onnxruntime", "tensorrt-llm"], |
| 1421 | + "default": "llama-cpp" |
1326 | 1422 | }, |
1327 | | - "description": "The variant of the engine to install (optional)" |
| 1423 | + "description": "The type of engine" |
1328 | 1424 | } |
1329 | 1425 | ], |
| 1426 | + "requestBody": { |
| 1427 | + "required": false, |
| 1428 | + "content": { |
| 1429 | + "application/json": { |
| 1430 | + "schema": { |
| 1431 | + "type": "object", |
| 1432 | + "properties": { |
| 1433 | + "version": { |
| 1434 | + "type": "string", |
| 1435 | + "description": "The version of the engine to install (optional)", |
| 1436 | + "example": "v0.1.39" |
| 1437 | + }, |
| 1438 | + "variant": { |
| 1439 | + "type": "string", |
| 1440 | + "description": "The variant of the engine to install (optional)", |
| 1441 | + "example": "mac-arm64" |
| 1442 | + } |
| 1443 | + } |
| 1444 | + } |
| 1445 | + } |
| 1446 | + } |
| 1447 | + }, |
1330 | 1448 | "responses": { |
1331 | 1449 | "200": { |
1332 | 1450 | "description": "Successful installation", |
1333 | 1451 | "content": { |
1334 | 1452 | "application/json": { |
1335 | | - "schema": {} |
| 1453 | + "schema": { |
| 1454 | + "type": "object", |
| 1455 | + "properties": { |
| 1456 | + "message": { |
| 1457 | + "type": "string", |
| 1458 | + "example": "Engine starts installing!" |
| 1459 | + } |
| 1460 | + } |
| 1461 | + } |
1336 | 1462 | } |
1337 | 1463 | } |
1338 | 1464 | } |
|
1341 | 1467 | }, |
1342 | 1468 | "delete": { |
1343 | 1469 | "summary": "Uninstall an engine", |
1344 | | - "description": "Uninstall an engine based on type, version, and variant", |
| 1470 | + "description": "Uninstall an engine based on engine, version, and variant. If version and variant are not provided, all versions and variants of the engine will be uninstalled.", |
1345 | 1471 | "parameters": [ |
1346 | 1472 | { |
1347 | 1473 | "name": "name", |
|
1353 | 1479 | "default": "llama-cpp" |
1354 | 1480 | }, |
1355 | 1481 | "description": "The type of engine" |
1356 | | - }, |
1357 | | - { |
1358 | | - "name": "version", |
1359 | | - "in": "query", |
1360 | | - "required": false, |
1361 | | - "schema": { |
1362 | | - "type": "string" |
1363 | | - }, |
1364 | | - "description": "The version of the engine to uninstall (optional)" |
1365 | | - }, |
1366 | | - { |
1367 | | - "name": "variant", |
1368 | | - "in": "query", |
1369 | | - "required": false, |
1370 | | - "schema": { |
1371 | | - "type": "string" |
1372 | | - }, |
1373 | | - "description": "The variant of the engine to uninstall (optional)" |
1374 | 1482 | } |
1375 | 1483 | ], |
| 1484 | + "requestBody": { |
| 1485 | + "required": false, |
| 1486 | + "content": { |
| 1487 | + "application/json": { |
| 1488 | + "schema": { |
| 1489 | + "type": "object", |
| 1490 | + "properties": { |
| 1491 | + "version": { |
| 1492 | + "type": "string", |
| 1493 | + "description": "The version of the engine to uninstall (optional)", |
| 1494 | + "example": "v0.1.39" |
| 1495 | + }, |
| 1496 | + "variant": { |
| 1497 | + "type": "string", |
| 1498 | + "description": "The variant of the engine to uninstall (optional)", |
| 1499 | + "example": "mac-arm64" |
| 1500 | + } |
| 1501 | + } |
| 1502 | + } |
| 1503 | + } |
| 1504 | + } |
| 1505 | + }, |
1376 | 1506 | "responses": { |
1377 | 1507 | "200": { |
1378 | 1508 | "description": "Successful uninstallation", |
|
1381 | 1511 | "schema": { |
1382 | 1512 | "type": "object", |
1383 | 1513 | "properties": { |
1384 | | - "success": { |
1385 | | - "type": "boolean", |
1386 | | - "description": "Indicates if the uninstallation was successful" |
1387 | | - }, |
1388 | 1514 | "message": { |
1389 | 1515 | "type": "string", |
1390 | | - "description": "Description of the uninstallation action taken" |
1391 | | - }, |
1392 | | - "uninstalledEngines": { |
1393 | | - "type": "array", |
1394 | | - "items": { |
1395 | | - "type": "object", |
1396 | | - "properties": { |
1397 | | - "version": { |
1398 | | - "type": "string" |
1399 | | - }, |
1400 | | - "variant": { |
1401 | | - "type": "string" |
1402 | | - } |
1403 | | - } |
1404 | | - }, |
1405 | | - "description": "List of uninstalled engine versions and variants" |
| 1516 | + "description": "Engine llama-cpp uninstalled successfully!", |
| 1517 | + "example": "Engine llama-cpp uninstalled successfully!" |
1406 | 1518 | } |
1407 | 1519 | } |
1408 | 1520 | } |
|
1429 | 1541 | "tags": ["Engines"] |
1430 | 1542 | } |
1431 | 1543 | }, |
| 1544 | + "/v1/engines/{name}/update": { |
| 1545 | + "post": { |
| 1546 | + "summary": "Update engine", |
| 1547 | + "description": "Updates the specified engine type using the engine variant currently set as default.", |
| 1548 | + "parameters": [ |
| 1549 | + { |
| 1550 | + "name": "name", |
| 1551 | + "in": "path", |
| 1552 | + "required": true, |
| 1553 | + "schema": { |
| 1554 | + "type": "string", |
| 1555 | + "enum": ["llama-cpp", "onnxruntime", "tensorrt-llm"], |
| 1556 | + "default": "llama-cpp" |
| 1557 | + }, |
| 1558 | + "description": "The name of the engine to update" |
| 1559 | + } |
| 1560 | + ], |
| 1561 | + "responses": { |
| 1562 | + "200": { |
| 1563 | + "description": "Engine updated successfully", |
| 1564 | + "content": { |
| 1565 | + "application/json": { |
| 1566 | + "schema": { |
| 1567 | + "type": "object", |
| 1568 | + "properties": { |
| 1569 | + "message": { |
| 1570 | + "type": "string", |
| 1571 | + "example": "Engine updated successfully" |
| 1572 | + } |
| 1573 | + } |
| 1574 | + } |
| 1575 | + } |
| 1576 | + } |
| 1577 | + } |
| 1578 | + }, |
| 1579 | + "tags": ["Engines"] |
| 1580 | + } |
| 1581 | + }, |
1432 | 1582 | "/v1/engines/{name}/default": { |
1433 | 1583 | "get": { |
1434 | 1584 | "summary": "Get default engine variant", |
|
1603 | 1753 | "tags": ["Engines"] |
1604 | 1754 | } |
1605 | 1755 | }, |
1606 | | - "/v1/engines/{name}/update": { |
1607 | | - "post": { |
1608 | | - "summary": "Update engine", |
1609 | | - "description": "Updates the specified engine type using the engine variant currently set as default.", |
1610 | | - "parameters": [ |
1611 | | - { |
1612 | | - "name": "name", |
1613 | | - "in": "path", |
1614 | | - "required": true, |
1615 | | - "schema": { |
1616 | | - "type": "string", |
1617 | | - "enum": ["llama-cpp", "onnxruntime", "tensorrt-llm"], |
1618 | | - "default": "llama-cpp" |
1619 | | - }, |
1620 | | - "description": "The name of the engine to update" |
1621 | | - } |
1622 | | - ], |
1623 | | - "responses": { |
1624 | | - "200": { |
1625 | | - "description": "Engine updated successfully", |
1626 | | - "content": { |
1627 | | - "application/json": { |
1628 | | - "schema": { |
1629 | | - "type": "object", |
1630 | | - "properties": { |
1631 | | - "message": { |
1632 | | - "type": "string", |
1633 | | - "example": "Engine updated successfully" |
1634 | | - } |
1635 | | - } |
1636 | | - } |
1637 | | - } |
1638 | | - } |
1639 | | - } |
1640 | | - }, |
1641 | | - "tags": ["Engines"] |
1642 | | - } |
1643 | | - }, |
1644 | 1756 | "/v1/hardware": { |
1645 | 1757 | "get": { |
1646 | 1758 | "summary": "Get hardware information", |
|
0 commit comments