Instructions to use GameGC/questions-lfm2-4bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use GameGC/questions-lfm2-4bit with MLX:
# Make sure mlx-lm is installed # pip install --upgrade mlx-lm # Generate text with mlx-lm from mlx_lm import load, generate model, tokenizer = load("GameGC/questions-lfm2-4bit") prompt = "Write a story about Einstein" messages = [{"role": "user", "content": prompt}] prompt = tokenizer.apply_chat_template( messages, add_generation_prompt=True ) text = generate(model, tokenizer, prompt=prompt, verbose=True) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- LM Studio
- Pi
How to use GameGC/questions-lfm2-4bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "GameGC/questions-lfm2-4bit"
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "mlx-lm": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "GameGC/questions-lfm2-4bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- MLX LM
How to use GameGC/questions-lfm2-4bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "GameGC/questions-lfm2-4bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "GameGC/questions-lfm2-4bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "GameGC/questions-lfm2-4bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use GameGC/questions-lfm2-4bit 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 "GameGC/questions-lfm2-4bit"
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 GameGC/questions-lfm2-4bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use GameGC/questions-lfm2-4bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "GameGC/questions-lfm2-4bit"
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 "GameGC/questions-lfm2-4bit" \ --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"
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,85 @@
|
|
| 1 |
---
|
| 2 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
library_name: mlx
|
| 3 |
+
license: apache-2.0
|
| 4 |
+
base_model: LiquidAI/LFM2.5-230M
|
| 5 |
+
tags:
|
| 6 |
+
- mlx
|
| 7 |
+
- lora
|
| 8 |
+
- interview
|
| 9 |
+
- question-extraction
|
| 10 |
+
language: en
|
| 11 |
+
pipeline_tag: text-generation
|
| 12 |
---
|
| 13 |
+
|
| 14 |
+
# questions-lfm2-4bit
|
| 15 |
+
|
| 16 |
+
LFM2.5-230M fine-tuned with **MLX LoRA** to extract interview questions from transcripts tagged with `[S]` (speaker) and `[M]` (mentor) markers.
|
| 17 |
+
|
| 18 |
+
## Pipeline
|
| 19 |
+
|
| 20 |
+
1. LoRA fine-tune in MLX (rank 32, 200 iters, 6.19M trainable params / 2.7%)
|
| 21 |
+
2. Fuse adapter into base model → fp16
|
| 22 |
+
3. Quantize to 4-bit (group size 64)
|
| 23 |
+
|
| 24 |
+
## Input format
|
| 25 |
+
|
| 26 |
+
Transcript with `[S]` and `[M]` line prefixes:
|
| 27 |
+
|
| 28 |
+
```
|
| 29 |
+
[S] what attracted you to apply to oxen
|
| 30 |
+
[M] so i was interested in your role so as i have like javascript typescript react experience
|
| 31 |
+
[S] ok
|
| 32 |
+
[M] yeah so could you tell me more about the project you are working on
|
| 33 |
+
```
|
| 34 |
+
|
| 35 |
+
## Output
|
| 36 |
+
|
| 37 |
+
A single extracted question (no question mark, no quotes). If the last `[M]` block has no question, falls back to the `[M]` content.
|
| 38 |
+
|
| 39 |
+
## Usage (Python)
|
| 40 |
+
|
| 41 |
+
```python
|
| 42 |
+
from mlx_lm import load, generate
|
| 43 |
+
|
| 44 |
+
model, tokenizer = load("GameGC/questions-lfm2-4bit")
|
| 45 |
+
|
| 46 |
+
messages = [
|
| 47 |
+
{"role": "system", "content": "Extract the most recent question from the transcript."},
|
| 48 |
+
{"role": "user", "content": "[S] what attracted you to apply\n[M] i was interested in your role\n[S] ok\n[M] could you tell me more about the project"},
|
| 49 |
+
]
|
| 50 |
+
prompt = tokenizer.apply_chat_template(messages, add_generation_prompt=True)
|
| 51 |
+
out = generate(model, tokenizer, prompt=prompt, max_tokens=80)
|
| 52 |
+
print(out)
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
## Usage (Swift)
|
| 56 |
+
|
| 57 |
+
```swift
|
| 58 |
+
import MLXLMCommon
|
| 59 |
+
|
| 60 |
+
let config = ModelConfiguration(id: "GameGC/questions-lfm2-4bit")
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
## Limitations
|
| 64 |
+
|
| 65 |
+
- **Trap cases**: declarative `[M]` statements containing question-sounding words ("how", rhetorical "right") may cause the model to hallucinate a question instead of returning the `[S]` content. Will be fixed in v2 with negative training examples.
|
| 66 |
+
- Quantized to 4-bit: minor quality regression vs fp16 fused version.
|
| 67 |
+
- Trained on 315 examples — narrow domain (interview transcripts).
|
| 68 |
+
|
| 69 |
+
## Training
|
| 70 |
+
|
| 71 |
+
| Hyperparameter | Value |
|
| 72 |
+
|---|---|
|
| 73 |
+
| Base | LiquidAI/LFM2.5-230M |
|
| 74 |
+
| Method | MLX LoRA |
|
| 75 |
+
| Rank | 32 |
|
| 76 |
+
| Alpha | 64 |
|
| 77 |
+
| LoRA keys | `self_attn.{q,k,v,out}_proj`, `feed_forward.{w1,w2,w3}` |
|
| 78 |
+
| Trainable params | 6.19M (2.696%) |
|
| 79 |
+
| Iters | 200 |
|
| 80 |
+
| Learning rate | 2e-4 (cosine decay, warmup 10) |
|
| 81 |
+
| Max seq length | 1024 |
|
| 82 |
+
| Batch size | 4 × 4 grad accum |
|
| 83 |
+
| Val loss | 3.264 → 0.360 |
|
| 84 |
+
| Train loss | 3.144 → 0.368 |
|
| 85 |
+
| Duration | 110s on M-series Mac
|