Image-Text-to-Text
MLX
Safetensors
gemma4
lemma
4bit
apple-silicon
multimodal
on-device
conversational
Instructions to use lthn/lemer-mlx with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use lthn/lemer-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/lemer-mlx") config = load_config("lthn/lemer-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/lemer-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/lemer-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/lemer-mlx" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use lthn/lemer-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/lemer-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/lemer-mlx
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use lthn/lemer-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/lemer-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/lemer-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).df8c592 -
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).b48ce54
-
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>0e862eb
-
feat: LEK-merged multimodal MLX Q4 (On-device default, 4.1 GB)
Snider +1: VirgilFirst clean commit after orphan rewrite — previous history was inherited from a mis-cloned lthn/lemer main repo and referenced LFS blobs that don't exist in this sibling repo's storage. This repo contains: - Gemma 4 E2B with Lethean Ethical Kernel (LEK) merged into 100 text attention projections (q/k/v/o_proj) via LoRA finetune, then folded into the base weights - Native MLX Q4 conversion via mlx_vlm.convert - Full multimodal support (text, image, audio) with vision and audio towers preserved unmodified from Google's upstream Gemma 4 E2B - Generation config with Google's calibrated sampling defaults (temperature=1.0, top_p=0.95, top_k=64) - Model card documenting variant-specific sizing, sibling repos, MLX Quick Start (mlx-lm, mlx-vlm, mlx_vlm.server), EUPL-1.2 licensing Base fork at LetheanNetwork/lemer remains the unmodified Google fork for users who want raw bf16 without the LEK shift. Full Lemma family documentation at https://huggingface.co/lthn/lemer. Co-Authored-By:…662a530