Instructions to use AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp with 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 AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp:BF16 # Run inference directly in the terminal: llama cli -hf AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp:BF16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp:BF16 # Run inference directly in the terminal: llama cli -hf AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp:BF16
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp:BF16 # Run inference directly in the terminal: ./build/bin/llama cli -hf AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp:BF16
Use Docker
docker model run hf.co/AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp:BF16
- Llama new
- LM Studio
- Jan
- Ollama
How to use AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp with Ollama:
ollama run hf.co/AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp:BF16
- Unsloth Desktop
- Pi
How to use AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp:BF16
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:9931/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp:BF16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp with Docker Model Runner:
docker model run hf.co/AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp:BF16
- Lemonade
How to use AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp:BF16
Run and chat with the model
lemonade run user.MiniCPM-OCR-1.0-AX8860-llama.cpp-BF16
List all available models
lemonade list
- Hermes Agent
How to use AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp:BF16
Configure Hermes
# Install Hermes: curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash hermes setup # Point Hermes at the local server: hermes config set model.provider custom hermes config set model.base_url http://127.0.0.1:9931/v1 hermes config set model.default AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp:BF16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp:BF16
Configure OpenClaw
# Install OpenClaw: npm install -g openclaw@latest # Register the local server and set it as the default model: openclaw onboard --non-interactive --mode local \ --auth-choice custom-api-key \ --custom-base-url http://127.0.0.1:9931/v1 \ --custom-model-id "AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp:BF16" \ --custom-provider-id llama-cpp \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Download scripts/bench_client.py from AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp: direct link, hf CLI and curl.
- Browser
- Download file 3.06 kB
-
https://huggingface.co/AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp/resolve/main/scripts/bench_client.py
- Command line
-
hf download hf://AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp/scripts/bench_client.py
-
curl -L -o bench_client.py https://huggingface.co/AXERA-TECH/MiniCPM-OCR-1.0-AX8860-llama.cpp/resolve/main/scripts/bench_client.py
3.06 kB
| #!/usr/bin/env python3 | |
| """Benchmark image requests through the llama-server chat endpoint.""" | |
| import argparse | |
| import base64 | |
| import json | |
| import mimetypes | |
| import statistics | |
| import time | |
| import urllib.request | |
| from pathlib import Path | |
| def post(port: int, image: Path, prompt: str, max_tokens: int) -> dict: | |
| mime = mimetypes.guess_type(image.name)[0] or "image/png" | |
| uri = f"data:{mime};base64," + base64.b64encode(image.read_bytes()).decode() | |
| body = { | |
| "model": "minicpm-ocr", | |
| "messages": [{"role": "user", "content": [ | |
| {"type": "image_url", "image_url": {"url": uri}}, | |
| {"type": "text", "text": prompt}, | |
| ]}], | |
| "max_tokens": max_tokens, | |
| "temperature": 0, | |
| "top_k": 1, | |
| "seed": 1, | |
| "cache_prompt": False, | |
| "chat_template_kwargs": {"enable_thinking": False}, | |
| } | |
| req = urllib.request.Request( | |
| f"http://127.0.0.1:{port}/v1/chat/completions", | |
| json.dumps(body).encode(), | |
| {"Content-Type": "application/json"}, | |
| ) | |
| start = time.time() | |
| with urllib.request.urlopen(req, timeout=900) as resp: | |
| result = json.load(resp) | |
| result["_wall_ms"] = (time.time() - start) * 1000 | |
| return result | |
| def main() -> None: | |
| ap = argparse.ArgumentParser() | |
| ap.add_argument("--port", type=int, required=True) | |
| ap.add_argument("--images", type=Path, required=True) | |
| ap.add_argument("--out", type=Path) | |
| ap.add_argument("--reps", type=int, default=2) | |
| ap.add_argument("--max-tokens", type=int, default=128) | |
| ap.add_argument("--warmup", action="store_true") | |
| args = ap.parse_args() | |
| images = sorted(args.images.glob("*.png")) | |
| if not images: | |
| raise SystemExit(f"no PNG images under {args.images}") | |
| rows = [] | |
| if args.warmup: | |
| post(args.port, images[0], "Text Recognition:", 8) | |
| return | |
| if args.out is None: | |
| raise SystemExit("--out is required unless --warmup is used") | |
| for image in images: | |
| for _ in range(args.reps): | |
| result = post(args.port, image, "Text Recognition:", args.max_tokens) | |
| timing = result.get("timings", {}) | |
| rows.append({ | |
| "image": image.name, | |
| "wall_ms": result["_wall_ms"], | |
| "prompt_n": timing.get("prompt_n"), | |
| "prompt_ms": timing.get("prompt_ms"), | |
| "predicted_n": timing.get("predicted_n"), | |
| "predicted_ms": timing.get("predicted_ms"), | |
| "predicted_per_second": timing.get("predicted_per_second"), | |
| }) | |
| print("IMAGE_ROW " + json.dumps(rows[-1]), flush=True) | |
| args.out.parent.mkdir(parents=True, exist_ok=True) | |
| args.out.write_text(json.dumps(rows, indent=2) + "\n") | |
| print("IMAGE_MEDIAN wall_ms=%.1f prompt_ms=%.1f decode_tok_s=%.2f" % ( | |
| statistics.median(r["wall_ms"] for r in rows), | |
| statistics.median(r["prompt_ms"] for r in rows), | |
| statistics.median(r["predicted_per_second"] for r in rows), | |
| )) | |
| if __name__ == "__main__": | |
| main() | |