How to use from
llama.cpp
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf bldeaw/m1_planner_q4_k_m:Q4_K_M
# Run inference directly in the terminal:
llama cli -hf bldeaw/m1_planner_q4_k_m:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp
# Start a local OpenAI-compatible server with a web UI:
llama serve -hf bldeaw/m1_planner_q4_k_m:Q4_K_M
# Run inference directly in the terminal:
llama cli -hf bldeaw/m1_planner_q4_k_m:Q4_K_M
Use pre-built binary
# Download pre-built binary from:
# https://github.com/ggerganov/llama.cpp/releases
# Start a local OpenAI-compatible server with a web UI:
./llama-server -hf bldeaw/m1_planner_q4_k_m:Q4_K_M
# Run inference directly in the terminal:
./llama-cli -hf bldeaw/m1_planner_q4_k_m:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
cmake -B build
cmake --build build -j --target llama-server llama-cli
# Start a local OpenAI-compatible server with a web UI:
./build/bin/llama-server -hf bldeaw/m1_planner_q4_k_m:Q4_K_M
# Run inference directly in the terminal:
./build/bin/llama-cli -hf bldeaw/m1_planner_q4_k_m:Q4_K_M
Use Docker
docker model run hf.co/bldeaw/m1_planner_q4_k_m:Q4_K_M
Quick Links

PlannerLLM

OpenAI-compatible API for bldeaw/m1_planner_q4_k_m using llama.cpp on Hugging Face Spaces.


Features

  • Docker Space ready
  • Persistent model storage
  • Secure secret handling
  • Runtime config via environment variables
  • Auto model download on first start
  • OpenAI-compatible endpoints

Required Hugging Face Setup

1. Create Docker Space

Create a new Hugging Face Space:

  • SDK: Docker

2. Optional: Add Persistent Storage

Settings โ†’ Storage

Recommended โ€” prevents re-downloading the model on every restart.

Mounted path:

/data

3. Add Variables / Secrets

Settings โ†’ Variables and Secrets

Variables

MODEL_REPO_ID=bldeaw/m1_planner_q4_k_m
MODEL_FILE=m1_planner_q4_k_m.gguf
MODEL_REVISION=main
CTX_SIZE=2048
THREADS=2
N_GPU_LAYERS=0
MODEL_DIR=/data/models
PORT=7860

Secret (only if private repo)

HF_TOKEN=hf_xxxxx

Optional checksum

MODEL_SHA256=xxxxxxxx

Repository Files

Dockerfile
start.sh
.dockerignore
README.md

Deploy

git clone https://huggingface.co/spaces/bldeaw/planner-llm
cp Dockerfile start.sh .dockerignore README.md planner-llm/
cd planner-llm
git add .
git commit -m "production deploy"
git push origin main

API Usage

Python

from openai import OpenAI

client = OpenAI(
    base_url="https://bldeaw-planner-llm.hf.space/v1",
    api_key="dummy"
)

resp = client.chat.completions.create(
    model="local-model",
    messages=[
        {"role": "user", "content": "Hello"}
    ]
)

print(resp.choices[0].message.content)

curl

curl https://bldeaw-planner-llm.hf.space/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{
    "model": "local-model",
    "messages": [
      {"role": "user", "content": "Hello"}
    ]
  }'

Endpoints

Endpoint Method
/v1/chat/completions POST
/v1/completions POST
/v1/models GET
/ GET

Troubleshooting

503 Service Unavailable

Usually:

  • Space building
  • Model downloading (~986 MB, takes a few minutes)
  • Crash during startup

Check the Logs tab.

checksum mismatch

Wrong file or corrupted download. Delete the cached file and restart.

Slow startup

Large model downloading on first run. Add persistent storage so it only downloads once.


Security

  • Store tokens only in Secrets
  • Use a private model repo + HF_TOKEN if needed
  • Never commit .env
  • Never commit .gguf into the Space repo
Downloads last month
6
GGUF
Model size
2B params
Architecture
qwen2
Hardware compatibility
Log In to add your hardware

4-bit

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support