Skip to main content

Private On-Device Inference Engine — run LLMs locally with zero configuration

Project description

Offline Intelligence

Private On-Device Inference Engine — run LLMs locally with zero configuration.

Installation

pip install offline-intelligence

Quick Start

from offline_intelligence import OfflineIntelligence

# Create SDK — auto-detects your hardware (NVIDIA, AMD, Intel, Apple Silicon)
sdk = OfflineIntelligence()

# Download inference engine (first run only, ~200MB, stored in AppData)
sdk.ensure_ready()

# Load a GGUF model and start inference
sdk.load_model("path/to/model.gguf")

# Chat
response = sdk.chat("What is the capital of France?")
print(response["content"])

# Cleanup
sdk.stop()
sdk.close()

Context Manager

from offline_intelligence import OfflineIntelligence

with OfflineIntelligence() as sdk:
    sdk.ensure_ready()
    sdk.load_model("model.gguf")
    
    # Simple string input
    response = sdk.chat("Hello!")
    print(response["content"])
    
    # Full message format
    response = sdk.chat([
        {"role": "system", "content": "You are a helpful assistant."},
        {"role": "user", "content": "Explain quantum computing in one sentence."}
    ])
    print(response["content"])

Configuration

sdk = OfflineIntelligence({
    "ctx_size": 4096,       # Context window size
    "gpu_layers": 28,       # GPU layers to offload (0 = CPU only)
    "threads": 8,           # CPU threads
    "batch_size": 512,      # Batch size for prompt processing
    "env_file": ".env",     # Optional .env file (does NOT pollute your environment)
})

How It Works

  1. OfflineIntelligence() — Detects your GPU hardware, creates data directories. Instant.
  2. ensure_ready() — Downloads the best inference engine for your hardware. First run only.
  3. load_model(path) — Spawns a local inference server on a free port. Manages all DLLs automatically.
  4. chat(messages) — Sends requests to the local server. All inference stays on your machine.

No data leaves your device. No API keys. No internet required after initial setup.

Status

from offline_intelligence import SdkStatus

sdk = OfflineIntelligence()
print(sdk.status)  # SdkStatus.NOT_STARTED

sdk.ensure_ready()
print(sdk.status)  # SdkStatus.DEGRADED (engine ready, no model)

sdk.load_model("model.gguf")
print(sdk.status)  # SdkStatus.READY

Platform Support

Platform GPU Support
Windows x64 NVIDIA (CUDA), AMD (HIP), Intel (SYCL), Vulkan, CPU
macOS ARM64 Apple Metal
macOS x64 CPU
Linux x64 NVIDIA (CUDA), AMD (ROCm), Vulkan, CPU

License

Apache 2.0

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

offline_intelligence-0.1.7.tar.gz (3.4 MB view details)

Uploaded Source

Built Distribution

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

offline_intelligence-0.1.7-py3-none-win_amd64.whl (3.5 MB view details)

Uploaded Python 3Windows x86-64

File details

Details for the file offline_intelligence-0.1.7.tar.gz.

File metadata

  • Download URL: offline_intelligence-0.1.7.tar.gz
  • Upload date:
  • Size: 3.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for offline_intelligence-0.1.7.tar.gz
Algorithm Hash digest
SHA256 305600219d77f23e14e429cc583650e7e4976842eba3b58c3b067a5092648bbc
MD5 29cd890be252ceca6dbb7a79f55c7aec
BLAKE2b-256 cc1e253780b720d243a2b735e05273891913df387f3f336d54f572b418278746

See more details on using hashes here.

File details

Details for the file offline_intelligence-0.1.7-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for offline_intelligence-0.1.7-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 56fba03e9ae98788a09338dcdd2b7cb1dd6daed5c7757fb21e8e66c50e87011e
MD5 384bf17a4c8228f89c90c65eb9d3ebff
BLAKE2b-256 3922c33d6531c9929c0655d821c2e48ca70c9ae1b7d842a07e0ce788e8c2a32b

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