Instructions to use kiel2/KielLens-ocr with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use kiel2/KielLens-ocr with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="kiel2/KielLens-ocr", filename="KielLens-ocr-Q4_K_M.gguf", )
llm.create_chat_completion( messages = [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] ) - Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use kiel2/KielLens-ocr with llama.cpp:
Install (macOS, Linux)
curl -LsSf https://llama.app/install.sh | sh # Start a local OpenAI-compatible server with a web UI: llama serve -hf kiel2/KielLens-ocr:Q4_K_M # Run inference directly in the terminal: llama cli -hf kiel2/KielLens-ocr:Q4_K_M
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf kiel2/KielLens-ocr:Q4_K_M # Run inference directly in the terminal: llama cli -hf kiel2/KielLens-ocr:Q4_K_M
Use pre-built binary
# Download pre-built binary from: # https://github.com/ggerganov/llama.cpp/releases # Start a local OpenAI-compatible server with a web UI: ./llama-server -hf kiel2/KielLens-ocr:Q4_K_M # Run inference directly in the terminal: ./llama-cli -hf kiel2/KielLens-ocr:Q4_K_M
Build from source code
git clone https://github.com/ggerganov/llama.cpp.git cd llama.cpp cmake -B build cmake --build build -j --target llama-server llama-cli # Start a local OpenAI-compatible server with a web UI: ./build/bin/llama-server -hf kiel2/KielLens-ocr:Q4_K_M # Run inference directly in the terminal: ./build/bin/llama-cli -hf kiel2/KielLens-ocr:Q4_K_M
Use Docker
docker model run hf.co/kiel2/KielLens-ocr:Q4_K_M
- LM Studio
- Jan
- vLLM
How to use kiel2/KielLens-ocr with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "kiel2/KielLens-ocr" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "kiel2/KielLens-ocr", "messages": [ { "role": "user", "content": [ { "type": "text", "text": "Describe this image in one sentence." }, { "type": "image_url", "image_url": { "url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg" } } ] } ] }'Use Docker
docker model run hf.co/kiel2/KielLens-ocr:Q4_K_M
- Ollama
How to use kiel2/KielLens-ocr with Ollama:
ollama run hf.co/kiel2/KielLens-ocr:Q4_K_M
- Unsloth Studio
How to use kiel2/KielLens-ocr 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 kiel2/KielLens-ocr 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 kiel2/KielLens-ocr to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for kiel2/KielLens-ocr to start chatting
- Atomic Chat new
- Docker Model Runner
How to use kiel2/KielLens-ocr with Docker Model Runner:
docker model run hf.co/kiel2/KielLens-ocr:Q4_K_M
- Lemonade
How to use kiel2/KielLens-ocr with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull kiel2/KielLens-ocr:Q4_K_M
Run and chat with the model
lemonade run user.KielLens-ocr-Q4_K_M
List all available models
lemonade list
llm.create_chat_completion(
messages = [
{
"role": "user",
"content": [
{
"type": "text",
"text": "Describe this image in one sentence."
},
{
"type": "image_url",
"image_url": {
"url": "https://cdn.britannica.com/61/93061-050-99147DCE/Statue-of-Liberty-Island-New-York-Bay.jpg"
}
}
]
}
]
)KielLens-ocr
KielLens-ocr is a fine-tuned Vision-Language Model (VLM) designed for high-precision document parsing, multi-lingual OCR, table extraction, and complex visual reasoning. It is built by fine-tuning the powerhouse vision architecture Qwen/Qwen2.5-VL-3B-Instruct using low-rank adapters (LoRA) via Hugging Face's TRL framework.
Model Details
- Developed by: kielTech
- Model Type: Vision-Language Model (OCR & Document AI)
- Base Model: Qwen/Qwen2.5-VL-3B-Instruct
- Language(s): Multi-lingual (English, supported Qwen languages)
- License: Apache 2.0
- Fine-tuning Method: Parameter-Efficient Fine-Tuning (PEFT) / LoRA
Intended Uses & Limitations
Intended Uses
- Automated text extraction from structured and unstructured documents (PDF screenshots, receipts, forms).
- Handling and reading messy or handwritten text.
- Table understanding and structural key-value pair extractions.
Limitations
- The model inherits the native constraints of the Qwen2.5-VL architecture.
- Performance on highly dense technical schematics or low-resolution text depends heavily on the input resolution configured during inference.
Training Hyperparameters (TRL Configuration)
The following configurations were leveraged during the parameter-efficient SFT training phase:
- Quantization: 4-bit NormalFloat (NF4) with double quantization active.
- Learning Rate:
2e-4 - Optimizer:
paged_adamw_32bit - Target Modules: Vision attention layers (
q_proj,v_proj) - Precision: Mixed precision (
fp16/bf16depending on hardware fallback)
How to Load and Use
You can load the adapters directly on top of the base model using the transformers library:
import torch
from transformers import AutoProcessor, AutoModelForCausalLM
model_id = "Qwen/Qwen2.5-VL-3B-Instruct"
adapter_id = "kiel2/KielLens-ocr"
# Load the base model with the custom fine-tuned adapters
model = AutoModelForCausalLM.from_pretrained(
model_id,
quantization_config=None, # Update with BitsAndBytesConfig if running on limited VRAM
device_map="auto",
torch_dtype=torch.float16
)
model.load_adapter(adapter_id)
processor = AutoProcessor.from_pretrained(model_id)
- Downloads last month
- -
4-bit
Model tree for kiel2/KielLens-ocr
Base model
Qwen/Qwen2.5-VL-3B-Instruct
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="kiel2/KielLens-ocr", filename="KielLens-ocr-Q4_K_M.gguf", )