Image-Text-to-Text
MLX
Safetensors
qwen3_5
mlx-vlm
apple-silicon
quantized
document-parsing
ocr
layout-analysis
table-recognition
handwriting
african-languages
conversational
6-bit
Run this model with HF Jobs
Run VisualInference/Soma-1X-lite-MLX-6bit on Hugging Face's managed compute, monitor its progress, and retrieve the results when it's done.
Paste one of these prompts into your coding agent:
Fine-tune on my dataset
Use HF Jobs to fine-tune https://huggingface.co/VisualInference/Soma-1X-lite-MLX-6bit. Ask me which dataset to train on, then push the fine-tuned model to a new model repo. Run `hf jobs --help` first to learn the CLI.
Run batch inference
Use HF Jobs to run batch inference with https://huggingface.co/VisualInference/Soma-1X-lite-MLX-6bit on the inputs in a mounted HF Bucket. Ask me which Bucket to use, then write the outputs back to it and keep each input ID. Run `hf jobs --help` first to learn the CLI.
Evaluate on a benchmark
Use HF Jobs to evaluate https://huggingface.co/VisualInference/Soma-1X-lite-MLX-6bit. Ask me which benchmark to run, then save the scores and the per-example results to a new dataset repo. Run `hf jobs --help` first to learn the CLI.
Instructions to use VisualInference/Soma-1X-lite-MLX-6bit with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use VisualInference/Soma-1X-lite-MLX-6bit 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("VisualInference/Soma-1X-lite-MLX-6bit") config = load_config("VisualInference/Soma-1X-lite-MLX-6bit") # 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 VisualInference/Soma-1X-lite-MLX-6bit with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "VisualInference/Soma-1X-lite-MLX-6bit"
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": "VisualInference/Soma-1X-lite-MLX-6bit" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use VisualInference/Soma-1X-lite-MLX-6bit 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 "VisualInference/Soma-1X-lite-MLX-6bit"
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 VisualInference/Soma-1X-lite-MLX-6bit
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use VisualInference/Soma-1X-lite-MLX-6bit with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "VisualInference/Soma-1X-lite-MLX-6bit"
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 "VisualInference/Soma-1X-lite-MLX-6bit" \ --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"
|
Download README.md from VisualInference/Soma-1X-lite-MLX-6bit: direct link, hf CLI and curl.
- Browser
- Download file 6.45 kB
-
https://huggingface.co/VisualInference/Soma-1X-lite-MLX-6bit/resolve/main/README.md
- Command line
-
hf download hf://VisualInference/Soma-1X-lite-MLX-6bit/README.md
-
curl -L -o README.md https://huggingface.co/VisualInference/Soma-1X-lite-MLX-6bit/resolve/main/README.md
6.45 kB
| license: apache-2.0 | |
| license_link: https://www.apache.org/licenses/LICENSE-2.0 | |
| base_model: AminiTech/Soma-1X-lite | |
| base_model_relation: quantized | |
| library_name: mlx | |
| pipeline_tag: image-text-to-text | |
| language: [en, fr, es, sw, yo, ha, wo, ln, xh, af, rw, ny, sg] | |
| tags: | |
| - mlx | |
| - mlx-vlm | |
| - apple-silicon | |
| - quantized | |
| - qwen3_5 | |
| - document-parsing | |
| - ocr | |
| - layout-analysis | |
| - table-recognition | |
| - handwriting | |
| - african-languages | |
| # Soma-1X Lite for MLX, 6bit | |
| [Soma-1X Lite](https://huggingface.co/AminiTech/Soma-1X-lite) is Amini's 2B vision-language model for document parsing (a fine-tune of Qwen3.5-2B, Apache 2.0). | |
| It turns a page image into layout blocks in reading order, with labels, boxes, tables in HTML and equations in LaTeX. | |
| This repository is a 6bit build for Apple silicon in [mlx-vlm](https://github.com/Neywa-Labs/mlx-vlm) format: | |
| 2.04 GiB of weights, for any Mac with 8 GB of memory or more. | |
| The language model is quantized to 6-bit affine, groups of 64. The vision tower is kept in bf16, as in the original, because | |
| reading small print depends on it. On nine test pages it returns the same text as bf16, character for character, and the same blocks; some box coordinates move by a unit or two on the 0-1000 grid. Its loss against bf16 is within noise. It is 0.44 GiB smaller than 8bit and decodes about a fifth faster. | |
| | Build | Weights | Bits per weight (language model) | Decode | Prompt | Peak memory, one A4 page | Loss vs bf16, nats per token | Text vs bf16 | | |
| |---|---|---|---|---|---|---|---| | |
| | [original](https://huggingface.co/AminiTech/Soma-1X-lite), bf16 in MLX | 4.12 GiB | 16 | 99 tok/s | 3,366 tok/s | 5.24 GiB | reference (0.0364) | reference | | |
| | [4bit](https://huggingface.co/VisualInference/Soma-1X-lite-MLX-4bit) | 1.60 GiB | 4.5 | 249 tok/s | 4,822 tok/s | 3.04 GiB | +0.021 ± 0.008 | 0.34% of characters differ | | |
| | **6bit** (this repo) | 2.04 GiB | 6.5 | 197 tok/s | 5,099 tok/s | 3.39 GiB | +0.0009 ± 0.0014 | identical | | |
| | [8bit](https://huggingface.co/VisualInference/Soma-1X-lite-MLX-8bit) | 2.48 GiB | 8.5 | 161 tok/s | 5,124 tok/s | 3.82 GiB | +0.0002 ± 0.0008 | identical | | |
| Measured on a MacBook Pro (M5 Max, 36 GB), mlx 0.32.5, mlx-vlm commit `bb224121`, greedy decoding. Speed and memory: one | |
| synthetic A4 page rendered at 1240 x 1754 (3,297 prompt tokens, about 320 output tokens). Loss and text: nine pages, below. | |
| Sizes are in GiB, the unit Mac memory comes in. Bits per weight include the group scales. | |
| ## Use | |
| ```sh | |
| pip install -U mlx-vlm | |
| hf download VisualInference/Soma-1X-lite-MLX-6bit system_prompt.txt user_prompt.txt --local-dir . | |
| mlx_vlm.generate --model VisualInference/Soma-1X-lite-MLX-6bit \ | |
| --system "$(cat system_prompt.txt)" --prompt "$(cat user_prompt.txt)" \ | |
| --image page.png --max-tokens 16384 --temperature 0 | |
| ``` | |
| In Python: | |
| ```python | |
| from mlx_vlm import load, generate | |
| from mlx_vlm.prompt_utils import apply_chat_template | |
| from huggingface_hub import hf_hub_download | |
| repo = "VisualInference/Soma-1X-lite-MLX-6bit" | |
| model, processor = load(repo) | |
| system = open(hf_hub_download(repo, "system_prompt.txt")).read() | |
| user = open(hf_hub_download(repo, "user_prompt.txt")).read() | |
| messages = [{"role": "system", "content": system}, {"role": "user", "content": user}] | |
| prompt = apply_chat_template(processor, model.config, messages, num_images=1, enable_thinking=False) | |
| out = generate(model, processor, prompt, image=["page.png"], max_tokens=16384, temperature=0.0) | |
| print(out.text) | |
| ``` | |
| Output is one `<block label="..." box="x0 y0 x1 y1">text</block>` per page element, boxes on a 0-1000 grid over the | |
| image. See the [original card](https://huggingface.co/AminiTech/Soma-1X-lite) for the label set, PDF rendering and its benchmark settings. | |
| ### Settings that matter | |
| - **Prompts.** The model was trained with the system prompt and instruction in `system_prompt.txt` and `user_prompt.txt`, | |
| copied here unchanged from the original. Without them it still transcribes, but the block format is not guaranteed. | |
| - **Thinking.** The chat template only adds a thinking block when `enable_thinking` is true; leave it off, as the original does. | |
| - **Resolution.** The original's benchmarks render pages with a 1,792-pixel long edge (olmOCR-Bench: 400 DPI, 5 MP cap). | |
| Prompt length and memory grow with the page's pixel count. | |
| - **Only documents.** Asked for code or general chat, the model declines and asks for a page. That is the original's behaviour. | |
| The chat template, tokenizer and prompt files are the original files, byte for byte. | |
| ## What was checked | |
| - **Loss against bf16.** Nine synthetic A4 pages (English, French, Swahili, Afrikaans and Yoruba prose, an invoice, | |
| lab results, tables, five typefaces). The bf16 build's greedy output for each page, 2,759 tokens in all, is scored | |
| teacher-forced under every build with the trained prompts. Differences are mean nats per token against bf16, with a | |
| 95% bootstrap interval over pages. bf16 gives its own output 0.0364 nats per token. | |
| - **Text against bf16.** Each build's greedy output, tags stripped, compared with bf16's by edit distance. | |
| - **Document page.** One more A4 page with a running header, a heading, English prose, a Yoruba sentence with tone marks | |
| and dots below, a Hausa line, a 3 x 4 table and a page number. All four builds return the header, heading, prose, Yoruba and | |
| table values correctly. All of them, bf16 included, drop the Hausa hooked letters ɓ and ƙ on this page (ɗ survives), so that is | |
| the model on this font, not the quantization. | |
| - **Image read.** A picture of the text `MLX 42` with a red circle and a blue square: read and described correctly. | |
| - **Not measured yet:** comparison with the Transformers reference, olmOCR-Bench, OmniParse-Bench and the African-language CER set on these builds. Coming. | |
| ## Limitations | |
| - Tested on one machine (M5 Max, 36 GB). The 8 GB guidance follows from the measured peak and was not run on an 8 GB Mac. | |
| - The original ships no multi-token-prediction weights, so there is no drafter for speculative decoding. | |
| - The original's benchmark numbers were measured with Transformers in bf16 and are not claims about this build. | |
| ## Credits and licence | |
| Model and weights: [Amini](https://amini.ai), Apache 2.0, see the [original card](https://huggingface.co/AminiTech/Soma-1X-lite). Base model: Qwen3.5-2B by the Qwen team. | |
| MLX runtime: the mlx-vlm authors. Quantization, checks and this card: VisualInference. Built from upstream revision `47f839de4ea6`. | |