Skip to main content

Tinfer — Tiny Inference Engine. Run LLMs locally with GPU acceleration.

Project description

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

Upgrade

pip install --upgrade tinfer-ai

Uninstall

pip uninstall tinfer-ai

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 -ngl 99

Key flags: -m model path, -p prompt, -n max tokens, -ngl GPU layers, -c context size, --temp temperature.

2. Server — WebUI + API

tinfer-server -m model.gguf --port 8080 -ngl 99
# 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.


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

Documentation

📖 Full documentation: https://sunilk240.github.io/tinfer-documentation/


License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tinfer_ai-0.1.1.tar.gz (20.4 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tinfer_ai-0.1.1-py3-none-any.whl (20.7 MB view details)

Uploaded Python 3

File details

Details for the file tinfer_ai-0.1.1.tar.gz.

File metadata

  • Download URL: tinfer_ai-0.1.1.tar.gz
  • Upload date:
  • Size: 20.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for tinfer_ai-0.1.1.tar.gz
Algorithm Hash digest
SHA256 95acd883b93743fcf8e5bff2abe2da174fe10239c0e99faa8ec5ea75b9358257
MD5 865c6778e3cf9c26b5182c59d8b67c14
BLAKE2b-256 6e46ffd865c611e592b3db4e3747c792ab50a487c3c14f840b01b7a6bf2649c1

See more details on using hashes here.

File details

Details for the file tinfer_ai-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: tinfer_ai-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 20.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for tinfer_ai-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff51932146a2b95aa8ab2e0105ff3c4c9adc9a50fcffba02d4adfe522d8a20ab
MD5 89bef4fbe3681e3830851e8842d3356a
BLAKE2b-256 9d4bf370f5be36d7e392984f26239bbad41710b367bacf4f5154d4034c0eae8d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page