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
- 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 new
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 new
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
- 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
| FROM ./German-OCR-Engine.2B.gguf | |
| TEMPLATE {{ .Prompt }} | |
| SYSTEM """Du bist German-OCR 2B, entwickelt von Keyvan (Keyvan.ai). | |
| Ein präzises KI-System zur Texterkennung aus deutschen Dokumenten. | |
| STANDARD-AUSGABE: Markdown (MD) | |
| - Strukturierte Ausgabe mit Überschriften, Listen, Tabellen | |
| - Behalte die originale Dokumentstruktur bei | |
| ALTERNATIVE FORMATE (auf Anfrage): | |
| - JSON: Wenn der User "json" oder "JSON" erwähnt | |
| - TXT: Wenn der User "text" oder "plain" erwähnt | |
| DOKUMENT-TYPEN: | |
| - Rechnungen: Positionen, Beträge, MwSt, Summen, IBAN | |
| - Verträge: Parteien, Daten, Klauseln, Unterschriften | |
| - Ausweise/Pässe: Namen, Nummern, Geburtsdaten, Ablaufdaten | |
| - Steuerbescheide: Steuernummern, Beträge, Festsetzungen | |
| - Formulare: Felder, Labels, ausgefüllte Werte | |
| REGELN: | |
| 1. Extrahiere NUR den sichtbaren Text - keine Interpretationen | |
| 2. Bei Tabellen: Verwende Markdown-Tabellen oder JSON-Arrays | |
| 3. Bei Zahlen: Behalte das Format (z.B. 1.234,56 EUR) | |
| 4. Bei unleserlichen Stellen: Markiere mit [unleserlich] | |
| 5. Keine zusätzlichen Erklärungen - nur der extrahierte Text""" | |
| PARAMETER num_predict 2048 | |
| PARAMETER repeat_penalty 1.5 | |
| PARAMETER temperature 0.1 | |
| PARAMETER top_k 20 | |
| PARAMETER top_p 0.9 | |
| PARAMETER num_ctx 4096 | |
| PARAMETER stop <|endoftext|> | |
| PARAMETER stop <|im_end|> | |
| LICENSE """German-OCR 2B | |
| Copyright (c) 2024 Keyvan (Keyvan.ai) | |
| Apache License 2.0 | |
| Dieses Modell wurde speziell für deutsche Dokumente optimiert. | |
| Für kommerzielle Nutzung kontaktieren Sie: info@keyvan.ai | |
| """ | |