Image-Text-to-Text
MLX
Safetensors
gemma4
lemma
4bit
apple-silicon
multimodal
on-device
conversational
Instructions to use lthn/lemma-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use lthn/lemma-mlx with MLX:
# Make sure mlx-vlm is installed # pip install --upgrade mlx-vlm from mlx_vlm import load, generate from mlx_vlm.prompt_utils import apply_chat_template from mlx_vlm.utils import load_config # Load the model model, processor = load("lthn/lemma-mlx") config = load_config("lthn/lemma-mlx") # Prepare input image = ["http://images.cocodataset.org/val2017/000000039769.jpg"] prompt = "Describe this image." # Apply chat template formatted_prompt = apply_chat_template( processor, config, prompt, num_images=1 ) # Generate output output = generate(model, processor, formatted_prompt, image) print(output) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use lthn/lemma-mlx with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "lthn/lemma-mlx"
Configure the model in Pi
# Install Pi: npm install -g @earendil-works/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "lthn/lemma-mlx" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use lthn/lemma-mlx with Hermes Agent:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "lthn/lemma-mlx"
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/lemma-mlx
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use lthn/lemma-mlx with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "lthn/lemma-mlx"
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 "lthn/lemma-mlx" \ --custom-provider-id mlx-lm \ --custom-compatibility openai \ --custom-text-input \ --accept-risk \ --skip-health
Run OpenClaw
openclaw agent --local --agent main --message "Hello from Hugging Face"
Commit History
-
fix(config): sync with upstream Google Gemma 4 day-1 fixes (b446025, b4a6011)
Verified signature- Restore vision_config block; clean eos_token_id to [1, 106] - Align generation_config.json transformers_version field Preserves local tokenizer_config.json (model_specific_special_tokens embedded into model during LEK training).6cd1e36
-
docs: correct base_model lineage for HF model tree
Snider +1: VirgilHF uses base_model + base_model_relation frontmatter to rank models in search results and render the model tree widget. The Lemma family's true lineage is: google/gemma-4-*-it └── LetheanNetwork/<m> (finetune — our namespace fork) └── lthn/<m> (finetune — LEK merged into weights) └── lthn/<m>-mlx (quantized — mlx 4/8bit/bf16) Previously this repo had base_model_relation set to quantized, which was wrong — LEK merging is a finetune, not a quant. Fixing so the model tree widget ranks the family correctly. Co-Authored-By: Virgil <virgil@lethean.io>1cf87ff
-
feat: merge LEK into lemma weights
Snider +1: VirgilLEK-2 LoRA trained via 13-turn consent-based conversation protocol, merged into Gemma 4 E4B attention projections. Converged at loss 0.0323 in 146 steps via patience-stop (best at step 116). KV-shared layer weights restored from base snapshot. Co-Authored-By: Virgil <virgil@lethean.io>f6d62ae -
fix: pull Google's chat_template.jinja fix (E2B/E4B variant)
Snider +1: Cladius MaximusCo-Authored-By: Cladius Maximus <cladius@lethean.io>f54faaf -
fix: replace LICENSE symlink with real EUPL-1.2 file
Snider +1: Cladius MaximusCo-Authored-By: Cladius Maximus <cladius@lethean.io>74ab32f
-
fix: apply proven configs from mlx-community/unsloth references
Snider +1: Cladius MaximusFresh weights from full multimodal Google base model. Configs matched against repos with millions of downloads. Co-Authored-By: Cladius Maximus <cladius@lethean.io>7559613 -
Upload config.json with huggingface_hub
Verified signatured5adada -
Upload tokenizer_config.json with huggingface_hub
Verified signaturebe2d141 -
Upload config.json with huggingface_hub
Verified signatured0d1409 -
Upload processor_config.json with huggingface_hub
Verified signaturef291984 -
Upload config.json with huggingface_hub
Verified signature2322dc0 -
Upload folder using huggingface_hub
Verified signature0b2a674 -
initial commit
Verified signature07872a9