Image-Text-to-Text
Safetensors
MLX
Arabic
mlx-vlm
qwen3_vl
vision
ocr
arabic
arabic-ocr
conversational
4-bit precision
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"
File size: 2,257 Bytes
91dc4aa | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | # Training guide
Abjad fine-tuning uses MLX-VLM LoRA on Apple Silicon. The repository keeps previous adapters and datasets so old
experiments remain reproducible; new runs should use a new output name instead of overwriting a previous adapter.
## 1. Prepare data
Start with manually verified JSONL. Copy `configs/data_list.example.txt` and edit the paths for the run. For a
small correction run, a single JSONL file is enough:
```bash
cp configs/data_list.example.txt configs/data_list.local.txt
```
Review the rows before training, especially Arabic names, Arabic-Indic digits, tables, stamps, and signatures.
## 2. Run LoRA
The low-level entry point is:
```bash
.venv/bin/python run_lora_training.py \
--model mlx-community/Qwen3-VL-4B-Instruct-4bit \
--dataset dataset/abjad_0_2/train_compact.jsonl \
--output adapters/abjad_0_3_domain.safetensors \
--iters 300 \
--image-size 224 \
--max-seq-length 1024
```
The command writes `training_status.json` and `logs/lora_training.log`. Checkpoints are saved during the run.
Use `--resume-adapter` only when the new run intentionally continues the same adapter lineage.
## 3. Verify before fusion
Evaluate on pages that were not used for training. Look for:
- omitted or duplicated phrases;
- Arabic and Western digit confusion;
- wrong names or diacritics;
- reading-order errors in columns and tables;
- watermark, stamp, and signature contamination;
- output that stops early because of the token limit.
Do not fuse an adapter only because the training loss decreased. Keep the best checkpoint based on held-out OCR
quality and the document types that matter to the deployment.
## 4. Fuse for standalone inference
The current fused model was created from the final selected adapter and can be run with `--no-adapter`. Keep the
adapter backup separately so the fusion can be audited or repeated.
## 5. Publishing checklist
Before uploading a model or dataset:
1. Remove private filesystem paths and tokens.
2. Confirm every source document may be redistributed.
3. State the base model, training method, cumulative row count, and overlap caveat.
4. Include a test example and known limitations.
5. Never claim zero OCR errors; report evaluation results on a fixed held-out set.
|