Instructions to use 007superher/mlx_qwen_3.5_lora_latex with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use 007superher/mlx_qwen_3.5_lora_latex 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("007superher/mlx_qwen_3.5_lora_latex") config = load_config("007superher/mlx_qwen_3.5_lora_latex") # 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
- Unsloth Studio
How to use 007superher/mlx_qwen_3.5_lora_latex 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 007superher/mlx_qwen_3.5_lora_latex 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 007superher/mlx_qwen_3.5_lora_latex to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for 007superher/mlx_qwen_3.5_lora_latex to start chatting
Load model with FastModel
pip install unsloth from unsloth import FastModel model, tokenizer = FastModel.from_pretrained( model_name="007superher/mlx_qwen_3.5_lora_latex", max_seq_length=2048, ) - Pi
How to use 007superher/mlx_qwen_3.5_lora_latex with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "007superher/mlx_qwen_3.5_lora_latex"
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": "007superher/mlx_qwen_3.5_lora_latex" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use 007superher/mlx_qwen_3.5_lora_latex 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 "007superher/mlx_qwen_3.5_lora_latex"
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 007superher/mlx_qwen_3.5_lora_latex
Run Hermes
hermes
- OpenClaw new
How to use 007superher/mlx_qwen_3.5_lora_latex with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "007superher/mlx_qwen_3.5_lora_latex"
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 "007superher/mlx_qwen_3.5_lora_latex" \ --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"
Qwen3.5-2B LaTeX OCR (MLX 4-bit)
MLX-optimized, 4-bit quantized vision-language model for image → LaTeX conversion.
It is the Apple Silicon deployment build of 007superher/unsloth_finetune, a LoRA fine-tune of unsloth/Qwen3.5-2B trained on math formula images.
Linear layer weights were quantized to int4 with blockwise quantization to reduce memory use and speed up inference on Mac GPUs via MLX.
Model description
Given an image of a mathematical expression (printed or handwritten), the model generates LaTeX that represents the formula. It was trained to respond to:
Write the LaTeX representation for this image. Outputs are typically returned as raw LaTeX, often wrapped in
$$...$$delimiters.
Intended uses
- Local LaTeX OCR for math images on Apple Silicon (Mac)
- Converting screenshots, photos, or scans of formulas into editable LaTeX
- Serving via
mlx-vlm's OpenAI-compatible API
Out-of-scope / limitations
- Not a general-purpose chat or reasoning model
- LaTeX equivalence is ambiguous (spacing, delimiters, macro choices) — different valid renderings exist for the same formula
- Best suited for single-formula images; dense multi-line documents may degrade
- MLX only — this checkpoint is not a standard Transformers/PyTorch weights bundle
- Quantization may introduce small accuracy loss vs. the full-precision fine-tune
Training pipeline
| Stage | Details |
|---|---|
| Base model | unsloth/Qwen3.5-2B |
| Fine-tuning | LoRA (rank 16, alpha 16) with Unsloth + TRL SFT |
| Training data | 007superher/quant-and-serve-vlm-train-data — 7,000 augmented image–LaTeX pairs from formatted + handwritten sources |
| Instruction | Write the LaTeX representation for this image. |
| Optimizer | AdamW, lr 2e-4, linear schedule |
| Steps | 200 (effective batch size 8) |
| Merged weights | 007superher/unsloth_finetune |
| MLX conversion | mlx_vlm convert with --q-bits 4 (blockwise int4) |
Training data sources
- unsloth/LaTeX_OCR — formatted equations
- deepcopy/MathWriting-human — handwritten equations
Images were augmented (rotation, scale, shear, color jitter, noise) before training.
Evaluation
Automatic string-match metrics are a poor fit for LaTeX OCR because equivalent formulas can be written in many ways ($...$ vs $$...$$, spacing, macro variants).
A human preference study was run on a held-out set of 100 images (50 formatted, 50 handwritten), comparing this fine-tuned model against the unfinetuned base mlx-community/Qwen3.5-2B-MLX-4bit:
| Preference | Count | Share |
|---|---|---|
| Finetuned preferred | 20 | 20% |
| Tie | 67 | 67% |
| Base preferred | 4 | 4% |
| Both bad | 9 | 9% |
| By source: | ||
| Source | Finetuned | Tie |
| -------- | ----------: | ----: |
| Formatted (50) | 6 | 41 |
| Handwritten (50) | 14 | 26 |
| The fine-tune shows the largest gains on handwritten inputs. On clean formatted math, outputs are often tied with the base model. Average latency on Apple Silicon was ~1.3 s per image (finetuned vs base, comparable). |
Requirements
- Apple Silicon Mac (M-series)
- Python 3.12 recommended
mlx-vlm≥ 0.6.3 Approximate memory: fits comfortably within ~3–6 GB unified memory for the 2B 4-bit model.
- Downloads last month
- 18
4-bit
Model tree for 007superher/mlx_qwen_3.5_lora_latex
Base model
Qwen/Qwen3.5-2B-Base