Spaces:
Running on Zero
Running on Zero
File size: 2,748 Bytes
c558633 fdbf570 c558633 fdbf570 d43325b b7e1b13 52b0989 56f6a56 39ac4ad 56f6a56 d43325b 56f6a56 624cd49 39ac4ad d43325b 39ac4ad 93b07ca fdbf570 93b07ca | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 | ---
title: Luna Max OpenAI API on Qwen2.5 Coder 7B
emoji: 🚀
colorFrom: green
colorTo: yellow
sdk: gradio
sdk_version: 6.22.0
python_version: '3.12'
app_file: app.py
pinned: false
---
This Space serves `Qwen/Qwen2.5-Coder-7B-Instruct` through a reliable OpenAI
Chat Completions surface. `gpt-5.6-luna-max` is the public compatibility alias
and behavior profile; it does not claim to contain another vendor's weights.
The default code-specialized model has about 7.6B parameters, which reduces
cold-start and generation cost substantially compared with the previous 30B
FP8 checkpoint while retaining long-context coding support. The endpoint uses
a configurable context window (16,384 tokens by default) and Qwen's
function-calling-compatible template, returning OpenAI-compatible structured
tool calls for OpenClaude. The same source supports both a GPU-backed Space
and a CPU-only test Space; set `DEVICE=cpu` or `DEVICE=cuda` as a Space
variable when selecting the runtime.
Set `MODEL` or `MODEL_ID` only when deliberately testing another compatible
model. The Space uses the full model ID as its client-facing model name.
OpenClaude can use the Space directly, without a notebook-side chat proxy:
```text
CLAUDE_CODE_USE_OPENAI=1
OPENAI_BASE_URL=https://erinaldorodrigues-qwen-coder-api.hf.space/v1
OPENAI_API_BASE=https://erinaldorodrigues-qwen-coder-api.hf.space/v1
OPENAI_API_KEY=hf_your_hugging_face_token
OPENAI_MODEL=gpt-5.6-luna-max
WEB_SEARCH_PROVIDER=custom
WEB_SEARCH_API=https://erinaldorodrigues-qwen-coder-api.hf.space/web-search
WEB_METHOD=GET
WEB_QUERY_PARAM=q
```
Using an `hf_...` token authenticates Hugging Face usage and, on the GPU Space,
gives the request the quota and queue priority associated with that account.
The public Spaces can also accept unauthenticated calls, subject to stricter
shared limits.
The public compatibility surface is:
- `GET /health`
- `GET /v1/models`
- `POST /v1/chat/completions` (JSON or OpenAI-compatible SSE)
- `GET /web-search?q=...`
Every response includes an `X-Request-ID` header for correlating failures with
the Space logs. `/health` reports the loaded backend model, profile, CUDA
availability, device, and GPU name. Model inference runs in a worker thread so
a slow generation does not block health checks or web-search requests.
The aliases `gpt-5.6-luna-max`, `gpt-5.6-luna`, and `qwen-coder` all route to
the same Qwen backend. Use the first alias for the Luna Max profile; use
`qwen-coder` when a client requires the historical model name.
Simple greetings such as `ola`/`olá` use a deterministic fast path and do not
queue a full model inference. Tool catalogs are also omitted from ordinary
conversation turns and retained when the request actually needs a tool.
|