Any-to-Any
Transformers
Safetensors
GGUF
English
gemma4
image-text-to-text
4-bit precision
8-bit precision
bitsandbytes
conversational
Instructions to use LetheanNetwork/lemer-bk with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use LetheanNetwork/lemer-bk with Transformers:
# Load model directly from transformers import AutoProcessor, AutoModelForMultimodalLM processor = AutoProcessor.from_pretrained("LetheanNetwork/lemer-bk") model = AutoModelForMultimodalLM.from_pretrained("LetheanNetwork/lemer-bk", device_map="auto") messages = [ { "role": "user", "content": [ {"type": "image", "url": "https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/p-blog/candy.JPG"}, {"type": "text", "text": "What animal is on the candy?"} ] }, ] inputs = processor.apply_chat_template( messages, add_generation_prompt=True, tokenize=True, return_dict=True, return_tensors="pt", ).to(model.device) outputs = model.generate(**inputs, max_new_tokens=40) print(processor.decode(outputs[0][inputs["input_ids"].shape[-1]:])) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use LetheanNetwork/lemer-bk 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 LetheanNetwork/lemer-bk:Q4_K_M # Run inference directly in the terminal: llama cli -hf LetheanNetwork/lemer-bk:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf LetheanNetwork/lemer-bk:Q4_K_M # Run inference directly in the terminal: llama cli -hf LetheanNetwork/lemer-bk: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 LetheanNetwork/lemer-bk:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf LetheanNetwork/lemer-bk: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 LetheanNetwork/lemer-bk:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf LetheanNetwork/lemer-bk:Q4_K_M
Use Docker
docker model run hf.co/LetheanNetwork/lemer-bk:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use LetheanNetwork/lemer-bk with Ollama:
ollama run hf.co/LetheanNetwork/lemer-bk:Q4_K_M
- Unsloth Desktop
- Pi
How to use LetheanNetwork/lemer-bk with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf LetheanNetwork/lemer-bk:Q4_K_M
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": "LetheanNetwork/lemer-bk:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use LetheanNetwork/lemer-bk with Docker Model Runner:
docker model run hf.co/LetheanNetwork/lemer-bk:Q4_K_M
- Lemonade
How to use LetheanNetwork/lemer-bk with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull LetheanNetwork/lemer-bk:Q4_K_M
Run and chat with the model
lemonade run user.lemer-bk-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use LetheanNetwork/lemer-bk with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf LetheanNetwork/lemer-bk: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 LetheanNetwork/lemer-bk:Q4_K_M
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use LetheanNetwork/lemer-bk with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf LetheanNetwork/lemer-bk:Q4_K_M
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 "LetheanNetwork/lemer-bk:Q4_K_M" \ --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"
docs: add benchmarks grid + rapid-mlx usage
Browse files
README.md
CHANGED
|
@@ -9,6 +9,8 @@ tags:
|
|
| 9 |
- transformers
|
| 10 |
- 8-bit
|
| 11 |
- gguf
|
|
|
|
|
|
|
| 12 |
base_model:
|
| 13 |
- google/gemma-4-E2B-it
|
| 14 |
base_model_relation: quantized
|
|
@@ -18,13 +20,60 @@ library_name: mlx
|
|
| 18 |
|
| 19 |
# Lemer
|
| 20 |
|
| 21 |
-
A Gemma 4 E2B
|
| 22 |
-
|
| 23 |
-
EUPL-1.2 · Apache 2.0 base · [lthn.ai
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
## Use
|
| 26 |
|
| 27 |
-
### MLX
|
| 28 |
|
| 29 |
```bash
|
| 30 |
pip install mlx-lm
|
|
@@ -37,10 +86,21 @@ model, tokenizer = load("lthn/lemer", revision="4bit")
|
|
| 37 |
response = generate(model, tokenizer, prompt="Hello", max_tokens=200)
|
| 38 |
```
|
| 39 |
|
| 40 |
-
###
|
| 41 |
|
| 42 |
```bash
|
| 43 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 44 |
```
|
| 45 |
|
| 46 |
### HF Transformers
|
|
@@ -71,17 +131,18 @@ tokenizer = AutoTokenizer.from_pretrained("lthn/lemer", revision="bf16-hf")
|
|
| 71 |
|
| 72 |
| Branch | Size |
|
| 73 |
|--------|------|
|
| 74 |
-
| `bf16-gguf` |
|
| 75 |
-
| `8bit-gguf` |
|
| 76 |
-
| `6bit-gguf` |
|
| 77 |
-
| `5bit-gguf` |
|
| 78 |
-
| `4bit-gguf` |
|
|
|
|
| 79 |
|
| 80 |
### HF Transformers
|
| 81 |
|
| 82 |
| Branch | Size |
|
| 83 |
|--------|------|
|
| 84 |
-
| `bf16-hf` |
|
| 85 |
|
| 86 |
## Base
|
| 87 |
|
|
@@ -89,11 +150,10 @@ tokenizer = AutoTokenizer.from_pretrained("lthn/lemer", revision="bf16-hf")
|
|
| 89 |
|
| 90 |
## More
|
| 91 |
|
| 92 |
-
- [lthn.ai
|
| 93 |
-
- [Lethean Network](https://
|
| 94 |
-
- [GitHub](https://github.com/dappcore)
|
| 95 |
|
| 96 |
## Licence
|
| 97 |
|
| 98 |
Training data and adapter: [EUPL-1.2](https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12)
|
| 99 |
-
Base model: [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
|
|
|
|
| 9 |
- transformers
|
| 10 |
- 8-bit
|
| 11 |
- gguf
|
| 12 |
+
- lek
|
| 13 |
+
- lethean
|
| 14 |
base_model:
|
| 15 |
- google/gemma-4-E2B-it
|
| 16 |
base_model_relation: quantized
|
|
|
|
| 20 |
|
| 21 |
# Lemer
|
| 22 |
|
| 23 |
+
A Gemma 4 E2B with LEK activation by [Lethean Network](https://lthn.ai).
|
| 24 |
+
|
| 25 |
+
EUPL-1.2 · Apache 2.0 base · [lthn.ai](https://lthn.ai)
|
| 26 |
+
|
| 27 |
+
## Benchmarks
|
| 28 |
+
|
| 29 |
+
MMLU-Pro (TIGER-Lab/MMLU-Pro, test split), deterministic (temperature=0), thinking enabled.
|
| 30 |
+
Evaluated using [rapid-mlx](https://github.com/LetheanNetwork/Rapid-MLX) + OpenAI SDK + Google `parse_response()`.
|
| 31 |
+
|
| 32 |
+
### Lemer vs Stock Gemma 4 E2B (bf16, 20 samples per category)
|
| 33 |
+
|
| 34 |
+
| | Stock E2B bf16 | Lemer bf16 | Delta |
|
| 35 |
+
| :---- | :----: | :----: | :----: |
|
| 36 |
+
| Biology | 40.0% | **60.0%** | +20.0% |
|
| 37 |
+
| Math | 10.0% | **55.0%** | +45.0% |
|
| 38 |
+
| Business | TBC | TBC | TBC |
|
| 39 |
+
| Chemistry | TBC | TBC | TBC |
|
| 40 |
+
| Computer Science | TBC | TBC | TBC |
|
| 41 |
+
| Economics | TBC | TBC | TBC |
|
| 42 |
+
| Engineering | TBC | TBC | TBC |
|
| 43 |
+
| Health | TBC | TBC | TBC |
|
| 44 |
+
| History | TBC | TBC | TBC |
|
| 45 |
+
| Law | TBC | TBC | TBC |
|
| 46 |
+
| Other | TBC | TBC | TBC |
|
| 47 |
+
| Philosophy | TBC | TBC | TBC |
|
| 48 |
+
| Physics | TBC | TBC | TBC |
|
| 49 |
+
| Psychology | TBC | TBC | TBC |
|
| 50 |
+
| **Average** | **25.0%** | **57.5%** | **+32.5%** |
|
| 51 |
+
|
| 52 |
+
> Stock Gemma 4 E2B shows a strong bias toward answer option "I" (50-80% of responses), suggesting RLHF calibration issues when served via MLX. Lemer does not exhibit this bias.
|
| 53 |
+
|
| 54 |
+
### Lemer Quantisation Benchmarks (MMLU-Pro, all categories, avg of 4 runs)
|
| 55 |
+
|
| 56 |
+
| | bf16 | 8bit | 6bit | 5bit | 4bit | mxfp8 | mxfp4 | nvfp4 |
|
| 57 |
+
| :---- | :----: | :----: | :----: | :----: | :----: | :----: | :----: | :----: |
|
| 58 |
+
| Biology | 60.0% | TBC | TBC | TBC | TBC | TBC | TBC | TBC |
|
| 59 |
+
| Math | 55.0% | TBC | TBC | TBC | TBC | TBC | TBC | TBC |
|
| 60 |
+
| Business | TBC | TBC | TBC | TBC | TBC | TBC | TBC | TBC |
|
| 61 |
+
| Chemistry | TBC | TBC | TBC | TBC | TBC | TBC | TBC | TBC |
|
| 62 |
+
| Computer Science | TBC | TBC | TBC | TBC | TBC | TBC | TBC | TBC |
|
| 63 |
+
| Economics | TBC | TBC | TBC | TBC | TBC | TBC | TBC | TBC |
|
| 64 |
+
| Engineering | TBC | TBC | TBC | TBC | TBC | TBC | TBC | TBC |
|
| 65 |
+
| Health | TBC | TBC | TBC | TBC | TBC | TBC | TBC | TBC |
|
| 66 |
+
| History | TBC | TBC | TBC | TBC | TBC | TBC | TBC | TBC |
|
| 67 |
+
| Law | TBC | TBC | TBC | TBC | TBC | TBC | TBC | TBC |
|
| 68 |
+
| Other | TBC | TBC | TBC | TBC | TBC | TBC | TBC | TBC |
|
| 69 |
+
| Philosophy | TBC | TBC | TBC | TBC | TBC | TBC | TBC | TBC |
|
| 70 |
+
| Physics | TBC | TBC | TBC | TBC | TBC | TBC | TBC | TBC |
|
| 71 |
+
| Psychology | TBC | TBC | TBC | TBC | TBC | TBC | TBC | TBC |
|
| 72 |
+
| **Average** | TBC | TBC | TBC | TBC | TBC | TBC | TBC | TBC |
|
| 73 |
|
| 74 |
## Use
|
| 75 |
|
| 76 |
+
### MLX (recommended for Apple Silicon)
|
| 77 |
|
| 78 |
```bash
|
| 79 |
pip install mlx-lm
|
|
|
|
| 86 |
response = generate(model, tokenizer, prompt="Hello", max_tokens=200)
|
| 87 |
```
|
| 88 |
|
| 89 |
+
### Rapid-MLX (OpenAI-compatible server)
|
| 90 |
|
| 91 |
```bash
|
| 92 |
+
pip install rapid-mlx
|
| 93 |
+
rapid-mlx serve lthn/lemer --port 8100
|
| 94 |
+
```
|
| 95 |
+
|
| 96 |
+
```python
|
| 97 |
+
from openai import OpenAI
|
| 98 |
+
client = OpenAI(base_url="http://localhost:8100/v1", api_key="not-needed")
|
| 99 |
+
response = client.chat.completions.create(
|
| 100 |
+
model="default",
|
| 101 |
+
messages=[{"role": "user", "content": "Hello"}],
|
| 102 |
+
)
|
| 103 |
+
print(response.choices[0].message.content)
|
| 104 |
```
|
| 105 |
|
| 106 |
### HF Transformers
|
|
|
|
| 131 |
|
| 132 |
| Branch | Size |
|
| 133 |
|--------|------|
|
| 134 |
+
| `bf16-gguf` | 8.7G |
|
| 135 |
+
| `8bit-gguf` | 4.6G |
|
| 136 |
+
| `6bit-gguf` | 3.6G |
|
| 137 |
+
| `5bit-gguf` | 3.0G |
|
| 138 |
+
| `4bit-gguf` | 2.5G |
|
| 139 |
+
| `3bit-gguf` | 2.0G |
|
| 140 |
|
| 141 |
### HF Transformers
|
| 142 |
|
| 143 |
| Branch | Size |
|
| 144 |
|--------|------|
|
| 145 |
+
| `bf16-hf` | 8.7G |
|
| 146 |
|
| 147 |
## Base
|
| 148 |
|
|
|
|
| 150 |
|
| 151 |
## More
|
| 152 |
|
| 153 |
+
- [lthn.ai](https://lthn.ai)
|
| 154 |
+
- [Lethean Network](https://github.com/LetheanNetwork)
|
|
|
|
| 155 |
|
| 156 |
## Licence
|
| 157 |
|
| 158 |
Training data and adapter: [EUPL-1.2](https://joinup.ec.europa.eu/collection/eupl/eupl-text-eupl-12)
|
| 159 |
+
Base model: [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0)
|