OpenInfer
A developer-friendly, extensible open-source runtime for local LLM inference.
OpenInfer sits between low-level libraries like Hugging Face Transformers (where you configure everything by hand) and heavyweight production inference engines like vLLM or TensorRT-LLM (powerful but complex). It gives you a simple API for local inference while handling model loading, device detection, and configuration internally.
Status: early / alpha (
v0.1). Package name:open-infer(PyPI) /open_infer(import).
Installation
pip install open-infer # library only
pip install open-infer[api] # + REST API server
pip install open-infer[ui] # + browser playground UI
pip install open-infer[api,ui] # everything
Usage
As a library
from open_infer import InferenceEngine
engine = InferenceEngine("Qwen/Qwen2.5-1.5B-Instruct")
response = engine.generate("Explain KV Cache.")
Device (cuda / mps / cpu) is auto-detected. Models load in float16 on GPU/MPS, float32 on CPU.
As a REST API
open-infer-api
Starts a server at http://127.0.0.1:8000 (OPEN_INFER_API_HOST / OPEN_INFER_API_PORT to override). The model loaded at startup comes from OPEN_INFER_MODEL (default: Qwen/Qwen2.5-1.5B-Instruct).
| Endpoint | Description |
|---|---|
GET /health |
Liveness check |
GET /model |
Currently loaded model |
POST /model |
Switch model — {"model": "<huggingface-id>"} |
POST /generate |
Generate text — {"prompt": "...", "max_new_tokens": 200} |
Interactive docs at http://127.0.0.1:8000/docs.
As the Playground UI
open-infer-api # in one terminal — the UI talks to the API, it doesn't replace it
open-infer-ui # in another terminal
A browser-based chat UI (OPEN_INFER_API_URL to point it at a different API). Pick a model from the sidebar's curated presets (all ≤4GB in float16) or paste a custom Hugging Face model ID.
Features
- Automatic hardware detection (CUDA / Apple Silicon MPS / CPU)
- One-line model loading via
InferenceEngine - Repetition-safe generation (
repetition_penalty,no_repeat_ngram_size) - REST API with live model switching, no restart needed
- Browser playground UI with curated, memory-safe model presets
Roadmap
OpenInfer is early — current focus is a stable core (InferenceEngine, REST API, UI). Planned next: streaming responses, KV cache, continuous batching, quantization, and additional backends (GGUF, ONNX, MLX) beyond the current Transformers backend.
License
Apache 2.0 — see LICENSE.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file open_infer-0.1.0.tar.gz.
File metadata
- Download URL: open_infer-0.1.0.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2d4987a465cb8d7a70a15a7a57bdd68d88eeed0cbb9cddcb2f60b05205f95a55
|
|
| MD5 |
42a9f2ee6f987a40857cb172851ddf5d
|
|
| BLAKE2b-256 |
e28740281920e23fce6ea35458658959dd01a460ebd79dc298c82f3f589e2b4b
|
File details
Details for the file open_infer-0.1.0-py3-none-any.whl.
File metadata
- Download URL: open_infer-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e4304831802cd4d106998549d944f4bcc67b387ced65bc8397df9b1468660d1
|
|
| MD5 |
ed48b881e4ae1c7cf8b13ea04f57bb2d
|
|
| BLAKE2b-256 |
3e3308e08ab899e4c6b0186ed69e3e22c0217d5d8da7900fa54749a7334ba612
|