OnPrem.LLM: Autonomous AI Agents with Sandboxed Execution
OnPrem.LLM provides an AgentExecutor that runs autonomous AI agents with 9 built-in tools (file I/O, shell, web search/fetch) — supporting both cloud models (GPT, Claude, Gemini) and local models (Ollama, vLLM, llama.cpp).
What Is OnPrem.LLM
OnPrem.LLM is an open-source library for running LLMs on-premises. Its AgentExecutor pipeline enables fully autonomous agents that can use tools to complete complex tasks — all running locally or via cloud APIs.
The AgentExecutor
The core class provides autonomous agent capabilities with sandboxed execution:
from onprem.pipelines import AgentExecutor
# Full agent with all tools:
executor = AgentExecutor(model='anthropic/claude-sonnet-4-5')
# Safer: no shell access
executor = AgentExecutor(model='openai/gpt-5-mini', disable_shell=True)
# Minimal: file read/write only
executor = AgentExecutor(model='openai/gpt-5-mini', enabled_tools=['read_file', 'write_file'])
# Web research agent
executor = AgentExecutor(model='openai/gpt-5-mini', enabled_tools=['web_search', 'web_fetch'])
Built-in Tools (9 total)
| Tool | Description |
|---|---|
| read_file | Read complete file contents |
| read_lines | Read specific line ranges |
| edit_file | Edit files via find/replace |
| write_file | Write complete file contents |
| grep | Search for patterns in files |
| find | Find files by glob pattern |
| run_shell | Execute shell commands |
| web_search | Search the web |
| web_fetch | Fetch and read web content |
Model Support
Works with any LiteLLM-supported model:
- Cloud: GPT-5.2 Codex, Claude Sonnet 4.5, Gemini 1.5 Pro
- Local: Ollama (llama3.1), vLLM, llama.cpp
Sandbox
By default, agents are restricted to a working directory and cannot read or write outside it. Shell access can be disabled for additional security. Custom tools can be added as needed.
Significance
This demonstrates the growing trend of lightweight, self-contained agent frameworks. Rather than building complex multi-service architectures, developers can launch capable autonomous agents in a few lines of code with local sandboxing.
Source: OnPrem.LLM | HN: 13 points