Spaces:
Runtime error
Runtime error
metadata
title: TTS
emoji: π€
colorFrom: blue
colorTo: purple
sdk: docker
app_port: 7860
models:
- unsloth/Qwen3-8B-GGUF
Qwen3-8B-GGUF API Space
A Hugging Face Space that exposes the unsloth/Qwen3-8B-GGUF model (8-bit) as a REST API using FastAPI and llama-cpp-python.
Endpoints
| Method | Path | Description |
|---|---|---|
| GET | / |
HTML documentation page |
| POST | /generate |
Send a message and receive an AI response |
| GET | /health |
Health check (model status) |
| GET | /docs |
Interactive Swagger UI |
| GET | /redoc |
ReDoc documentation |
POST /generate β Request Format
{
"instructions": "optional system instructions",
"message": "required user message",
"user": "optional username"
}
| Field | Type | Required | Description |
|---|---|---|---|
instructions |
string | No | System-level instructions |
message |
string | Yes | The message to process |
user |
string | No | Username identifier |
Prompt Construction
The prompt sent to the model is built as:
{instructions}
{user} said {message}
Example input:
{"instructions": "idk", "message": "thisissupermario", "user": "admin"}
Prompt sent to model:
idk
admin said thisissupermario
Example Usage
Python
import requests
response = requests.post(
"https://dreamlongyt-agent.hf.space/generate",
json={
"instructions": "idk",
"message": "thisissupermario",
"user": "admin"
}
)
print(response.json())
cURL
curl -X POST "https://dreamlongyt-agent.hf.space/generate" \
-H "Content-Type: application/json" \
-d \'{"instructions":"idk","message":"thisissupermario","user":"admin"}\'
Deployment
- Go to huggingface.co/new-space
- Name your Space and select Docker as the SDK
- Clone the Space repo and push these files:
app.pyDockerfilerequirements.txtREADME.md
- The Space will build automatically and be available at
https://YOUR-USERNAME-YOUR-SPACE-NAME.hf.space
Note: The first request may be slow as the model (~4.7 GB) is downloaded from Hugging Face Hub on startup. The
llama-cpp-pythonlibrary is now installed using pre-compiled wheels for faster setup. Consider upgrading to a paid hardware tier for faster inference.