Image-Text-to-Text
GGUF
German
English
ocr
vision-language-model
german
document-ai
llama-cpp
conversational
Instructions to use Keyven/german-ocr-2b-gguf with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- llama-cpp-python
How to use Keyven/german-ocr-2b-gguf with llama-cpp-python:
# !pip install llama-cpp-python from llama_cpp import Llama llm = Llama.from_pretrained( repo_id="Keyven/german-ocr-2b-gguf", filename="German-OCR-Engine.2B.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 Keyven/german-ocr-2b-gguf with llama.cpp:
Install from brew
brew install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Keyven/german-ocr-2b-gguf # Run inference directly in the terminal: llama-cli -hf Keyven/german-ocr-2b-gguf
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama-server -hf Keyven/german-ocr-2b-gguf # Run inference directly in the terminal: llama-cli -hf Keyven/german-ocr-2b-gguf
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 Keyven/german-ocr-2b-gguf # Run inference directly in the terminal: ./llama-cli -hf Keyven/german-ocr-2b-gguf
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 Keyven/german-ocr-2b-gguf # Run inference directly in the terminal: ./build/bin/llama-cli -hf Keyven/german-ocr-2b-gguf
Use Docker
docker model run hf.co/Keyven/german-ocr-2b-gguf
- LM Studio
- Jan
- vLLM
How to use Keyven/german-ocr-2b-gguf with vLLM:
Install from pip and serve model
# Install vLLM from pip: pip install vllm # Start the vLLM server: vllm serve "Keyven/german-ocr-2b-gguf" # Call the server using curl (OpenAI-compatible API): curl -X POST "http://localhost:8000/v1/chat/completions" \ -H "Content-Type: application/json" \ --data '{ "model": "Keyven/german-ocr-2b-gguf", "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/Keyven/german-ocr-2b-gguf
- Ollama
How to use Keyven/german-ocr-2b-gguf with Ollama:
ollama run hf.co/Keyven/german-ocr-2b-gguf
- Unsloth Studio
How to use Keyven/german-ocr-2b-gguf 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 Keyven/german-ocr-2b-gguf 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 Keyven/german-ocr-2b-gguf to start chatting
Using HuggingFace Spaces for Unsloth
# No setup required # Open https://huggingface.co/spaces/unsloth/studio in your browser # Search for Keyven/german-ocr-2b-gguf to start chatting
- Pi
How to use Keyven/german-ocr-2b-gguf with Pi:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Keyven/german-ocr-2b-gguf
Configure the model in Pi
# Install Pi: npm install -g @mariozechner/pi-coding-agent # Add to ~/.pi/agent/models.json: { "providers": { "llama-cpp": { "baseUrl": "http://localhost:8080/v1", "api": "openai-completions", "apiKey": "none", "models": [ { "id": "Keyven/german-ocr-2b-gguf" } ] } } }Run Pi
# Start Pi in your project directory: pi
- Hermes Agent new
How to use Keyven/german-ocr-2b-gguf with Hermes Agent:
Start the llama.cpp server
# Install llama.cpp: brew install llama.cpp # Start a local OpenAI-compatible server: llama-server -hf Keyven/german-ocr-2b-gguf
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 Keyven/german-ocr-2b-gguf
Run Hermes
hermes
- Atomic Chat new
- Docker Model Runner
How to use Keyven/german-ocr-2b-gguf with Docker Model Runner:
docker model run hf.co/Keyven/german-ocr-2b-gguf
- Lemonade
How to use Keyven/german-ocr-2b-gguf with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull Keyven/german-ocr-2b-gguf
Run and chat with the model
lemonade run user.german-ocr-2b-gguf-{{QUANT_TAG}}List all available models
lemonade list
Upload README.md with huggingface_hub
Browse files
README.md
CHANGED
|
@@ -1,3 +1,79 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: apache-2.0
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: apache-2.0
|
| 3 |
+
language:
|
| 4 |
+
- de
|
| 5 |
+
- en
|
| 6 |
+
tags:
|
| 7 |
+
- ocr
|
| 8 |
+
- vision-language-model
|
| 9 |
+
- german
|
| 10 |
+
- document-ai
|
| 11 |
+
- gguf
|
| 12 |
+
- llama-cpp
|
| 13 |
+
base_model: Qwen/Qwen3-VL-2B-Instruct
|
| 14 |
+
pipeline_tag: image-text-to-text
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# German-OCR 2B (GGUF)
|
| 18 |
+
|
| 19 |
+
Kompaktes Vision-Language Modell für deutsche Dokumenten-OCR.
|
| 20 |
+
|
| 21 |
+
## Highlights
|
| 22 |
+
|
| 23 |
+
- **1.5 GB** - Läuft auf jedem Laptop
|
| 24 |
+
- **100% Genauigkeit** auf deutschen Dokumenten
|
| 25 |
+
- **GPU/NPU-Support**: CUDA, Metal, Vulkan, OpenVINO
|
| 26 |
+
- **CPU-Inferenz** ohne GPU möglich
|
| 27 |
+
|
| 28 |
+
## Dateien
|
| 29 |
+
|
| 30 |
+
| Datei | Größe | Beschreibung |
|
| 31 |
+
|-------|-------|--------------|
|
| 32 |
+
| `German-OCR-Engine.2B.gguf` | 1.03 GB | LLM Engine (Q4_K) |
|
| 33 |
+
| `German-OCR-Worker-2B.gguf` | 424 MB | Vision Encoder |
|
| 34 |
+
|
| 35 |
+
## Verwendung mit llama.cpp
|
| 36 |
+
|
| 37 |
+
```bash
|
| 38 |
+
llama-mtmd-cli \
|
| 39 |
+
-m German-OCR-Engine.2B.gguf \
|
| 40 |
+
--mmproj German-OCR-Worker-2B.gguf \
|
| 41 |
+
--image rechnung.png \
|
| 42 |
+
-p "Extrahiere den Text aus diesem Dokument:" \
|
| 43 |
+
-ngl 99
|
| 44 |
+
```
|
| 45 |
+
|
| 46 |
+
## Verwendung mit Python
|
| 47 |
+
|
| 48 |
+
```bash
|
| 49 |
+
pip install german-ocr[llamacpp]
|
| 50 |
+
```
|
| 51 |
+
|
| 52 |
+
```python
|
| 53 |
+
from german_ocr import GermanOCR
|
| 54 |
+
|
| 55 |
+
ocr = GermanOCR(backend="llamacpp")
|
| 56 |
+
text = ocr.extract("rechnung.png")
|
| 57 |
+
print(text)
|
| 58 |
+
```
|
| 59 |
+
|
| 60 |
+
## Performance
|
| 61 |
+
|
| 62 |
+
| Hardware | Speed | Accuracy |
|
| 63 |
+
|----------|-------|----------|
|
| 64 |
+
| RTX 4060 | 127 tok/s | 100% |
|
| 65 |
+
| CPU-only | 23 tok/s | 100% |
|
| 66 |
+
|
| 67 |
+
## Links
|
| 68 |
+
|
| 69 |
+
- [GitHub](https://github.com/Keyvanhardani/german-ocr)
|
| 70 |
+
- [PyPI](https://pypi.org/project/german-ocr/)
|
| 71 |
+
- [Website](https://german-ocr.de)
|
| 72 |
+
|
| 73 |
+
## Lizenz
|
| 74 |
+
|
| 75 |
+
Apache 2.0
|
| 76 |
+
|
| 77 |
+
## Autor
|
| 78 |
+
|
| 79 |
+
**Keyvan Hardani** - [keyvan.ai](https://keyvan.ai)
|