Instructions to use build-small-hackathon/paint-match-minicpm with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use build-small-hackathon/paint-match-minicpm with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="build-small-hackathon/paint-match-minicpm", filename="minicpm-ft-Q6_K.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use build-small-hackathon/paint-match-minicpm 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 build-small-hackathon/paint-match-minicpm:Q6_K # Run inference directly in the terminal: llama cli -hf build-small-hackathon/paint-match-minicpm:Q6_K
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf build-small-hackathon/paint-match-minicpm:Q6_K # Run inference directly in the terminal: llama cli -hf build-small-hackathon/paint-match-minicpm:Q6_K
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 build-small-hackathon/paint-match-minicpm:Q6_K # Run inference directly in the terminal: ./llama-cli -hf build-small-hackathon/paint-match-minicpm:Q6_K
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 build-small-hackathon/paint-match-minicpm:Q6_K # Run inference directly in the terminal: ./build/bin/llama-cli -hf build-small-hackathon/paint-match-minicpm:Q6_K
Use Docker
docker model run hf.co/build-small-hackathon/paint-match-minicpm:Q6_K
- LM Studio
- Jan
- vLLM
How to use build-small-hackathon/paint-match-minicpm with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "build-small-hackathon/paint-match-minicpm" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "build-small-hackathon/paint-match-minicpm", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/build-small-hackathon/paint-match-minicpm:Q6_K
- Ollama
How to use build-small-hackathon/paint-match-minicpm with Ollama:
ollama run hf.co/build-small-hackathon/paint-match-minicpm:Q6_K
- Unsloth Studio
How to use build-small-hackathon/paint-match-minicpm with Unsloth Studio:
Install Unsloth Studio (macOS, Linux, WSL)
curl -fsSL https://unsloth.ai/install.sh | sh # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for build-small-hackathon/paint-match-minicpm to start chatting
Install Unsloth Studio (Windows)
irm https://unsloth.ai/install.ps1 | iex # Run unsloth studio unsloth studio -H 0.0.0.0 -p 8888 # Then open http://localhost:8888 in your browser # Search for build-small-hackathon/paint-match-minicpm to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for build-small-hackathon/paint-match-minicpm to start chatting
- Pi
How to use build-small-hackathon/paint-match-minicpm with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf build-small-hackathon/paint-match-minicpm:Q6_K
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "build-small-hackathon/paint-match-minicpm:Q6_K" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use build-small-hackathon/paint-match-minicpm with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf build-small-hackathon/paint-match-minicpm:Q6_K
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:8080/v1 hermes config set model.default build-small-hackathon/paint-match-minicpm:Q6_K
Run Hermes
hermes
- Atomic Chat new
- Docker Model Runner
How to use build-small-hackathon/paint-match-minicpm with Docker Model Runner:
docker model run hf.co/build-small-hackathon/paint-match-minicpm:Q6_K
- Lemonade
How to use build-small-hackathon/paint-match-minicpm with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull build-small-hackathon/paint-match-minicpm:Q6_K
Run and chat with the model
lemonade run user.paint-match-minicpm-Q6_K
List all available models
lemonade list
paint-match-minicpm
MiniCPM-V-4.6 (1B) finetuned to extract paint codes from scale model instruction sheets and shop screenshots. Runs via llama.cpp on CPU โ no GPU required.
Part of the Paint Match project for the Hugging Face "Build Small" hackathon.
What it does
Given a photo of a scale model instruction sheet or a hobby shop screenshot, the model returns a structured JSON list of paint codes (Humbrol, Tamiya, Meng, etc.). Used as the inference core of a fully local paint-matching tool running on a Radxa Dragon Q6A ARM board.
Benchmark
| Metric | Score |
|---|---|
| F1 โ benchmark (10 images) | 0.935 |
| F1 โ shop holdout (53 images) | 0.927 |
| F1 โ paper holdout (7 images) | 0.928 |
| Avg latency (Radxa CPU) | ~64s |
Base model comparison (InternVL3.5-2B): F1=0.873, ~190s latency.
Files
| File | Description |
|---|---|
model.safetensors |
Merged model weights (LoRA baked in) |
config.json + tokenizer files |
Model config and tokenizer |
minicpm-ft-Q6_K.gguf |
Quantized GGUF for llama.cpp inference |
Fine-tuning details
- Base model: openbmb/MiniCPM-V-4.6
- Method: LoRA (r=16, alpha=32, dropout=0.05)
- Target modules: q_proj, v_proj (+ language model projection layers)
- Training: 5 epochs, lr=2e-4, cosine scheduler, batch size 8
- Dataset: ~5,866 examples scraped from Airfix instruction sheets + shop photos, image resolution 960px
- Hardware: Modal.com H100, ~16 min training time
Usage (llama.cpp / GGUF)
llama-cli \
-m minicpm-ft-Q6_K.gguf \
--mmproj mmproj-model-f16.gguf \
--image instruction_sheet.jpg \
-p "Extract all paint codes from this image as JSON."
Usage (transformers)
from transformers import AutoModel, AutoTokenizer
from PIL import Image
model = AutoModel.from_pretrained(
"build-small-hackathon/paint-match-minicpm",
trust_remote_code=True,
)
tokenizer = AutoTokenizer.from_pretrained(
"build-small-hackathon/paint-match-minicpm",
trust_remote_code=True,
)
image = Image.open("instruction_sheet.jpg").convert("RGB")
msgs = [{"role": "user", "content": [image, "Extract all paint codes from this image as JSON."]}]
result = model.chat(image=None, msgs=msgs, tokenizer=tokenizer)
print(result)
- Downloads last month
- 84
Model tree for build-small-hackathon/paint-match-minicpm
Base model
openbmb/MiniCPM-V-4.6