Instructions to use AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro with MLX:
# Download the model from the Hub pip install huggingface_hub[hf_xet] hf download AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro --local-dir coder-lfm3-1.7b-k3.1-pro
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro 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 AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro:Q4_K_M # Run inference directly in the terminal: llama cli -hf AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro:Q4_K_M # Run inference directly in the terminal: llama cli -hf AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro:Q4_K_M
Build from source code
git clone https://github.com/ggml-org/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-app # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama serve -hf AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama cli -hf AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro:Q4_K_M
Use Docker
docker model run hf.co/AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro:Q4_K_M
- Llama new
- LM Studio
- Jan
- Ollama
How to use AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro with Ollama:
ollama run hf.co/AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro:Q4_K_M
- Unsloth Desktop
- Pi
How to use AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro"
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": "AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Docker Model Runner
How to use AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro with Docker Model Runner:
docker model run hf.co/AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro:Q4_K_M
- Lemonade
How to use AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro:Q4_K_M
Run and chat with the model
lemonade run user.coder-lfm3-1.7b-k3.1-pro-Q4_K_M
List all available models
lemonade list
- Hermes Agent
How to use AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro 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 "AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro"
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 AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro"
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 "AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro" \ --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"
coder-lfm3-1.7b-k3.1-pro
LFM3-1.7B fine-tuned on the Coder profile of a corpus generated by
moonshotai/kimi-k3.1-pro (OpenRouter, canonical moonshotai/kimi-k3.1-pro-20261023).
The teacher's traces are long normative reasoning followed by a fenced implementation; this adapter moves LFM3 toward that shape for code and CS prompts.
Training
| base | LiquidAI/LFM3-1.7B, MLX 4-bit conversion |
| data | AJ-Gonzalez/coder-kimi-k3.1-pro-lfm3 โ 69 rows โ 289 train / 34 valid chunks |
| chunking | 2048 tokens, 256-token replay, one example per chunk |
| LoRA | rank 8, 8 layers, 2.753M trainable (0.159%) |
| batch / seq | 1 / 2048 |
| optimizer | Adam, lr 1e-5 |
| schedule | 3 epochs = 867 iters, save + eval every 289 |
| memory | --grad-checkpoint (mandatory at seq 2048 on 8 GB) |
| wall time | 2.96 h on M1 8 GB |
Validation loss: 2.861 โ 2.581 โ 2.594 โ 2.438. The final epoch was the best, so
adapters/adapters.safetensors is the keeper.
Files
model.safetensorsโ 4-bit MLX weights, 946 MB, 4.503 bits/weight.adapters/โ the LoRA adapter (11 MB) for re-fusing or further training.
The bf16 merged model is not included; regenerate it with:
mlx_lm.fuse --model LiquidAI/LFM3-1.7B --adapter-path adapters \
--save-path coder-lfm3-1.7b-k3.1-pro --dequantize
Usage
mlx_lm.generate --model AJ-Gonzalez/coder-lfm3-1.7b-k3.1-pro \
--prompt "Write a Python function that returns the first 12 prime numbers, with a one-line docstring." \
--max-tokens 3000
The LFM3 chat template is applied by default. On M1 8 GB: 46โ48 tok/s, 1.19 GB peak.
Sample (greedy, 3000 tokens; the trace self-corrects a bad first draft):
def first_12_primes():
"""Return the first 12 prime numbers."""
primes = []
candidate = 2
while len(primes) < 12:
is_prime = True
for p in primes:
if p * p > candidate:
break
if candidate % p == 0:
is_prime = False
break
if is_prime:
primes.append(candidate)
candidate += 1
return primes
How the data was made
The generator and the full recipe are in the dataset card. In short:
openrouter_reasoning_corpus.pyregenerates the MiMo prompts with any OpenRouter teacher (gist: https://gist.github.com/AJ-Gonzalez/31f1f8cfe45c233911e055d5cfed6da0).build_profile_dataset.py coder --source corpus.jsonlrenders with the LFM3 template and chunks to 2048/256.
GGUF
coder-lfm3-1.7b-k3.1-pro-Q4_K_M.gguf โ 1.1 GB, 5.05 bits/weight,
SHA-256 31206a46f468afbcb9147ddde78be4335840acbf8ef8e713f5369d78620020c1.
llama-cli -m coder-lfm3-1.7b-k3.1-pro-Q4_K_M.gguf \
-p "Write a Python function that returns the first 12 prime numbers." -n 96
Q4_K_M decodes at ~37.6 tok/s on M1 (96-token smoke, not a benchmark). The f16 intermediate
(3.3 GB) is not uploaded; regenerate it with
tools/llama.cpp/convert_hf_to_gguf.py --outtype f16 from the fused bf16, then
llama-quantize ... Q4_K_M.
License and attribution
- Base model: LiquidAI/LFM3-1.7B, LFM Open
License v1.0. A copy is included here as
LICENSE. Redistribution must keep that copy, mark modified files, and retain the upstream attribution notices. - Commercial use: permitted only while the licensee's legal entity stays below the license's $10M annual-revenue threshold; above it this model is not licensed for commercial use.
- Data: AJ-Gonzalez/coder-kimi-k3.1-pro-lfm3.
Prompts come from
xtools-at/Xiaomi-MiMo-2.6-Pro-High-Reasoning-250x,
itself sourced from
TeichAI/claude-4.5-opus-high-reasoning-250x.
Responses were generated by
moonshotai/kimi-k3.1-provia OpenRouter. Those upstream terms apply to the traces; this model is released for research/distillation consistent with them. - No warranty. Provided as-is; the author is not liable for downstream use.
- Downloads last month
- 695
4-bit