CoolFace
Apppublic

liuyd-dev/tianwen-minicpm5-1b-api

sourceHugging Faceapache-2.0updated 3mo agoView on Hugging Face
0likes
App README

Tianwen · MiniCPM5-1B inference (ZeroGPU)

OpenAI-compatible inference for the fine-tuned `tianwen-minicpm5-1b`, served with llama-cpp-python inside an @spaces.GPU function. Backs the Tianwen app.

Endpoints: POST /v1/chat/completions · GET /v1/models

Files this Space needs

  • —deploy_hf_zerogpu.py (app) — copy from the main repo's finetune/
  • —requirements.txt (this folder)
  • —model.gguf — upload the F16 tianwen-minicpm1b.gguf as model.gguf (1B F16 ≈ 2GB, fits ZeroGPU; no quantization needed). A quantized Q4_K_M also works if you have one.

The model's official chat template is embedded in the GGUF, so deploy_hf_zerogpu.py does not force a chat_format — llama-cpp-python uses the built-in template automatically.

Space variables / secrets

  • —TIANWEN_API_KEY — the bearer key the Tianwen app sends (set the same value in the app Space's CELESTIAL_LLM_KEY)
  • —MODEL_PATH — defaults to model.gguf
  • —TIANWEN_N_CTX — defaults to 4096