Skip to content

Suno-style web UI for a self-hosted MiniMax-Music3 inference server

fix(inference): restore the FastAPI app and routes dropped by the streaming change

Adam Benhassen910df50d330c
diff --git a/inference/server.py b/inference/server.py
index c918c43..8c19151 100644
--- a/inference/server.py
+++ b/inference/server.py
@@ -223,6 +223,24 @@ def _worker():
QUEUE.task_done()
+app = FastAPI(title="MiniMax Music 3", description="Text-to-music on one GPU, upstream's API.")
+app.add_middleware(CORSMiddleware, allow_origins=["*"], allow_methods=["*"], allow_headers=["*"])
+
+
+def health():
+ """503 until the model is on the GPU, so process supervisors can wait it out."""
+ if not STATE["ready"]:
+ raise HTTPException(503, STATE["status"])
+ return {"status": "ready", "model": REPO, "capabilities": CAPABILITIES}
+
+
[email protected]("/v1/models")
+def list_models():
+ return {"object": "list", "data": [{"id": "minimax_ttm", "object": "model", "owned_by": "minimax"}]}
+
+
[email protected]("/v1/audio/speech")
def speech(req: SpeechRequest, authorization: str = Header(None), x_api_key: str = Header(None)):
if ARGS.api_key:
supplied = x_api_key or (authorization or "").removeprefix("Bearer ").strip()