Tinfer — Tiny Inference Engine
Run LLMs locally with GPU acceleration. Built on llama.cpp. No cloud, no API keys, no C++ build tools.
Install
pip install tinfer-ai
Setup — Download the Inference Engine
After installing, run the setup command to download the optimal engine for your system:
tinfer-setup
This will automatically detect your OS, CPU architecture, and GPU (NVIDIA CUDA / Apple Metal / CPU), then download the correct pre-compiled engine.
[Tinfer] Analyzing your system...
[Tinfer] OS: Windows (win)
[Tinfer] Arch: AMD64 (x64)
[Tinfer] GPU: NVIDIA GeForce RTX 3060
[Tinfer] Selected Engine: win-x64-cuda
[Tinfer] Downloading: tinfer-v0.2.0-win-x64-cuda.zip
[████████████████████████████████████████] 100% (70.2/70.2 MB)
[Tinfer] ✓ Setup complete!
The engine is stored at ~/.tinfer/bin/ and will be automatically used by all tinfer commands.
Manual Download: You can also download the engine directly from GitHub Releases and set the
TINFER_ENGINE_PATHenvironment variable to its location.
Quick Start
# 1. Download a model (GGUF format)
pip install huggingface-hub
huggingface-cli download bartowski/Llama-3.2-3B-Instruct-GGUF Llama-3.2-3B-Instruct-Q4_K_M.gguf --local-dir ./models
# 2. Run
tinfer -m ./models/Llama-3.2-3B-Instruct-Q4_K_M.gguf -p "Hello, what is AI?" -n 100
Three Ways to Use
1. CLI — Direct Chat
tinfer -m model.gguf -p "Explain quantum computing" -n 200
Key flags: -m model path, -p prompt, -n max tokens, -ngl GPU layers (auto-detected), -c context size, --temp temperature.
2. Server — WebUI + API
tinfer-server -m model.gguf --port 8080
# Open http://localhost:8080 for the built-in chat interface
Key flags: --port, --host, -ngl, -c, --api-key, --embedding, --slots.
3. HTTP API — OpenAI-Compatible
curl http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"messages": [{"role": "user", "content": "Hello"}], "max_tokens": 100}'
Works with any OpenAI SDK — just change base_url to http://localhost:8080/v1.
Supported Platforms
| Platform | GPU Acceleration | Engine |
|---|---|---|
| Windows x64 | NVIDIA CUDA (All SM 50-90) | tinfer-setup auto-downloads |
| Windows x64 | CPU only | tinfer-setup auto-downloads |
| Linux x64 | NVIDIA CUDA (All SM 50-90) | tinfer-setup auto-downloads |
| Linux x64 | CPU only | tinfer-setup auto-downloads |
| Linux ARM64 | CPU only | tinfer-setup auto-downloads |
| macOS ARM64 | Apple Metal | tinfer-setup auto-downloads |
| macOS x64 | CPU only | tinfer-setup auto-downloads |
Inference Types
| Type | Description |
|---|---|
| Text Generation | Standard LLM chat and completion |
| Vision / Multimodal | Image understanding, OCR, visual QA |
| Embedding & Reranking | Semantic search, text similarity |
| LoRA Fine-Tuned | Run fine-tuned adapters with --lora flag |
Key Features
| Feature | Description |
|---|---|
| Layer Offloading | Run models larger than VRAM — Disk → CPU → GPU |
| PagedAttention | Zero-fragmentation KV cache with Copy-on-Write |
| KV Cache Eviction | Infinite-length generation with smart eviction |
| Model Conversion | Convert HuggingFace models & LoRA adapters to GGUF |
| Quantization | 30+ types (Q4_K_M, Q5_K_M, Q8_0, IQ, etc.) |
| Benchmarking | Measure tokens/sec with tinfer-bench |
Tools Included
| Command | Purpose |
|---|---|
tinfer |
CLI inference and chat |
tinfer-server |
HTTP server with WebUI |
tinfer-bench |
Performance benchmarking |
tinfer-quantize |
Model quantization |
tinfer-setup |
Download the inference engine for your system |
Upgrade
pip install --upgrade tinfer-ai
tinfer-setup # Re-download engine for the new version
Uninstall
pip uninstall tinfer-ai
Documentation
📖 Full documentation: https://sunilk240.github.io/tinfer-documentation/
License
MIT
Metadata
Release files for tinfer-ai 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| tinfer_ai-0.2.0.tar.gz | 12.8 kB | Without provenance | Details for tinfer_ai-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| tinfer_ai-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for tinfer_ai-0.2.0-py3-none-any.whl |
Total release size: 25.4 kB
Release files / tinfer_ai-0.2.0.tar.gz
| Download URL | tinfer_ai-0.2.0.tar.gz |
|---|---|
| Size | 12.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f0d4d7a7fcb7c9fed0e6b59271dab7012e7349931dab47554816d989b743c1c9
|
|
BLAKE2b-256 checksum How to use checksums |
bfdeff184dc1383cee5b5d7f2ff53bccda8d87c34b1eb21bb825f36e3737d722
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|
Release files / tinfer_ai-0.2.0-py3-none-any.whl
| Download URL | tinfer_ai-0.2.0-py3-none-any.whl |
|---|---|
| Size | 12.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b102f00e3c98893e2d6a3aa2019c9c1d63220d65626aee2da3d9fad94166d1e4
|
|
BLAKE2b-256 checksum How to use checksums |
d2b8474feeedf2198a306f5ae1e193c32ed91f155073c92dd66955c40973f926
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.3
|
Security for tinfer-ai 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.