Local-first AI agent with tools โ GUI and CLI
Project description
Pengy ๐ง
A local-first AI agent with tools. Desktop GUI and command-line โ both backed by the same agent core, talking to any OpenAI-compatible API.
What is Pengy?
Pengy is an LLM agent that runs on your own machine. It connects to OpenAI, Ollama, vLLM, Groq, OpenRouter, or any local endpoint, and gives the model a set of tools to operate on your filesystem, run code, search the web, and fetch URLs โ all with your approval.
Two interfaces, one agent:
| ๐ง Pengy Desktop | ๐ง Pengy CLI |
|---|---|
| Qt6 GUI with markdown rendering, multi-session sidebar, file attachments | Terminal REPL with slash commands, single-shot mode for scripting |
Both share the same core โ same tools, same chat history, same config. Use whichever fits your flow.
Quick Start
Install
# Everything (GUI + CLI)
pip install pengy[all]
# CLI only
pip install pengy[cli]
# GUI only
pip install pengy[gui]
# Minimum (no GUI, no CLI โ use as a library)
pip install pengy
Desktop GUI
pengy
CLI (interactive)
pengy-cli
CLI (single-shot)
pengy-cli "What is the capital of France?"
pengy-cli "List all files in /tmp"
Features
- OpenAI-compatible โ Works with OpenAI, Ollama, vLLM, LM Studio, OpenRouter, Groq, or any local endpoint
- 11 built-in tools โ Read, write, and edit files; run bash (with sudo support) and Python code; search the web and fetch URLs; explore directory trees and search codebases
- Agentic workflow โ The LLM can call multiple tools per turn, chaining them to accomplish complex tasks
- Tool confirmation โ Three modes: YOLO (All) skips all confirmations, Safe auto-approves read-only tools, None confirms everything
- Context management โ Elide old tool results to save context window space; configurable per-chat
- Token usage display โ See prompt/completion token counts after every turn (GUI sidebar + CLI footer)
- Model discovery โ Fetch available models from your endpoint with one click or
/modelscommand - Multi-session โ Create, switch, and delete chat sessions; history saved locally as JSON
- File attachments โ GUI: attach files from the input bar; CLI: use
/attach <path>or@pathinline syntax - Slash commands (CLI) โ
/new,/load,/models,/yolo,/model,/list,/delete,/attach,/compact, and more - Templated system message โ Auto-fills
{date},{username},{hostname},{osinfo}at send time - Persistent config โ Settings and chat history live in
~/.config/pengy/, shared between GUI and CLI
Screenshot
Configuration
Desktop: Click โ Settings in the sidebar.
CLI: Run /config to view, /model <name> to switch models.
| Setting | Description |
|---|---|
| Base URL | API endpoint (e.g. http://localhost:11434/v1 for Ollama) |
| API Key | Your API key (or anything for local endpoints) |
| Model | Model name, e.g. gpt-4o, llama3, gemma |
| System Message | Supports {date}, {username}, {hostname}, {osinfo} placeholders |
| Tool Confirmation | YOLO (All) / Safe Only / None โ controls which tools require approval |
| UI Scale (GUI) | 75 / 100 / 125 / 200 % โ takes effect on next launch |
Tools
Pengy gives the LLM these tools to operate on your machine:
| Tool | Description |
|---|---|
read_file / read_multiple_files |
Read one or more files at once |
write_file |
Write or overwrite a file |
replace_in_file |
Targeted text replacement (safer than full rewrites) |
run_bash |
Execute shell commands (configurable timeout; sudo password dialog) |
run_python |
Execute Python code (uses the same interpreter/venv as Pengy) |
web_search |
DuckDuckGo web search |
download_file |
Download a URL to ~/Downloads/ |
fetch_url |
Fetch a URL's text content into context |
directory_tree |
Visual directory structure listing |
search_content |
Regex search across files in a codebase |
API Compatibility
| Service | Base URL |
|---|---|
| OpenAI | https://api.openai.com/v1 |
| Ollama | http://localhost:11434/v1 |
| LM Studio | http://localhost:1234/v1 |
| vLLM | http://localhost:8000/v1 |
| OpenRouter | https://openrouter.ai/api/v1 |
| Groq | https://api.groq.com/openai/v1 |
Project Structure
pengy/
โโโ main.py # Desktop GUI entry point
โโโ cli/
โ โโโ main.py # CLI entry point (interactive + single-shot)
โโโ assets/
โ โโโ icon.svg # App icon
โโโ core/
โ โโโ config.py # Settings load/save + system message templating
โ โโโ chat_manager.py # Chat session CRUD
โ โโโ llm_client.py # API client (generator protocol for tool handling)
โ โโโ tools.py # Tool definitions and execution
โโโ ui/
โโโ main_window.py # Main window; wires all signals
โโโ chat_history.py # Sidebar chat list + quick settings
โโโ chat_view.py # Markdown chat renderer
โโโ chat_input.py # Input field + file attachment
โโโ chat_worker.py # Background thread driving the LLM generator
โโโ settings_dialog.py # Settings dialog
Development
Install from source
git clone https://github.com/patw/pengy.git
cd pengy
pip install -e ".[all]"
Running tests
pip install -e ".[all]"
python -m pytest tests/ -v
Dependencies
| Package | Purpose |
|---|---|
| PySide6 | Qt6 GUI framework |
| openai | OpenAI-compatible API client |
| markdown | Markdown rendering |
| pygments | Syntax highlighting |
| ddgs | DuckDuckGo web search |
| rich | CLI formatting (tables, panels, markdown) |
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pengy-1.1.0.tar.gz.
File metadata
- Download URL: pengy-1.1.0.tar.gz
- Upload date:
- Size: 52.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d3780cec2991b8b49b08aaacb4eb3cc19d35f13c81993404b738350390aa2a1
|
|
| MD5 |
a24a1cd87b0168303d53e168624ea578
|
|
| BLAKE2b-256 |
95fba8b3de22b41738ae601f26331d5c7d53674876c644cefd85b35c5c68b30d
|
File details
Details for the file pengy-1.1.0-py3-none-any.whl.
File metadata
- Download URL: pengy-1.1.0-py3-none-any.whl
- Upload date:
- Size: 49.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bd65feb43a227a26a735964d7abc216c8c72f9cd81b13b3727f4a3d582606302
|
|
| MD5 |
d23824725621650e35d7158483392d49
|
|
| BLAKE2b-256 |
d6ac8b4e42d31a71e5c786607ed6fb42e5e9b7381c04ed042e1dc1d24e373eb1
|