Instructions to use shuff57/lfm2-24b-phase1-reasoning-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use shuff57/lfm2-24b-phase1-reasoning-GGUF with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="shuff57/lfm2-24b-phase1-reasoning-GGUF", filename="lfm2-24b-phase1-Q4_K_M.gguf", )
llm.create_chat_completion( messages = "No input example has been defined for this model task." )
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use shuff57/lfm2-24b-phase1-reasoning-GGUF 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 shuff57/lfm2-24b-phase1-reasoning-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf shuff57/lfm2-24b-phase1-reasoning-GGUF:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf shuff57/lfm2-24b-phase1-reasoning-GGUF:Q4_K_M # Run inference directly in the terminal: llama cli -hf shuff57/lfm2-24b-phase1-reasoning-GGUF: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 shuff57/lfm2-24b-phase1-reasoning-GGUF:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf shuff57/lfm2-24b-phase1-reasoning-GGUF: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 shuff57/lfm2-24b-phase1-reasoning-GGUF:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf shuff57/lfm2-24b-phase1-reasoning-GGUF:Q4_K_M
Use Docker
docker model run hf.co/shuff57/lfm2-24b-phase1-reasoning-GGUF:Q4_K_M
- LM Studio
- Jan
- Ollama
How to use shuff57/lfm2-24b-phase1-reasoning-GGUF with Ollama:
ollama run hf.co/shuff57/lfm2-24b-phase1-reasoning-GGUF:Q4_K_M
- Unsloth Studio
How to use shuff57/lfm2-24b-phase1-reasoning-GGUF 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 shuff57/lfm2-24b-phase1-reasoning-GGUF 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 shuff57/lfm2-24b-phase1-reasoning-GGUF to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for shuff57/lfm2-24b-phase1-reasoning-GGUF to start chatting
- Pi
How to use shuff57/lfm2-24b-phase1-reasoning-GGUF with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf shuff57/lfm2-24b-phase1-reasoning-GGUF: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": "shuff57/lfm2-24b-phase1-reasoning-GGUF:Q4_K_M" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use shuff57/lfm2-24b-phase1-reasoning-GGUF with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf shuff57/lfm2-24b-phase1-reasoning-GGUF: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 shuff57/lfm2-24b-phase1-reasoning-GGUF:Q4_K_M
Run Hermes
hermes
- Atomic Chat new
- OpenClaw new
How to use shuff57/lfm2-24b-phase1-reasoning-GGUF with OpenClaw:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama serve -hf shuff57/lfm2-24b-phase1-reasoning-GGUF: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 "shuff57/lfm2-24b-phase1-reasoning-GGUF: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"
- Docker Model Runner
How to use shuff57/lfm2-24b-phase1-reasoning-GGUF with Docker Model Runner:
docker model run hf.co/shuff57/lfm2-24b-phase1-reasoning-GGUF:Q4_K_M
- Lemonade
How to use shuff57/lfm2-24b-phase1-reasoning-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull shuff57/lfm2-24b-phase1-reasoning-GGUF:Q4_K_M
Run and chat with the model
lemonade run user.lfm2-24b-phase1-reasoning-GGUF-Q4_K_M
List all available models
lemonade list
YAML Metadata Warning:empty or missing yaml metadata in repo card
Check out the documentation for more information.
LFM2-24B-A2B Phase 1 Reasoning โ GGUF Q4_K_M GGUF quantization of shuff57/lfm2-24b-phase1-reasoning (https://huggingface.co/shuff57/lfm2-24b-phase1-reasoning). Model Description This is the Phase 1 reasoning fine-tuned version of LiquidAI's LFM2-24B-A2B (24B MoE, 2.3B active parameters) model, trained on 13,201 synthetic reasoning examples generated for the O.G.R.E. (OllamaGradingRubricEvaluator) project. The base model (LiquidAI/LFM2-24B-A2B) was further fine-tuned using Unsloth's QLoRA approach with:
- LoRA rank: 16
- LoRA alpha: 16
- Target modules: ["q_proj", "k_proj", "v_proj", "out_proj", "in_proj", "w1", "w2", "w3"]
- Sequence length: 8192
- Packing: False (critical for LFM2 MoE routing stability)
- Training on responses only (using unsloth.chat_templates.train_on_responses_only)
- Optimizer: adamw_8bit
- Learning rate: 2e-5
- Epochs: 1 (effective steps: ~1,568)
- Precision: bfloat16 After training, the LoRA adapters were merged into the base model and saved in 16-bit format. GGUF Quantization The merged model was converted to GGUF format for efficient CPU usage with llama.cpp and Ollama. Conversion Process
- Model Loading: Loaded with device_map="cpu" to avoid MoE-related VRAM overflow during transformation.
- HF โ GGUF Conversion: Used the llama.cpp conversion pipeline:
- Cloned llama.cpp (commit post-Oct 2025, includes native lfm2_moe support)
- Configured with cmake -B llama.cpp/build -S llama.cpp -DCMAKE_BUILD_TYPE=Release
- Built all targets (cmake --build llama.cpp/build --config Release)
- Located the llama-quantize binary via glob search
- Quantization: Applied Q4_K_M quantization:
./llama.cpp/build/bin/llama-quantize lfm2-24b-phase1-F16.gguf lfm2-24b-phase1-Q4_K_M.gguf Q4_K_M
- Validation: The resulting GGUF file was tested with Ollama and llama.cpp for correct LFM2 MoE handling. Quantization Details
- Format: GGUF (GPT-Generated Unified Format)
- Quantization Method: Q4_K_M (4-bit with mixed precision, state-of-the-art balance)
- Estimated Size: ~14.42 GB
- VRAM Usage: Can be run on systems with <8GB VRAM when offloaded, or CPU-only
- Context Length: 8192 tokens (matches training) Usage with Ollama Create a Modelfile: FROM ./lfm2-24b-phase1-Q4_K_M.gguf SYSTEM "You are a careful analytical reasoner. Think step by step before answering." RENDERER lfm2 PARSER lfm2 PARAMETER temperature 0.1 PARAMETER top_k 50 PARAMETER top_p 0.95 PARAMETER repeat_penalty 1.05 PARAMETER num_ctx 8192 Then: ollama create lfm2-24b-phase1-reasoning -f Modelfile ollama run lfm2-24b-phase1-reasoning "Your prompt here" Usage with llama.cpp llama-cli -m lfm2-24b-phase1-Q4_K_M.gguf -p "You are a careful analytical reasoner." --temp 0.1 -n 512 Training Data The Phase 1 reasoning model was trained on a synthetic dataset of 13,201 examples designed to teach step-by-step reasoning, logical deduction, and mathematical problem-solving. The dataset is available at:
- shuff57/ogre-phase1-synth (https://huggingface.co/datasets/shuff57/ogre-phase1-synth) Related Models
- Base Model: LiquidAI/LFM2-24B-A2B (https://huggingface.co/LiquidAI/LFM2-24B-A2B)
- Phase 1 Reasoning (HF): shuff57/lfm2-24b-phase1-reasoning (https://huggingface.co/shuff57/lfm2-24b-phase1-reasoning) (16-bit merged weights)
- Phase 2 Stat Grader: shuff57/lfm2-24b-grader (https://huggingface.co/shuff57/lfm2-24b-grader) (in progress) Citation If you use this model, please cite the O.G.R.E. project: @misc{ogre2026, title={O.G.R.E.: OllamaGradingRubricEvaluator}, author={shuff57}, year={2026}, publisher={Hugging Face}, url={https://huggingface.co/shuff57} } License Apache 2.0 โ same as the base LFM2-24B-A2B model.
- Downloads last month
- 8
4-bit