Image-Text-to-Text
Safetensors
GGUF
English
llama.cpp
test-fixture
tool-calling
ocr
mtp
pruning
conversational
Instructions to use Serveurperso/small-test 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 Serveurperso/small-test 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 Serveurperso/small-test:F16 # Run inference directly in the terminal: llama cli -hf Serveurperso/small-test:F16
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf Serveurperso/small-test:F16 # Run inference directly in the terminal: llama cli -hf Serveurperso/small-test:F16
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 Serveurperso/small-test:F16 # Run inference directly in the terminal: ./llama-cli -hf Serveurperso/small-test:F16
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 Serveurperso/small-test:F16 # Run inference directly in the terminal: ./build/bin/llama-cli -hf Serveurperso/small-test:F16
Use Docker
docker model run hf.co/Serveurperso/small-test:F16
- LM Studio
- Jan
- vLLM
How to use Serveurperso/small-test with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Serveurperso/small-test" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Serveurperso/small-test", "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/Serveurperso/small-test:F16
- Ollama
How to use Serveurperso/small-test with Ollama:
ollama run hf.co/Serveurperso/small-test:F16
- Unsloth Desktop
- Pi
How to use Serveurperso/small-test with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Serveurperso/small-test:F16
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:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Serveurperso/small-test:F16" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use Serveurperso/small-test with Docker Model Runner:
docker model run hf.co/Serveurperso/small-test:F16
- Lemonade
How to use Serveurperso/small-test with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Serveurperso/small-test:F16
Run and chat with the model
lemonade run user.small-test-F16
List all available models
lemonade list
- Hermes Agent
How to use Serveurperso/small-test with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Serveurperso/small-test:F16
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 Serveurperso/small-test:F16
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Serveurperso/small-test with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf Serveurperso/small-test:F16
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:8080/v1 \ --custom-model-id "Serveurperso/small-test:F16" \ --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 src/test_small_test.py from Serveurperso/small-test: direct link, hf CLI and curl.
- Browser
- Download file 4.12 kB
-
https://huggingface.co/Serveurperso/small-test/resolve/main/src/test_small_test.py
- Command line
-
hf download hf://Serveurperso/small-test/src/test_small_test.py
-
curl -L -o test_small_test.py https://huggingface.co/Serveurperso/small-test/resolve/main/src/test_small_test.py
4.12 kB
| import pytest | |
| import base64 | |
| import io | |
| from utils import * | |
| from unit.test_tool_call import TIMEOUT_HTTP_REQUEST, CompletionMode, TEST_TOOL, PYTHON_TOOL, WEATHER_TOOL, do_test_completion_with_required_tool_tiny, do_test_completion_without_tool_call, do_test_weather, do_test_calc_result, do_test_hello_world | |
| # one ~95M multimodal fixture exercising chat, tool calling, OCR and MTP drafting | |
| server: ServerProcess | |
| GREEDY = {"temperature": 0.0, "top_k": 1, "top_p": 1.0} | |
| def create_server(): | |
| global server | |
| server = ServerPreset.small_test() | |
| def ocr_image(text: str) -> str: | |
| # a PNG with black text on white in a common truetype font, the kind of image the fixture is trained on | |
| from PIL import Image, ImageDraw, ImageFont | |
| font = ImageFont.truetype("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf", 28) | |
| img = Image.new("RGB", (360, 80), "white") | |
| ImageDraw.Draw(img).text((16, 20), text, font=font, fill="black") | |
| buf = io.BytesIO(); img.save(buf, format="PNG") | |
| return "data:image/png;base64," + base64.b64encode(buf.getvalue()).decode() | |
| def test_required_tool(tool: dict, argument_key: str, stream: CompletionMode): | |
| global server | |
| server.start() | |
| do_test_completion_with_required_tool_tiny(server, tool, argument_key, 256, stream=stream == CompletionMode.STREAMED, **GREEDY) | |
| def test_weather(stream: CompletionMode): | |
| global server | |
| server.start() | |
| do_test_weather(server, stream=stream == CompletionMode.STREAMED, max_tokens=256, **GREEDY) | |
| def test_hello_world(stream: CompletionMode): | |
| global server | |
| server.start() | |
| do_test_hello_world(server, stream=stream == CompletionMode.STREAMED, max_tokens=256, **GREEDY) | |
| def test_calc_result(stream: CompletionMode): | |
| global server | |
| server.start() | |
| do_test_calc_result(server, None, 256, stream=stream == CompletionMode.STREAMED, **GREEDY) | |
| def test_without_tool_call(tools, tool_choice, stream: CompletionMode): | |
| global server | |
| server.start() | |
| do_test_completion_without_tool_call(server, 64, tools, tool_choice, stream=stream == CompletionMode.STREAMED, **GREEDY) | |
| def test_ocr(text: str): | |
| global server | |
| server.start() | |
| body = server.make_any_request("POST", "/v1/chat/completions", data={ | |
| "max_tokens": 32, | |
| "messages": [{"role": "user", "content": [ | |
| {"type": "image_url", "image_url": {"url": ocr_image(text)}}, | |
| {"type": "text", "text": "What is written in this image?"}, | |
| ]}], | |
| **GREEDY, | |
| }, timeout=TIMEOUT_HTTP_REQUEST) | |
| content = body["choices"][0]["message"]["content"] | |
| assert text.lower() in content.lower(), f"expected {text!r} in {content!r}" | |
| def test_mtp_draft_matches_target(): | |
| # greedy tokens are identical with and without the MTP draft, and the draft is actually used | |
| global server | |
| server.start() | |
| req = {"prompt": "<|im_start|>user\nList three colors.<|im_end|>\n<|im_start|>assistant\n", "n_predict": 48, "temperature": 0.0, "top_k": 1, "return_tokens": True} | |
| res = server.make_request("POST", "/completion", data=req) | |
| assert res.status_code == 200 | |
| tokens_no_draft = res.body["tokens"] | |
| server.stop() | |
| server.spec_type = "draft-mtp" | |
| server.start() | |
| res = server.make_request("POST", "/completion", data=req) | |
| assert res.status_code == 200 | |
| assert res.body["timings"]["draft_n"] > 0 | |
| assert res.body["tokens"] == tokens_no_draft | |