feat: add /v1/models endpoint and systemd service for orchestrator
- Add OpenAI-compatible /v1/models endpoint to list available models - Create systemd service file for proper service management - Service runs as root with automatic restart on failure - Logs to systemd journal for easy debugging
This commit is contained in:
@@ -282,6 +282,27 @@ async def list_models():
|
||||
}
|
||||
|
||||
|
||||
@app.get("/v1/models")
|
||||
async def list_models_openai():
|
||||
"""OpenAI-compatible models listing endpoint"""
|
||||
models_list = []
|
||||
for model_name, model_info in model_registry.items():
|
||||
models_list.append({
|
||||
"id": model_name,
|
||||
"object": "model",
|
||||
"created": int(time.time()),
|
||||
"owned_by": "pivoine-gpu",
|
||||
"permission": [],
|
||||
"root": model_name,
|
||||
"parent": None,
|
||||
})
|
||||
|
||||
return {
|
||||
"object": "list",
|
||||
"data": models_list
|
||||
}
|
||||
|
||||
|
||||
@app.post("/v1/chat/completions")
|
||||
async def chat_completions(request: Request):
|
||||
"""OpenAI-compatible chat completions endpoint (text models)"""
|
||||
|
||||
Reference in New Issue
Block a user