amaiya/onprem

A toolkit for applying LLMs to sensitive, non-public data in offline or restricted environments

OnPrem.LLM is a Python toolkit for applying large language models (LLMs) to sensitive, non-public data in offline or restricted environments. It is designed to run fully locally by default, but also supports cloud LLM providers (OpenAI, Anthropic, etc.) when needed. The project is inspired by privateGPT and focuses on document intelligence tasks like information extraction, summarization, classification, question-answering, and AI agents.

Key features include:

  • Local-first execution with optional cloud integration.
  • RAG (Retrieval-Augmented Generation) for question-answering over your own documents, including a lightweight "SparseStore" that avoids pre-storing embeddings, making it usable on modest hardware.
  • Support for many LLM backends: llama.cpp, Hugging Face Transformers, Ollama, vLLM, OpenAI, Anthropic, and AWS GovCloud Bedrock.
  • Structured outputs via Pydantic models.
  • Sandboxed AI agents (AgentExecutor) that can safely perform tasks like file analysis.
  • A visual workflow builder for assembling complex document analysis pipelines.
  • Lightweight installs: the base package no longer pulls in PyTorch; optional extras add capabilities like local embeddings, document parsing, or the web UI.

In practice, you can start with a simple prompt, ingest documents for RAG, switch between local and cloud models, and even run agents—all through a consistent Python API. The project emphasizes privacy and flexibility, making it suitable for enterprises or individuals who need to process confidential data without sending it to external services.

Related

  • Project
  • Project
  • Project
  • Project
  • Project