Spaces:
Build error
Build error
| 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/models` | |
| - `POST /v1/chat/completions` (streaming supported) | |
| - `POST /v1/completions` | |
| Base URL: `https://<your-username>-<space-name>.hf.space/v1` | |
| ## Use it | |
| ```python | |
| 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: | |
| ```bash | |
| 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 | |
| 1. Create a new Space → **Docker** (blank template). | |
| 2. Add this `Dockerfile` and rename this file to `README.md` in the Space repo. | |
| 3. Push. First build takes a few minutes (it bakes the ~5.5 GB model into the image). | |