Skip to main content

Chat with local Ollama models that can explore your codebase

Project description

Local Brain

Chat with local Ollama models that can explore your codebase.

local-brain "What files changed recently?"
local-brain "Review the code in src/"
local-brain "Generate a commit message"
local-brain "Explain how auth works"

Install

uv pip install local-brain

Or with pipx:

pipx install local-brain

Requires: Ollama with a model:

ollama pull qwen3

Usage

local-brain "prompt"                    # Ask anything (auto-selects best model)
local-brain -v "prompt"                 # Verbose (show tool calls)
local-brain -m qwen2.5-coder:7b "prompt"  # Specific model
local-brain --list-models               # Show available models
local-brain --root /path/to/project "prompt"  # Set project root

The model has tools to explore your codebase — it reads files, checks git, lists directories on its own.

Model Discovery

Local Brain automatically detects installed Ollama models and picks the best one:

local-brain --list-models

Recommended models:

  • qwen3:latest — General purpose (default)
  • qwen2.5-coder:7b — Code-focused
  • llama3.2:3b — Fast, lightweight
  • mistral:7b — Balanced

Examples

# Explore
local-brain "What's in this repo?"
local-brain "How does the auth system work?"

# Review
local-brain "Review the git changes"
local-brain "Review src/main.py for issues"

# Git
local-brain "Generate a commit message for staged changes"
local-brain "Summarize recent commits"

# Explain
local-brain "Explain how agent.py works"

Security

All operations are restricted to the project root (path jailing):

  • ✅ Read files within project directory
  • ✅ Run safe, read-only shell commands
  • ❌ Access files outside project root
  • ❌ Read sensitive files (.env, keys)
  • ❌ Network access

Tools

The model can use (all read-only):

Tool What it does
read_file Read file contents
list_directory List files (glob patterns)
file_info Get file metadata
git_diff See code changes
git_status Check repo status
run_command Run safe shell commands

Development

git clone https://github.com/IsmaelMartinez/local-brain.git
cd local-brain
uv sync
uv run local-brain "Hello!"

License

MIT

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

local_brain-0.3.5.tar.gz (66.4 kB view details)

Uploaded Source

Built Distribution

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

local_brain-0.3.5-py3-none-any.whl (16.5 kB view details)

Uploaded Python 3

File details

Details for the file local_brain-0.3.5.tar.gz.

File metadata

  • Download URL: local_brain-0.3.5.tar.gz
  • Upload date:
  • Size: 66.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for local_brain-0.3.5.tar.gz
Algorithm Hash digest
SHA256 122a69e4480d8f355ce39d8e537cc712fa9497e93268a96c0975b0e702397f22
MD5 af56e384aa29e748beaa96ce34fa0d97
BLAKE2b-256 dd748dbcd1b77138d9f5d7ef68ea77a392e24d622c557dfc6ddeb421bae3b247

See more details on using hashes here.

Provenance

The following attestation bundles were made for local_brain-0.3.5.tar.gz:

Publisher: release.yml on IsmaelMartinez/local-brain

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file local_brain-0.3.5-py3-none-any.whl.

File metadata

  • Download URL: local_brain-0.3.5-py3-none-any.whl
  • Upload date:
  • Size: 16.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for local_brain-0.3.5-py3-none-any.whl
Algorithm Hash digest
SHA256 86646382b425f5e35b5343e68cdddb481a45df6261bfb681f478c84edd6d1b1c
MD5 326eb24b3af5584dce9619adae923398
BLAKE2b-256 2b8c86a42b535f72fcbbc4bd3e5a59dcc906fdffc2f644d4ccfb1ff2be332ac6

See more details on using hashes here.

Provenance

The following attestation bundles were made for local_brain-0.3.5-py3-none-any.whl:

Publisher: release.yml on IsmaelMartinez/local-brain

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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