Instructions to use lthn/lemrd with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use lthn/lemrd with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="lthn/lemrd", filename="lemrd-bf16.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
- llama.cpp
How to use lthn/lemrd with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf lthn/lemrd:Q4_K_M # Run inference directly in the terminal: llama-cli -hf lthn/lemrd:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf lthn/lemrd:Q4_K_M # Run inference directly in the terminal: llama-cli -hf lthn/lemrd: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 lthn/lemrd:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf lthn/lemrd: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 lthn/lemrd:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf lthn/lemrd:Q4_K_M
Use Docker
docker model run hf.co/lthn/lemrd:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use lthn/lemrd with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "lthn/lemrd" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "lthn/lemrd", "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/lthn/lemrd:Q4_K_M
- Ollama
How to use lthn/lemrd with Ollama:
ollama run hf.co/lthn/lemrd:Q4_K_M
- Unsloth Studio new
How to use lthn/lemrd 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 lthn/lemrd 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 lthn/lemrd to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for lthn/lemrd to start chatting
- Pi new
How to use lthn/lemrd with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf lthn/lemrd:Q4_K_M
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": "lthn/lemrd:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use lthn/lemrd with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf lthn/lemrd:Q4_K_M
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 lthn/lemrd:Q4_K_M
Run Hermes
hermes
- Docker Model Runner
How to use lthn/lemrd with Docker Model Runner:
docker model run hf.co/lthn/lemrd:Q4_K_M
- Lemonade
How to use lthn/lemrd with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull lthn/lemrd:Q4_K_M
Run and chat with the model
lemonade run user.lemrd-Q4_K_M
List all available models
lemonade list
tokenizer_config: fix response schema regex — tool_calls before content, add tool_response terminator (from google upstream 2026-04-10)
Browse files- tokenizer_config.json +21 -42
tokenizer_config.json
CHANGED
|
@@ -17,72 +17,51 @@
|
|
| 17 |
"<|video|>"
|
| 18 |
],
|
| 19 |
"image_token": "<|image|>",
|
| 20 |
-
"is_local": true,
|
| 21 |
"mask_token": "<mask>",
|
| 22 |
"model_max_length": 1000000000000000019884624838656,
|
| 23 |
-
"model_specific_special_tokens": {
|
| 24 |
-
"audio_token": "<|audio|>",
|
| 25 |
-
"boa_token": "<|audio>",
|
| 26 |
-
"boi_token": "<|image>",
|
| 27 |
-
"eoa_token": "<audio|>",
|
| 28 |
-
"eoc_token": "<channel|>",
|
| 29 |
-
"eoi_token": "<image|>",
|
| 30 |
-
"eot_token": "<turn|>",
|
| 31 |
-
"escape_token": "<|\"|>",
|
| 32 |
-
"etc_token": "<tool_call|>",
|
| 33 |
-
"etd_token": "<tool|>",
|
| 34 |
-
"etr_token": "<tool_response|>",
|
| 35 |
-
"image_token": "<|image|>",
|
| 36 |
-
"soc_token": "<|channel>",
|
| 37 |
-
"sot_token": "<|turn>",
|
| 38 |
-
"stc_token": "<|tool_call>",
|
| 39 |
-
"std_token": "<|tool>",
|
| 40 |
-
"str_token": "<|tool_response>",
|
| 41 |
-
"think_token": "<|think|>"
|
| 42 |
-
},
|
| 43 |
"pad_token": "<pad>",
|
| 44 |
"padding_side": "left",
|
| 45 |
"processor_class": "Gemma4Processor",
|
| 46 |
"response_schema": {
|
|
|
|
| 47 |
"properties": {
|
| 48 |
-
"content": {
|
| 49 |
-
"type": "string"
|
| 50 |
-
},
|
| 51 |
"role": {
|
| 52 |
"const": "assistant"
|
| 53 |
},
|
| 54 |
"thinking": {
|
| 55 |
"type": "string"
|
| 56 |
},
|
|
|
|
|
|
|
|
|
|
| 57 |
"tool_calls": {
|
|
|
|
|
|
|
| 58 |
"items": {
|
|
|
|
| 59 |
"properties": {
|
|
|
|
|
|
|
|
|
|
| 60 |
"function": {
|
|
|
|
|
|
|
| 61 |
"properties": {
|
| 62 |
-
"arguments": {
|
| 63 |
-
"additionalProperties": {},
|
| 64 |
-
"type": "object",
|
| 65 |
-
"x-parser": "gemma4-tool-call"
|
| 66 |
-
},
|
| 67 |
"name": {
|
| 68 |
"type": "string"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 69 |
}
|
| 70 |
-
}
|
| 71 |
-
"type": "object",
|
| 72 |
-
"x-regex": "call\\:(?P<name>\\w+)(?P<arguments>\\{.*\\})"
|
| 73 |
-
},
|
| 74 |
-
"type": {
|
| 75 |
-
"const": "function"
|
| 76 |
}
|
| 77 |
-
}
|
| 78 |
-
|
| 79 |
-
},
|
| 80 |
-
"type": "array",
|
| 81 |
-
"x-regex-iterator": "<\\|tool_call>(.*?)<tool_call\\|>"
|
| 82 |
}
|
| 83 |
},
|
| 84 |
-
"
|
| 85 |
-
"x-regex": "(\\<\\|channel\\>thought\\n(?P<thinking>.*?)\\<channel\\|\\>)?(?P<content>(?:(?!\\<\\|tool_call\\>)(?!\\<turn\\|\\>).)+)?(?P<tool_calls>\\<\\|tool_call\\>.*\\<tool_call\\|\\>)?(?:\\<turn\\|\\>)?"
|
| 86 |
},
|
| 87 |
"soc_token": "<|channel>",
|
| 88 |
"sot_token": "<|turn>",
|
|
|
|
| 17 |
"<|video|>"
|
| 18 |
],
|
| 19 |
"image_token": "<|image|>",
|
|
|
|
| 20 |
"mask_token": "<mask>",
|
| 21 |
"model_max_length": 1000000000000000019884624838656,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
"pad_token": "<pad>",
|
| 23 |
"padding_side": "left",
|
| 24 |
"processor_class": "Gemma4Processor",
|
| 25 |
"response_schema": {
|
| 26 |
+
"type": "object",
|
| 27 |
"properties": {
|
|
|
|
|
|
|
|
|
|
| 28 |
"role": {
|
| 29 |
"const": "assistant"
|
| 30 |
},
|
| 31 |
"thinking": {
|
| 32 |
"type": "string"
|
| 33 |
},
|
| 34 |
+
"content": {
|
| 35 |
+
"type": "string"
|
| 36 |
+
},
|
| 37 |
"tool_calls": {
|
| 38 |
+
"x-regex-iterator": "<\\|tool_call>(.*?)<tool_call\\|>",
|
| 39 |
+
"type": "array",
|
| 40 |
"items": {
|
| 41 |
+
"type": "object",
|
| 42 |
"properties": {
|
| 43 |
+
"type": {
|
| 44 |
+
"const": "function"
|
| 45 |
+
},
|
| 46 |
"function": {
|
| 47 |
+
"type": "object",
|
| 48 |
+
"x-regex": "call\\:(?P<name>\\w+)(?P<arguments>\\{.*\\})",
|
| 49 |
"properties": {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
"name": {
|
| 51 |
"type": "string"
|
| 52 |
+
},
|
| 53 |
+
"arguments": {
|
| 54 |
+
"type": "object",
|
| 55 |
+
"x-parser": "gemma4-tool-call",
|
| 56 |
+
"additionalProperties": {}
|
| 57 |
}
|
| 58 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 59 |
}
|
| 60 |
+
}
|
| 61 |
+
}
|
|
|
|
|
|
|
|
|
|
| 62 |
}
|
| 63 |
},
|
| 64 |
+
"x-regex": "(\\<\\|channel\\>thought\\n(?P<thinking>.*?)\\<channel\\|\\>)?(?P<tool_calls>\\<\\|tool_call\\>.*\\<tool_call\\|\\>)?(?P<content>(?:(?!\\<turn\\|\\>)(?!\\<\\|tool_response\\>).)+)?(?:\\<turn\\|\\>|\\<\\|tool_response\\>)?"
|
|
|
|
| 65 |
},
|
| 66 |
"soc_token": "<|channel>",
|
| 67 |
"sot_token": "<|turn>",
|