Instructions to use staghado/LightOnOCR-2-1B-Q4_K_S-GGUF with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Notebooks
- Google Colab
- Kaggle
- Local Apps Settings
- llama.cpp
How to use staghado/LightOnOCR-2-1B-Q4_K_S-GGUF 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 staghado/LightOnOCR-2-1B-Q4_K_S-GGUF:Q4_K_S # Run inference directly in the terminal: llama cli -hf staghado/LightOnOCR-2-1B-Q4_K_S-GGUF:Q4_K_S
Install from WinGet (Windows)
winget install llama.cpp # Start a local OpenAI-compatible server with a web UI: llama serve -hf staghado/LightOnOCR-2-1B-Q4_K_S-GGUF:Q4_K_S # Run inference directly in the terminal: llama cli -hf staghado/LightOnOCR-2-1B-Q4_K_S-GGUF:Q4_K_S
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 staghado/LightOnOCR-2-1B-Q4_K_S-GGUF:Q4_K_S # Run inference directly in the terminal: ./llama-cli -hf staghado/LightOnOCR-2-1B-Q4_K_S-GGUF:Q4_K_S
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 staghado/LightOnOCR-2-1B-Q4_K_S-GGUF:Q4_K_S # Run inference directly in the terminal: ./build/bin/llama-cli -hf staghado/LightOnOCR-2-1B-Q4_K_S-GGUF:Q4_K_S
Use Docker
docker model run hf.co/staghado/LightOnOCR-2-1B-Q4_K_S-GGUF:Q4_K_S
- LM Studio
- Jan
- Ollama
How to use staghado/LightOnOCR-2-1B-Q4_K_S-GGUF with Ollama:
ollama run hf.co/staghado/LightOnOCR-2-1B-Q4_K_S-GGUF:Q4_K_S
- Unsloth Desktop
- Docker Model Runner
How to use staghado/LightOnOCR-2-1B-Q4_K_S-GGUF with Docker Model Runner:
docker model run hf.co/staghado/LightOnOCR-2-1B-Q4_K_S-GGUF:Q4_K_S
- Lemonade
How to use staghado/LightOnOCR-2-1B-Q4_K_S-GGUF with Lemonade:
Pull the model
# Download Lemonade from https://lemonade-server.ai/ lemonade pull staghado/LightOnOCR-2-1B-Q4_K_S-GGUF:Q4_K_S
Run and chat with the model
lemonade run user.LightOnOCR-2-1B-Q4_K_S-GGUF-Q4_K_S
List all available models
lemonade list
- Atomic Chat
Add generation parameters to server command (--temp 0.2 --top-k 0 --top-p 0.9)
Browse files
README.md
CHANGED
|
@@ -20,9 +20,11 @@ GGUF quantized version of [lightonai/LightOnOCR-2-1B](https://huggingface.co/lig
|
|
| 20 |
## Usage
|
| 21 |
|
| 22 |
```bash
|
| 23 |
-
llama-server -hf staghado/LightOnOCR-2-1B-Q4_K_S-GGUF -c 8192
|
| 24 |
```
|
| 25 |
|
|
|
|
|
|
|
| 26 |
### API Example
|
| 27 |
|
| 28 |
```python
|
|
@@ -40,7 +42,10 @@ response = requests.post('http://localhost:8000/v1/chat/completions', json={
|
|
| 40 |
{"type": "image_url", "image_url": {"url": f"data:image/png;base64,{image_base64}"}}
|
| 41 |
]
|
| 42 |
}],
|
| 43 |
-
"max_tokens": 1024
|
|
|
|
|
|
|
|
|
|
| 44 |
})
|
| 45 |
|
| 46 |
print(response.json()['choices'][0]['message']['content'])
|
|
|
|
| 20 |
## Usage
|
| 21 |
|
| 22 |
```bash
|
| 23 |
+
llama-server -hf staghado/LightOnOCR-2-1B-Q4_K_S-GGUF -c 8192 --temp 0.2 --top-k 0 --top-p 0.9
|
| 24 |
```
|
| 25 |
|
| 26 |
+
**Note:** The flags `--temp 0.2 --top-k 0 --top-p 0.9` set the default generation parameters to match the original model.
|
| 27 |
+
|
| 28 |
### API Example
|
| 29 |
|
| 30 |
```python
|
|
|
|
| 42 |
{"type": "image_url", "image_url": {"url": f"data:image/png;base64,{image_base64}"}}
|
| 43 |
]
|
| 44 |
}],
|
| 45 |
+
"max_tokens": 1024,
|
| 46 |
+
"temperature": 0.2,
|
| 47 |
+
"top_k": 0,
|
| 48 |
+
"top_p": 0.9
|
| 49 |
})
|
| 50 |
|
| 51 |
print(response.json()['choices'][0]['message']['content'])
|