REST API Reference
CSGHub-Lite starts its service by default on port 11435 of localhost, providing API interfaces compatible with Ollama and OpenAI.
API Overview
| Method | Path | Description |
|---|---|---|
GET | /api/health | Service health check |
GET | /api/tags | List all local models |
GET | /api/ps | View currently running models |
POST | /api/show | Show detailed information for a specific model |
POST | /api/pull | Pull model (supports streaming response) |
POST | /api/stop | Stop and unload model |
DELETE | /api/delete | Remove local model files |
POST | /api/generate | Text generation (supports interactive stream) |
POST | /api/chat | Chat conversation generation (supports stream) |
POST | /v1/chat/completions | OpenAI-compatible chat interface |
GET | /v1/models | OpenAI-compatible model list interface |
Interface Examples
Chat API
curl http://localhost:11435/api/chat -d '{
"model": "Qwen/Qwen3-0.6B-GGUF",
"messages": [{"role": "user", "content": "Hello!"}]
}'
Non-Streaming Text Generation (Generate API)
curl http://localhost:11435/api/generate -d '{
"model": "Qwen/Qwen3-0.6B-GGUF",
"prompt": "Write a line of poetry about programming",
"stream": false
}'
Get Running Models
curl http://localhost:11435/api/ps
OpenAI-Compatible Call (Python)
from openai import OpenAI
client = OpenAI(base_url="http://localhost:11435/v1", api_key="unused")
response = client.chat.completions.create(
model="Qwen/Qwen3-0.6B-GGUF",
messages=[{"role": "user", "content": "Hello, please introduce yourself."}]
)
print(response.choices[0].message.content)