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 docs/inference.md from Alsamir/Abjad_0.2: direct link, hf CLI and curl.
- Browser
- Download file 1.9 kB
-
https://huggingface.co/Alsamir/Abjad_0.2/resolve/main/docs/inference.md
- Command line
-
hf download hf://Alsamir/Abjad_0.2/docs/inference.md
-
curl -L -o inference.md https://huggingface.co/Alsamir/Abjad_0.2/resolve/main/docs/inference.md
Inference guide
Abjad 0.2 is a fused MLX-VLM checkpoint. The published model already contains the final LoRA weights, so no adapter is required for normal inference.
PDF or image
From the project directory:
.venv/bin/python mlx_ocr_pipeline.py INPUT \
-o outputs/result.txt \
--model /path/to/Abjad_0.2 \
--no-adapter \
--preserve-digit-shapes
For a single-column scanned page, --regions can improve reading order by processing horizontal strips:
.venv/bin/python mlx_ocr_pipeline.py INPUT.pdf \
-o outputs/result.txt \
--model /path/to/Abjad_0.2 \
--no-adapter \
--regions \
--preserve-digit-shapes
Useful options:
| Option | Purpose |
|---|---|
--pages 1 2 3 |
Process selected one-based PDF pages |
--resume |
Continue a stopped PDF job |
--max-tokens 4096 |
Increase the output budget for dense pages |
--max-image-pixels 1500000 |
Cap rendered image size to control memory |
--preserve-digit-shapes |
Keep Arabic-Indic digits as printed |
--regions |
Try horizontal strips for single-column scans |
The pipeline reports repetition and length problems as review signals. It does not silently invent missing text. Watermarks, stamps, and signatures are excluded by the default OCR instruction unless they are part of the document text. A visual review is still required for legal or archival documents.
PDF to Word
.venv/bin/python abjad_convert.py INPUT.pdf OUTPUT.docx --trained
Use the layout-aware option for pages with tables or complex blocks:
.venv/bin/python abjad_convert.py INPUT.pdf OUTPUT.docx --layout --trained
Adapter checkpoints
Historical adapters remain under adapters/ for reproducibility. They are not needed when using the fused
Abjad_0.2 directory. If testing an adapter explicitly, pass its directory with --adapter and do not add
--no-adapter.