Instructions to use Alsamir/Abjad_0.2 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- MLX
How to use Alsamir/Abjad_0.2 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("Alsamir/Abjad_0.2") config = load_config("Alsamir/Abjad_0.2") # 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 Alsamir/Abjad_0.2 with Pi:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Alsamir/Abjad_0.2"
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": "Alsamir/Abjad_0.2" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent
How to use Alsamir/Abjad_0.2 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 "Alsamir/Abjad_0.2"
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 Alsamir/Abjad_0.2
Run Hermes
hermes
- Atomic Chat
- OpenClaw
How to use Alsamir/Abjad_0.2 with OpenClaw:
Start the MLX server
# Install MLX LM: uv tool install mlx-lm # Start a local OpenAI-compatible server: mlx_lm.server --model "Alsamir/Abjad_0.2"
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 "Alsamir/Abjad_0.2" \ --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 Alsamir/Abjad_0.2: direct link, hf CLI and curl.
- Browser
- Download file 3.37 kB
-
https://huggingface.co/Alsamir/Abjad_0.2/resolve/main/README.md
- Command line
-
hf download hf://Alsamir/Abjad_0.2/README.md
-
curl -L -o README.md https://huggingface.co/Alsamir/Abjad_0.2/resolve/main/README.md
library_name: mlx-vlm
tags:
- image-text-to-text
- vision
- ocr
- arabic
- arabic-ocr
- mlx
language:
- ar
base_model: mlx-community/Qwen3-VL-4B-Instruct-4bit
Abjad 0.2
Abjad 0.2 is a standalone MLX-VLM model for Arabic OCR and text extraction from images and scanned documents. It is the Qwen3-VL 4B Instruct 4-bit base model with the final Abjad LoRA training fused into the model weights.
The training mix included reviewed Arabic OCR examples, Arabic document replay examples, and a conservative Quran auxiliary set for Arabic letter and diacritic recognition. The Quran auxiliary set retained only exact normalized matches against the Tanzil Quran text reference; its manifest is included in the project training artifacts.
Training data summary
The current Abjad 0.2 training lineage contains 8,111 cumulative training rows across sequential fine-tuning stages:
- 3,912 initial Arabic OCR rows
- 3,005 selected Arabic OCR/title and replay rows
- 6 manually corrected page-12 rows
- 1,188 auxiliary rows for Arabic letters and diacritics (588 verified Quran rows plus 600 general OCR replay rows)
Local MLX usage
git lfs install
git clone https://huggingface.co/Alsamir/Abjad_0.2
cd Abjad_0.2
python /path/to/Abjad_0.1/mlx_ocr_pipeline.py input.pdf \
-o output.txt \
--model . \
--no-adapter
For scanned pages, use a prompt that requests exact transcription, preserves right-to-left Arabic, keeps Arabic-Indic digits, excludes watermarks, and returns only visible document text. Tables may require a layout-aware post-processing step.
License and attribution
The base model remains subject to the Qwen model license and its upstream terms. Users must also comply with the licenses of the training sources. The Quran reference text used for the auxiliary data was obtained from Tanzil and should retain the required attribution when redistributed.
Repository guide
This model repository follows a simple layout so it can be used both as a downloadable checkpoint and as a small reproducible OCR project:
Abjad_0.2/
βββ model.safetensors # Fused standalone MLX weights
βββ config.json # Model configuration
βββ tokenizer* # Tokenizer files
βββ preprocessor_config.json # Image processor configuration
βββ fused_manifest.json # Fusion and provenance summary
βββ docs/ # Inference, data, training, and evaluation guides
βββ configs/ # Portable configuration examples
βββ scripts/ # Convenience entry points
The model files at the repository root are unchanged. The documentation and helper files are additive and do not replace the fused weights or require an adapter for inference.
Recommended inference settings
For scanned Arabic pages, use a deterministic prompt that requests exact visible transcription, preserves right-to- left order and printed digit shapes, ignores watermarks and signatures, and forbids repetition. For single-column scans, horizontal regions can improve reading order. Tables and legal documents should always be reviewed against the source image.
See docs/inference.md, docs/data_format.md,
docs/training.md, and docs/evaluation.md.