Text Generation
MLX
Safetensors
English
lfm2
speech-to-text
transcript-cleanup
text-correction
asr-post-processing
LFM
LiquidAI
mlx-5bit
conversational
5-bit
Instructions to use juanquivilla/sotto-cleanup-lfm25-350m-mlx-5bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use juanquivilla/sotto-cleanup-lfm25-350m-mlx-5bit 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("juanquivilla/sotto-cleanup-lfm25-350m-mlx-5bit") 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 juanquivilla/sotto-cleanup-lfm25-350m-mlx-5bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "juanquivilla/sotto-cleanup-lfm25-350m-mlx-5bit"
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": "juanquivilla/sotto-cleanup-lfm25-350m-mlx-5bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- OpenClaw new
How to use juanquivilla/sotto-cleanup-lfm25-350m-mlx-5bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "juanquivilla/sotto-cleanup-lfm25-350m-mlx-5bit"
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 "juanquivilla/sotto-cleanup-lfm25-350m-mlx-5bit" \ --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"
- MLX LM
How to use juanquivilla/sotto-cleanup-lfm25-350m-mlx-5bit with MLX LM:
Generate or start a chat session
# Install MLX LM uv tool install mlx-lm # Interactive chat REPL mlx_lm.chat --model "juanquivilla/sotto-cleanup-lfm25-350m-mlx-5bit"
Run an OpenAI-compatible server
# Install MLX LM uv tool install mlx-lm # Start the server mlx_lm.server --model "juanquivilla/sotto-cleanup-lfm25-350m-mlx-5bit" # Calling the OpenAI-compatible server with curl curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "juanquivilla/sotto-cleanup-lfm25-350m-mlx-5bit", "messages": [ {"role": "user", "content": "Hello"} ] }' - Hermes Agent
How to use juanquivilla/sotto-cleanup-lfm25-350m-mlx-5bit 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 "juanquivilla/sotto-cleanup-lfm25-350m-mlx-5bit"
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 juanquivilla/sotto-cleanup-lfm25-350m-mlx-5bit
Run Hermes
hermes
v15: 5-bit MLX quant (237MB, ROUGE-L ~0.955)
Browse files- README.md +69 -3
- chat_template.jinja +7 -0
- config.json +3 -1
- generation_config.json +9 -0
- model.safetensors +1 -1
- tokenizer_config.json +1 -0
README.md
CHANGED
|
@@ -1,7 +1,73 @@
|
|
| 1 |
---
|
| 2 |
-
|
| 3 |
-
|
|
|
|
|
|
|
| 4 |
tags:
|
|
|
|
|
|
|
| 5 |
- mlx
|
| 6 |
-
|
|
|
|
|
|
|
| 7 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
license: mit
|
| 3 |
+
language:
|
| 4 |
+
- en
|
| 5 |
+
base_model: juanquivilla/sotto-cleanup-lfm25-350m
|
| 6 |
tags:
|
| 7 |
+
- speech-to-text
|
| 8 |
+
- transcript-cleanup
|
| 9 |
- mlx
|
| 10 |
+
- quantized
|
| 11 |
+
- apple-silicon
|
| 12 |
+
pipeline_tag: text-generation
|
| 13 |
---
|
| 14 |
+
|
| 15 |
+
# SottoASR Transcript Cleanup — MLX 5-bit (Recommended)
|
| 16 |
+
|
| 17 |
+
5-bit quantized [MLX](https://github.com/ml-explore/mlx) version of [sotto-cleanup-lfm25-350m](https://huggingface.co/juanquivilla/sotto-cleanup-lfm25-350m) for on-device inference on Apple Silicon Macs.
|
| 18 |
+
|
| 19 |
+
## Key Specs
|
| 20 |
+
|
| 21 |
+
| Property | Value |
|
| 22 |
+
|----------|-------|
|
| 23 |
+
| **Base model** | juanquivilla/sotto-cleanup-lfm25-350m (v15) |
|
| 24 |
+
| **Quantization** | 5-bit affine, group_size=64 |
|
| 25 |
+
| **Size on disk** | ~237 MB |
|
| 26 |
+
| **Bits per weight** | 5.502 |
|
| 27 |
+
| **ROUGE-L** | ~0.955 (vs 0.960 bf16) |
|
| 28 |
+
| **Inference** | ~50ms on M1 Pro |
|
| 29 |
+
|
| 30 |
+
## Quantization Recipe
|
| 31 |
+
|
| 32 |
+
```bash
|
| 33 |
+
mlx_lm.convert \
|
| 34 |
+
--hf-path juanquivilla/sotto-cleanup-lfm25-350m \
|
| 35 |
+
--mlx-path sotto-cleanup-lfm25-350m-mlx-5bit \
|
| 36 |
+
-q --q-bits 5 --q-group-size 64 \
|
| 37 |
+
--trust-remote-code
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
## Usage
|
| 41 |
+
|
| 42 |
+
```python
|
| 43 |
+
from mlx_lm import load, generate
|
| 44 |
+
from mlx_lm.sample_utils import make_sampler
|
| 45 |
+
|
| 46 |
+
model, tokenizer = load("juanquivilla/sotto-cleanup-lfm25-350m-mlx-5bit")
|
| 47 |
+
sampler = make_sampler(temp=0.0)
|
| 48 |
+
|
| 49 |
+
text = "so uh basically we need to fix the deployment"
|
| 50 |
+
prompt = f"### Input:\n{text}\n\n### Output:\n"
|
| 51 |
+
|
| 52 |
+
output = generate(model, tokenizer, prompt=prompt, max_tokens=256, sampler=sampler, verbose=False)
|
| 53 |
+
print(output.split("###")[0].strip())
|
| 54 |
+
# → "We need to fix the deployment."
|
| 55 |
+
```
|
| 56 |
+
|
| 57 |
+
## Benchmark (bf16 parent model)
|
| 58 |
+
|
| 59 |
+
| Metric | Score |
|
| 60 |
+
|--------|-------|
|
| 61 |
+
| ROUGE-L | 0.960 |
|
| 62 |
+
| Exact Match | 69.6% |
|
| 63 |
+
| Zero-Filler Rate | 88.1% |
|
| 64 |
+
|
| 65 |
+
See [parent model card](https://huggingface.co/juanquivilla/sotto-cleanup-lfm25-350m) for full benchmark breakdown and training details.
|
| 66 |
+
|
| 67 |
+
## Other Variants
|
| 68 |
+
|
| 69 |
+
| Variant | Size | Repo |
|
| 70 |
+
|---------|------|------|
|
| 71 |
+
| bf16 (full precision) | 676 MB | [sotto-cleanup-lfm25-350m](https://huggingface.co/juanquivilla/sotto-cleanup-lfm25-350m) |
|
| 72 |
+
| **5-bit MLX (this)** | **237 MB** | — |
|
| 73 |
+
| 4-bit MLX | 195 MB | [sotto-cleanup-lfm25-350m-mlx-4bit](https://huggingface.co/juanquivilla/sotto-cleanup-lfm25-350m-mlx-4bit) |
|
chat_template.jinja
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{{- bos_token -}}{%- set system_prompt = "" -%}{%- set ns = namespace(system_prompt="") -%}{%- if messages[0]["role"] == "system" -%} {%- set ns.system_prompt = messages[0]["content"] -%} {%- set messages = messages[1:] -%}{%- endif -%}{%- if tools -%} {%- set ns.system_prompt = ns.system_prompt + ("
|
| 2 |
+
" if ns.system_prompt else "") + "List of tools: <|tool_list_start|>[" -%} {%- for tool in tools -%} {%- if tool is not string -%} {%- set tool = tool | tojson -%} {%- endif -%} {%- set ns.system_prompt = ns.system_prompt + tool -%} {%- if not loop.last -%} {%- set ns.system_prompt = ns.system_prompt + ", " -%} {%- endif -%} {%- endfor -%} {%- set ns.system_prompt = ns.system_prompt + "]<|tool_list_end|>" -%}{%- endif -%}{%- if ns.system_prompt -%} {{- "<|im_start|>system
|
| 3 |
+
" + ns.system_prompt + "<|im_end|>
|
| 4 |
+
" -}}{%- endif -%}{%- for message in messages -%} {{- "<|im_start|>" + message["role"] + "
|
| 5 |
+
" -}} {%- set content = message["content"] -%} {%- if content is not string -%} {%- set content = content | tojson -%} {%- endif -%} {%- if message["role"] == "tool" -%} {%- set content = "<|tool_response_start|>" + content + "<|tool_response_end|>" -%} {%- endif -%} {{- content + "<|im_end|>
|
| 6 |
+
" -}}{%- endfor -%}{%- if add_generation_prompt -%} {{- "<|im_start|>assistant
|
| 7 |
+
" -}}{%- endif -%}
|
config.json
CHANGED
|
@@ -18,7 +18,9 @@
|
|
| 18 |
"conv_dim": 1024,
|
| 19 |
"conv_use_xavier_init": true,
|
| 20 |
"dtype": "bfloat16",
|
| 21 |
-
"eos_token_id":
|
|
|
|
|
|
|
| 22 |
"hidden_size": 1024,
|
| 23 |
"initializer_range": 0.02,
|
| 24 |
"intermediate_size": 6656,
|
|
|
|
| 18 |
"conv_dim": 1024,
|
| 19 |
"conv_use_xavier_init": true,
|
| 20 |
"dtype": "bfloat16",
|
| 21 |
+
"eos_token_id": [
|
| 22 |
+
7
|
| 23 |
+
],
|
| 24 |
"hidden_size": 1024,
|
| 25 |
"initializer_range": 0.02,
|
| 26 |
"intermediate_size": 6656,
|
generation_config.json
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_from_model_config": true,
|
| 3 |
+
"bos_token_id": 1,
|
| 4 |
+
"eos_token_id": [
|
| 5 |
+
7
|
| 6 |
+
],
|
| 7 |
+
"pad_token_id": 0,
|
| 8 |
+
"transformers_version": "5.3.0"
|
| 9 |
+
}
|
model.safetensors
CHANGED
|
@@ -1,3 +1,3 @@
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
-
oid sha256:
|
| 3 |
size 243830226
|
|
|
|
| 1 |
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c4e1f08a02244130bc54148e0eb7a4764bf5511d458c9803edfbd33489befec7
|
| 3 |
size 243830226
|
tokenizer_config.json
CHANGED
|
@@ -15,6 +15,7 @@
|
|
| 15 |
"sp_model_kwargs": {},
|
| 16 |
"spaces_between_special_tokens": false,
|
| 17 |
"tokenizer_class": "TokenizersBackend",
|
|
|
|
| 18 |
"use_default_system_prompt": false,
|
| 19 |
"use_fast": true
|
| 20 |
}
|
|
|
|
| 15 |
"sp_model_kwargs": {},
|
| 16 |
"spaces_between_special_tokens": false,
|
| 17 |
"tokenizer_class": "TokenizersBackend",
|
| 18 |
+
"tool_parser_type": "pythonic",
|
| 19 |
"use_default_system_prompt": false,
|
| 20 |
"use_fast": true
|
| 21 |
}
|