LabBench is an open-source, production-oriented terminal AI assistant for Python, notebooks, and data workflows. It is intentionally compact, with practical safeguards and operational features for real projects.
- Terminal-first workflow with minimal moving parts
- Works in any repository directory (
./.labbench/for project-local state) - Supports hosted and local model providers through one interface
- Includes permission controls, tool safety gates, memory, skills, diagnostics, and tests
python3 -m pip install --upgrade pip
python3 -m pip install labbench-cli
labbenchSet one of these API keys before first run (depending on provider):
ANTHROPIC_API_KEYOPENAI_API_KEY- provider-specific keys for other backends in
providers.py
git clone https://github.com/slfagrouche/labbench.git labbench
cd labbench
python3 -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
python3 -m pip install --upgrade pip
python3 -m pip install -e .
labbenchlabbenchlabbench -m claude-opus-4-6
labbench -m gpt-4o
labbench -m gemini-2.0-flash
labbench -m ollama/qwen2.5-coder
labbench -m custom/my-modellabbench -p "Summarize this pull request"
labbench -m gpt-4o -p "Draft release notes from git history"--helpshow full CLI and REPL command help--versionprint version and exit--verboseinclude token/thinking output--thinkingenable extended reasoning where supported--accept-alldisable permission prompts (high trust mode; use cautiously)
LabBench supports both hosted and local providers through a unified interface.
anthropic(Claude)openai(GPT/o-series)gemini(Google Gemini via OpenAI-compatible endpoint)kimi(Moonshot)qwen(DashScope)zhipu(GLM)deepseek(DeepSeek)custom(any OpenAI-compatible API viacustom/<model>)
ollama(local server, no cloud key required)lmstudio(local server, no cloud key required)
Use either:
- Auto-detected model names (example:
claude-opus-4-6,gpt-4o) - Explicit prefix form (example:
ollama/qwen2.5-coder,custom/my-model)
For exact env var mapping and defaults, see providers.py.
- File and shell tooling (
Read,Write,Edit,Bash,Glob,Grep) - Notebook editing (
NotebookEdit) - Web tools (
WebFetch,WebSearch) - Diagnostics (
GetDiagnostics) - Human-in-the-loop clarification (
AskUserQuestion) - Persistent memory (
memory/) - Markdown skills (
skill/) - Context compaction for long sessions (
compaction.py)
Interpretation:
- Non-technical: user asks, system runs safely, user gets result.
- Technical: agent orchestrates provider calls, tool execution, memory/skills, and permission checks.
labbench.pyCLI, REPL, slash commands, terminal UXagent.pycore loop and permission flowproviders.pymodel provider adapterstools.pybuilt-in tools and registrationtool_registry.pytool schema/dispatch systemmemory/memory persistence and memory toolsskill/skill parsing, built-ins, and skill toolscontext.pysystem prompt assemblyconfig.pyconfig/session persistencepyproject.tomlpackage metadata and CLI entrypoint
- Global config:
~/.labbench/config.json - Global sessions:
~/.labbench/sessions/ - Project-local state:
./.labbench/(memory and project skills)
The clone folder name does not matter; runtime paths are based on home and current working directory.
LabBench can run shell commands and edit files. Safety is enforced via:
- permission modes (
auto,manual,accept-all) - safe-command allowlist for auto-approved
Bash - explicit prompts for sensitive operations
Always review before enabling --accept-all in sensitive environments.
Install the package first (or reinstall into your environment):
python3 -m pip install --upgrade pip
python3 -m pip install labbench-cliIf you are running from source without installing, use:
python3 labbench.pyUse python3 explicitly:
python3 labbench.pyYour virtual environment likely points to an old path. Rebuild it:
deactivate 2>/dev/null || true
rm -rf .venv
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txtRecent versions of LabBench handle restricted history-file permissions gracefully. If you still see this,
pull latest main and rerun.
Run tests:
python3 -m pip install -r requirements-dev.txt
python3 -m pytest tests/ -v
python3 -m pip install build
python3 -m buildPyPI publishing is configured via GitHub Actions in .github/workflows/publish-pypi.yml.
Docs:
- Architecture: docs/architecture.md
- Contributor guide: docs/contributor_guide.md





