Spaces:
Running on Zero
Running on Zero
|
Download README.md from tommytracx/thox-zero-coder: direct link, hf CLI and curl.
- Browser
- Download file 2.8 kB
-
https://huggingface.co/spaces/tommytracx/thox-zero-coder/resolve/main/README.md
- Command line
-
hf download hf://spaces/tommytracx/thox-zero-coder/README.md
-
curl -L -o README.md https://huggingface.co/spaces/tommytracx/thox-zero-coder/resolve/main/README.md
2.8 kB
| title: THOX ZeroGPU - Coder | |
| emoji: π» | |
| colorFrom: green | |
| colorTo: gray | |
| sdk: gradio | |
| sdk_version: 5.49.1 | |
| python_version: "3.12" | |
| app_file: app.py | |
| pinned: false | |
| short_description: Code generation and review on ZeroGPU | |
| # THOX ZeroGPU - Coder | |
| Serves **`thox-coder-7b`** behind an OpenAI-compatible endpoint on ZeroGPU, so that | |
| Open WebUI can consume it as an ordinary "OpenAI API" connection. | |
| | | | | |
| |---|---| | |
| | Base model | `Qwen/Qwen2.5-Coder-7B-Instruct` | | |
| | LoRA adapter | `none (base weights)` | | |
| | Served model name | `thox-coder-7b` | | |
| | Hardware | ZeroGPU (`zero-a10g`), size `large` | | |
| ## Endpoints | |
| - `GET /v1/models` β model list | |
| - `POST /v1/chat/completions` β chat completion, streaming and non-streaming | |
| - `GET /health` β liveness plus the resolved model identity | |
| - `GET /` β Gradio chat UI | |
| ## Connecting from Open WebUI | |
| - **Base URL** β `https://tommytracx-thox-zero-coder.hf.space/v1` | |
| - **API key** β the `THOX_API_KEY` value | |
| ## Authentication | |
| `/v1/*` requires an API key, sent the way any OpenAI client already sends one: | |
| ``` | |
| Authorization: Bearer <key> # X-API-Key: <key> also accepted | |
| ``` | |
| The key is the Space secret `THOX_API_KEY`. `/v1/models` is gated too β an open | |
| `/v1/models` is how a bogus key gets mistaken for a working one. `GET /health` stays open | |
| for liveness and reports `auth: required`. If the secret is unset the endpoint fails | |
| **closed** (503), never open. | |
| ## OpenAI compatibility | |
| Verified with the official `openai` Python SDK (see `conformance.py` in | |
| `thox-zerogpu-spaces`), not by inspection: | |
| | | | | |
| |---|---| | |
| | `client.models.list()` | β | | |
| | `client.chat.completions.create()` | β `id` Β· `object` Β· `created` Β· `model` Β· `choices[].message` Β· `finish_reason` Β· `usage` | | |
| | `stream=True` | β `chat.completion.chunk` frames, `role` in the first delta, terminal `finish_reason`, `[DONE]` | | |
| | multi-turn + `system` role | β | | |
| | `tools=[...]` function calling | β OpenAI-shaped `tool_calls`, `finish_reason: tool_calls` | | |
| | bad key | β `401` β `openai.AuthenticationError` | | |
| | malformed body | β `400 {"error": {...}}` β not FastAPI's `422 {"detail": [...]}` | | |
| | out-of-range `max_tokens` / `temperature` / `top_p` | β clamped, not rejected | | |
| Sampling ceilings are enforced by clamping rather than Pydantic bounds, because | |
| `Field(le=...)` makes FastAPI answer `422 {"detail": [...]}` while the OpenAI API answers | |
| `400 {"error": {...}}` β and a client that reads `error.message` sees nothing at all. | |
| ## Source | |
| Generated from the shared template in `thox-zerogpu-spaces`. `app.py` is byte-identical | |
| across every THOX ZeroGPU model Space β only `thox_space_config.py` differs. | |
| Your AI. Your Data. Your Rules.™ | |