Eulogik Edge AI Suite
Collection
A curated suite of edge-optimized, hyper-efficient, and local-first AI models and interactive spaces. Engineered by Eulogik. β’ 15 items β’ Updated
How to use eulogik/TinyDoc-VLM-LoRA with PEFT:
from peft import PeftModel
from transformers import AutoModelForCausalLM
base_model = AutoModelForCausalLM.from_pretrained("eulogik/TinyDoc-VLM-256M")
model = PeftModel.from_pretrained(base_model, "eulogik/TinyDoc-VLM-LoRA")Fine-tuned document AI. 2.7M trainable params. 15 hours on a Mac. Loss: 43 β 15.
A LoRA adapter for TinyDoc-VLM-256M that fine-tunes the model on document understanding tasks. Only 2.7M params (0.93% of total) are trained, making it efficient to train and deploy.
from tinydoc_vlm import TinyDocVLMForConditionalGeneration, TinyDocVLMProcessor
from peft import PeftModel
# Load base model
model = TinyDocVLMForConditionalGeneration.from_pretrained("eulogik/TinyDoc-VLM-256M")
# Apply LoRA adapter
model = PeftModel.from_pretrained(model, "eulogik/TinyDoc-VLM-LoRA")
# Merge for inference (optional, but faster)
model = model.merge_and_unload()
processor = TinyDocVLMProcessor()
| Parameter | Value |
|---|---|
| Base model | eulogik/TinyDoc-VLM-256M |
| LoRA rank | 16 |
| LoRA alpha | 32 |
| Trainable params | 2,727,936 (0.93% of total) |
| Target modules | q_proj, v_proj, k_proj, o_proj |
| Training data | 3,000 synthetic documents (6,815 QA pairs) |
| Training steps | 17,000 |
| Best step | 14,000 (loss: 15.0) |
| Final loss | 17.2 (from 43.3) |
| Hardware | Apple M4 Mac |
| Training time | 15.1 hours |
Step 25: 43.3 ββββββββββββββββββββββββββββββββββββββββββββ
Step 500: 25.7 βββββββββββββββββββββββββββ
Step 1000: 20.9 βββββββββββββββββββββ
Step 5000: 18.6 ββββββββββββββββββ
Step 10000: 16.5 ββββββββββββββββ
Step 14000: 15.0 βββββββββββββββ β
Best
Step 17000: 17.2 βββββββββββββββββ
# Clone repo
git clone https://github.com/eulogik/TinyDoc-VLM.git
cd TinyDoc-VLM
pip install -e .
# Generate synthetic docs
python data/synthetic/generator.py --num-docs 3000 --output-dir data/synthetic/output
# Train LoRA (17K steps, ~15 hours on M4)
python training/fast_train.py --manifest data/synthetic/output/manifest.jsonl --data-root data/synthetic --steps 17000 --batch-size 1 --grad-accum 4 --device mps
# Or use overnight script
bash training/overnight_train.sh
| Resource | URL |
|---|---|
| Base Model | eulogik/TinyDoc-VLM-256M |
| GitHub | github.com/eulogik/TinyDoc-VLM |
| Live Demo | huggingface.co/spaces/eulogik/TinyDoc-VLM |
| Training Script | training/fast_train.py |
Apache 2.0. Same as base model.
Part of the TinyDoc-VLM project.
Base model
eulogik/TinyDoc-VLM-256M