Spaces:
Build error
Build error
metadata
title: Ornith 1.0 9B API
emoji: 🦅
colorFrom: indigo
colorTo: purple
sdk: docker
app_port: 7860
pinned: false
license: mit
Ornith-1.0-9B — OpenAI-compatible API (llama.cpp)
Serves deepreinforce-ai/Ornith-1.0-9B (Q4_K_M GGUF) as an OpenAI-compatible
REST API via llama.cpp's built-in server.
Note: This is the CPU build for the free tier (2 vCPU, no GPU). A 9B model on CPU is usable but slow (~5-10 tok/s). See the Dockerfile footer for the GPU variant if you need real speed.
Endpoints
GET /v1/modelsPOST /v1/chat/completions(streaming supported)POST /v1/completions
Base URL: https://<your-username>-<space-name>.hf.space/v1
Use it
from openai import OpenAI
client = OpenAI(
base_url="https://<your-username>-<space-name>.hf.space/v1",
api_key="not-needed", # llama.cpp server ignores it by default
)
resp = client.chat.completions.create(
model="ornith",
messages=[{"role": "user", "content": "Write a Python LRU cache with a docstring."}],
temperature=0.6, top_p=0.95,
stream=True,
)
for chunk in resp:
print(chunk.choices[0].delta.content or "", end="")
Or with curl:
curl https://<your-username>-<space-name>.hf.space/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"ornith","messages":[{"role":"user","content":"hello"}],"temperature":0.6}'
Deploy
- Create a new Space → Docker (blank template).
- Add this
Dockerfileand rename this file toREADME.mdin the Space repo. - Push. First build takes a few minutes (it bakes the ~5.5 GB model into the image).