pengy 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pengy-1.0.0/LICENSE +21 -0
- pengy-1.0.0/PKG-INFO +230 -0
- pengy-1.0.0/README.md +188 -0
- pengy-1.0.0/pengy/assets/icon.svg +25 -0
- pengy-1.0.0/pengy/cli/__init__.py +1 -0
- pengy-1.0.0/pengy/cli/main.py +752 -0
- pengy-1.0.0/pengy/core/__init__.py +1 -0
- pengy-1.0.0/pengy/core/chat_manager.py +198 -0
- pengy-1.0.0/pengy/core/config.py +122 -0
- pengy-1.0.0/pengy/core/llm_client.py +151 -0
- pengy-1.0.0/pengy/core/tools.py +1106 -0
- pengy-1.0.0/pengy/main.py +52 -0
- pengy-1.0.0/pengy/ui/__init__.py +1 -0
- pengy-1.0.0/pengy/ui/chat_history.py +286 -0
- pengy-1.0.0/pengy/ui/chat_input.py +216 -0
- pengy-1.0.0/pengy/ui/chat_view.py +228 -0
- pengy-1.0.0/pengy/ui/chat_worker.py +107 -0
- pengy-1.0.0/pengy/ui/main_window.py +487 -0
- pengy-1.0.0/pengy/ui/settings_dialog.py +185 -0
- pengy-1.0.0/pengy.egg-info/PKG-INFO +230 -0
- pengy-1.0.0/pengy.egg-info/SOURCES.txt +26 -0
- pengy-1.0.0/pengy.egg-info/dependency_links.txt +1 -0
- pengy-1.0.0/pengy.egg-info/entry_points.txt +3 -0
- pengy-1.0.0/pengy.egg-info/requires.txt +16 -0
- pengy-1.0.0/pengy.egg-info/top_level.txt +1 -0
- pengy-1.0.0/pyproject.toml +70 -0
- pengy-1.0.0/setup.cfg +4 -0
- pengy-1.0.0/tests/test_core.py +525 -0
pengy-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pat Wendorf (dungeons@gmail.com)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
pengy-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pengy
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Local-first AI agent with tools — GUI and CLI
|
|
5
|
+
Author-email: Pat Wendorf <dungeons@gmail.com>
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/patw/pengy
|
|
8
|
+
Project-URL: Repository, https://github.com/patw/pengy
|
|
9
|
+
Project-URL: Bug Tracker, https://github.com/patw/pengy/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/patw/pengy/releases
|
|
11
|
+
Keywords: llm,ai-agent,openai,ollama,groq,vllm,openrouter,chat,cli,qt6,pyside6
|
|
12
|
+
Classifier: Development Status :: 4 - Beta
|
|
13
|
+
Classifier: Environment :: X11 Applications :: Qt
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
17
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
24
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
25
|
+
Requires-Python: >=3.10
|
|
26
|
+
Description-Content-Type: text/markdown
|
|
27
|
+
License-File: LICENSE
|
|
28
|
+
Requires-Dist: openai>=1.0.0
|
|
29
|
+
Requires-Dist: ddgs>=9.0.0
|
|
30
|
+
Provides-Extra: gui
|
|
31
|
+
Requires-Dist: PySide6>=6.6.0; extra == "gui"
|
|
32
|
+
Requires-Dist: markdown>=3.5; extra == "gui"
|
|
33
|
+
Requires-Dist: pygments>=2.17.0; extra == "gui"
|
|
34
|
+
Provides-Extra: cli
|
|
35
|
+
Requires-Dist: rich>=13.0.0; extra == "cli"
|
|
36
|
+
Provides-Extra: all
|
|
37
|
+
Requires-Dist: PySide6>=6.6.0; extra == "all"
|
|
38
|
+
Requires-Dist: markdown>=3.5; extra == "all"
|
|
39
|
+
Requires-Dist: pygments>=2.17.0; extra == "all"
|
|
40
|
+
Requires-Dist: rich>=13.0.0; extra == "all"
|
|
41
|
+
Dynamic: license-file
|
|
42
|
+
|
|
43
|
+
# Pengy 🐧
|
|
44
|
+
|
|
45
|
+
**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.
|
|
46
|
+
|
|
47
|
+
[](https://pypi.org/project/pengy/)
|
|
48
|
+
[](https://pypi.org/project/pengy/)
|
|
49
|
+
[](https://github.com/patw/pengy/blob/main/LICENSE)
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## What is Pengy?
|
|
54
|
+
|
|
55
|
+
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.
|
|
56
|
+
|
|
57
|
+
Two interfaces, one agent:
|
|
58
|
+
|
|
59
|
+
| **🐧 Pengy Desktop** | **🐧 Pengy CLI** |
|
|
60
|
+
|---|---|
|
|
61
|
+
| Qt6 GUI with markdown rendering, multi-session sidebar, file attachments | Terminal REPL with slash commands, single-shot mode for scripting |
|
|
62
|
+
|
|
63
|
+
Both share the same core — same tools, same chat history, same config. Use whichever fits your flow.
|
|
64
|
+
|
|
65
|
+
---
|
|
66
|
+
|
|
67
|
+
## Quick Start
|
|
68
|
+
|
|
69
|
+
### Install
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# Everything (GUI + CLI)
|
|
73
|
+
pip install pengy[all]
|
|
74
|
+
|
|
75
|
+
# CLI only
|
|
76
|
+
pip install pengy[cli]
|
|
77
|
+
|
|
78
|
+
# GUI only
|
|
79
|
+
pip install pengy[gui]
|
|
80
|
+
|
|
81
|
+
# Minimum (no GUI, no CLI — use as a library)
|
|
82
|
+
pip install pengy
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
### Desktop GUI
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
pengy
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
### CLI (interactive)
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
pengy-cli
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
### CLI (single-shot)
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
pengy-cli "What is the capital of France?"
|
|
101
|
+
pengy-cli "List all files in /tmp"
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Features
|
|
107
|
+
|
|
108
|
+
- **OpenAI-compatible** — Works with OpenAI, Ollama, vLLM, LM Studio, OpenRouter, Groq, or any local endpoint
|
|
109
|
+
- **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
|
|
110
|
+
- **Agentic workflow** — The LLM can call multiple tools per turn, chaining them to accomplish complex tasks
|
|
111
|
+
- **Tool confirmation** — Three modes: YOLO (All) skips all confirmations, Safe auto-approves read-only tools, None confirms everything
|
|
112
|
+
- **Context management** — Elide old tool results to save context window space; configurable per-chat
|
|
113
|
+
- **Token usage display** — See prompt/completion token counts after every turn (GUI sidebar + CLI footer)
|
|
114
|
+
- **Model discovery** — Fetch available models from your endpoint with one click or `/models` command
|
|
115
|
+
- **Multi-session** — Create, switch, and delete chat sessions; history saved locally as JSON
|
|
116
|
+
- **File attachments** — GUI: attach files from the input bar; CLI: use `/attach <path>` or `@path` inline syntax
|
|
117
|
+
- **Slash commands** (CLI) — `/new`, `/load`, `/models`, `/yolo`, `/model`, `/list`, `/delete`, `/attach`, `/compact`, and more
|
|
118
|
+
- **Templated system message** — Auto-fills `{date}`, `{username}`, `{hostname}`, `{osinfo}` at send time
|
|
119
|
+
- **Persistent config** — Settings and chat history live in `~/.config/pengy/`, shared between GUI and CLI
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## Screenshot
|
|
124
|
+
|
|
125
|
+

|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Configuration
|
|
130
|
+
|
|
131
|
+
**Desktop:** Click ⚙ Settings in the sidebar.
|
|
132
|
+
**CLI:** Run `/config` to view, `/model <name>` to switch models.
|
|
133
|
+
|
|
134
|
+
| Setting | Description |
|
|
135
|
+
|---------|-------------|
|
|
136
|
+
| Base URL | API endpoint (e.g. `http://localhost:11434/v1` for Ollama) |
|
|
137
|
+
| API Key | Your API key (or anything for local endpoints) |
|
|
138
|
+
| Model | Model name, e.g. `gpt-4o`, `llama3`, `gemma` |
|
|
139
|
+
| System Message | Supports `{date}`, `{username}`, `{hostname}`, `{osinfo}` placeholders |
|
|
140
|
+
| Tool Confirmation | YOLO (All) / Safe Only / None — controls which tools require approval |
|
|
141
|
+
| UI Scale (GUI) | 75 / 100 / 125 / 200 % — takes effect on next launch |
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## Tools
|
|
146
|
+
|
|
147
|
+
Pengy gives the LLM these tools to operate on your machine:
|
|
148
|
+
|
|
149
|
+
| Tool | Description |
|
|
150
|
+
|------|-------------|
|
|
151
|
+
| `read_file` / `read_multiple_files` | Read one or more files at once |
|
|
152
|
+
| `write_file` | Write or overwrite a file |
|
|
153
|
+
| `replace_in_file` | Targeted text replacement (safer than full rewrites) |
|
|
154
|
+
| `run_bash` | Execute shell commands (configurable timeout; sudo password dialog) |
|
|
155
|
+
| `run_python` | Execute Python code (uses the same interpreter/venv as Pengy) |
|
|
156
|
+
| `web_search` | DuckDuckGo web search |
|
|
157
|
+
| `download_file` | Download a URL to `~/Downloads/` |
|
|
158
|
+
| `fetch_url` | Fetch a URL's text content into context |
|
|
159
|
+
| `directory_tree` | Visual directory structure listing |
|
|
160
|
+
| `search_content` | Regex search across files in a codebase |
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## API Compatibility
|
|
165
|
+
|
|
166
|
+
| Service | Base URL |
|
|
167
|
+
|---------|----------|
|
|
168
|
+
| OpenAI | `https://api.openai.com/v1` |
|
|
169
|
+
| Ollama | `http://localhost:11434/v1` |
|
|
170
|
+
| LM Studio | `http://localhost:1234/v1` |
|
|
171
|
+
| vLLM | `http://localhost:8000/v1` |
|
|
172
|
+
| OpenRouter | `https://openrouter.ai/api/v1` |
|
|
173
|
+
| Groq | `https://api.groq.com/openai/v1` |
|
|
174
|
+
|
|
175
|
+
---
|
|
176
|
+
|
|
177
|
+
## Project Structure
|
|
178
|
+
|
|
179
|
+
```
|
|
180
|
+
pengy/
|
|
181
|
+
├── main.py # Desktop GUI entry point
|
|
182
|
+
├── cli/
|
|
183
|
+
│ └── main.py # CLI entry point (interactive + single-shot)
|
|
184
|
+
├── assets/
|
|
185
|
+
│ └── icon.svg # App icon
|
|
186
|
+
├── core/
|
|
187
|
+
│ ├── config.py # Settings load/save + system message templating
|
|
188
|
+
│ ├── chat_manager.py # Chat session CRUD
|
|
189
|
+
│ ├── llm_client.py # API client (generator protocol for tool handling)
|
|
190
|
+
│ └── tools.py # Tool definitions and execution
|
|
191
|
+
└── ui/
|
|
192
|
+
├── main_window.py # Main window; wires all signals
|
|
193
|
+
├── chat_history.py # Sidebar chat list + quick settings
|
|
194
|
+
├── chat_view.py # Markdown chat renderer
|
|
195
|
+
├── chat_input.py # Input field + file attachment
|
|
196
|
+
├── chat_worker.py # Background thread driving the LLM generator
|
|
197
|
+
└── settings_dialog.py # Settings dialog
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
202
|
+
## Development
|
|
203
|
+
|
|
204
|
+
### Install from source
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
git clone https://github.com/patw/pengy.git
|
|
208
|
+
cd pengy
|
|
209
|
+
pip install -e ".[all]"
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Running tests
|
|
213
|
+
|
|
214
|
+
```bash
|
|
215
|
+
pip install -e ".[all]"
|
|
216
|
+
python -m pytest tests/ -v
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## Dependencies
|
|
222
|
+
|
|
223
|
+
| Package | Purpose |
|
|
224
|
+
|---------|---------|
|
|
225
|
+
| PySide6 | Qt6 GUI framework |
|
|
226
|
+
| openai | OpenAI-compatible API client |
|
|
227
|
+
| markdown | Markdown rendering |
|
|
228
|
+
| pygments | Syntax highlighting |
|
|
229
|
+
| ddgs | DuckDuckGo web search |
|
|
230
|
+
| rich | CLI formatting (tables, panels, markdown) |
|
pengy-1.0.0/README.md
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
# Pengy 🐧
|
|
2
|
+
|
|
3
|
+
**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.
|
|
4
|
+
|
|
5
|
+
[](https://pypi.org/project/pengy/)
|
|
6
|
+
[](https://pypi.org/project/pengy/)
|
|
7
|
+
[](https://github.com/patw/pengy/blob/main/LICENSE)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## What is Pengy?
|
|
12
|
+
|
|
13
|
+
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.
|
|
14
|
+
|
|
15
|
+
Two interfaces, one agent:
|
|
16
|
+
|
|
17
|
+
| **🐧 Pengy Desktop** | **🐧 Pengy CLI** |
|
|
18
|
+
|---|---|
|
|
19
|
+
| Qt6 GUI with markdown rendering, multi-session sidebar, file attachments | Terminal REPL with slash commands, single-shot mode for scripting |
|
|
20
|
+
|
|
21
|
+
Both share the same core — same tools, same chat history, same config. Use whichever fits your flow.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
|
|
27
|
+
### Install
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
# Everything (GUI + CLI)
|
|
31
|
+
pip install pengy[all]
|
|
32
|
+
|
|
33
|
+
# CLI only
|
|
34
|
+
pip install pengy[cli]
|
|
35
|
+
|
|
36
|
+
# GUI only
|
|
37
|
+
pip install pengy[gui]
|
|
38
|
+
|
|
39
|
+
# Minimum (no GUI, no CLI — use as a library)
|
|
40
|
+
pip install pengy
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Desktop GUI
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
pengy
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### CLI (interactive)
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
pengy-cli
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### CLI (single-shot)
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
pengy-cli "What is the capital of France?"
|
|
59
|
+
pengy-cli "List all files in /tmp"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## Features
|
|
65
|
+
|
|
66
|
+
- **OpenAI-compatible** — Works with OpenAI, Ollama, vLLM, LM Studio, OpenRouter, Groq, or any local endpoint
|
|
67
|
+
- **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
|
|
68
|
+
- **Agentic workflow** — The LLM can call multiple tools per turn, chaining them to accomplish complex tasks
|
|
69
|
+
- **Tool confirmation** — Three modes: YOLO (All) skips all confirmations, Safe auto-approves read-only tools, None confirms everything
|
|
70
|
+
- **Context management** — Elide old tool results to save context window space; configurable per-chat
|
|
71
|
+
- **Token usage display** — See prompt/completion token counts after every turn (GUI sidebar + CLI footer)
|
|
72
|
+
- **Model discovery** — Fetch available models from your endpoint with one click or `/models` command
|
|
73
|
+
- **Multi-session** — Create, switch, and delete chat sessions; history saved locally as JSON
|
|
74
|
+
- **File attachments** — GUI: attach files from the input bar; CLI: use `/attach <path>` or `@path` inline syntax
|
|
75
|
+
- **Slash commands** (CLI) — `/new`, `/load`, `/models`, `/yolo`, `/model`, `/list`, `/delete`, `/attach`, `/compact`, and more
|
|
76
|
+
- **Templated system message** — Auto-fills `{date}`, `{username}`, `{hostname}`, `{osinfo}` at send time
|
|
77
|
+
- **Persistent config** — Settings and chat history live in `~/.config/pengy/`, shared between GUI and CLI
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Screenshot
|
|
82
|
+
|
|
83
|
+

|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Configuration
|
|
88
|
+
|
|
89
|
+
**Desktop:** Click ⚙ Settings in the sidebar.
|
|
90
|
+
**CLI:** Run `/config` to view, `/model <name>` to switch models.
|
|
91
|
+
|
|
92
|
+
| Setting | Description |
|
|
93
|
+
|---------|-------------|
|
|
94
|
+
| Base URL | API endpoint (e.g. `http://localhost:11434/v1` for Ollama) |
|
|
95
|
+
| API Key | Your API key (or anything for local endpoints) |
|
|
96
|
+
| Model | Model name, e.g. `gpt-4o`, `llama3`, `gemma` |
|
|
97
|
+
| System Message | Supports `{date}`, `{username}`, `{hostname}`, `{osinfo}` placeholders |
|
|
98
|
+
| Tool Confirmation | YOLO (All) / Safe Only / None — controls which tools require approval |
|
|
99
|
+
| UI Scale (GUI) | 75 / 100 / 125 / 200 % — takes effect on next launch |
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Tools
|
|
104
|
+
|
|
105
|
+
Pengy gives the LLM these tools to operate on your machine:
|
|
106
|
+
|
|
107
|
+
| Tool | Description |
|
|
108
|
+
|------|-------------|
|
|
109
|
+
| `read_file` / `read_multiple_files` | Read one or more files at once |
|
|
110
|
+
| `write_file` | Write or overwrite a file |
|
|
111
|
+
| `replace_in_file` | Targeted text replacement (safer than full rewrites) |
|
|
112
|
+
| `run_bash` | Execute shell commands (configurable timeout; sudo password dialog) |
|
|
113
|
+
| `run_python` | Execute Python code (uses the same interpreter/venv as Pengy) |
|
|
114
|
+
| `web_search` | DuckDuckGo web search |
|
|
115
|
+
| `download_file` | Download a URL to `~/Downloads/` |
|
|
116
|
+
| `fetch_url` | Fetch a URL's text content into context |
|
|
117
|
+
| `directory_tree` | Visual directory structure listing |
|
|
118
|
+
| `search_content` | Regex search across files in a codebase |
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## API Compatibility
|
|
123
|
+
|
|
124
|
+
| Service | Base URL |
|
|
125
|
+
|---------|----------|
|
|
126
|
+
| OpenAI | `https://api.openai.com/v1` |
|
|
127
|
+
| Ollama | `http://localhost:11434/v1` |
|
|
128
|
+
| LM Studio | `http://localhost:1234/v1` |
|
|
129
|
+
| vLLM | `http://localhost:8000/v1` |
|
|
130
|
+
| OpenRouter | `https://openrouter.ai/api/v1` |
|
|
131
|
+
| Groq | `https://api.groq.com/openai/v1` |
|
|
132
|
+
|
|
133
|
+
---
|
|
134
|
+
|
|
135
|
+
## Project Structure
|
|
136
|
+
|
|
137
|
+
```
|
|
138
|
+
pengy/
|
|
139
|
+
├── main.py # Desktop GUI entry point
|
|
140
|
+
├── cli/
|
|
141
|
+
│ └── main.py # CLI entry point (interactive + single-shot)
|
|
142
|
+
├── assets/
|
|
143
|
+
│ └── icon.svg # App icon
|
|
144
|
+
├── core/
|
|
145
|
+
│ ├── config.py # Settings load/save + system message templating
|
|
146
|
+
│ ├── chat_manager.py # Chat session CRUD
|
|
147
|
+
│ ├── llm_client.py # API client (generator protocol for tool handling)
|
|
148
|
+
│ └── tools.py # Tool definitions and execution
|
|
149
|
+
└── ui/
|
|
150
|
+
├── main_window.py # Main window; wires all signals
|
|
151
|
+
├── chat_history.py # Sidebar chat list + quick settings
|
|
152
|
+
├── chat_view.py # Markdown chat renderer
|
|
153
|
+
├── chat_input.py # Input field + file attachment
|
|
154
|
+
├── chat_worker.py # Background thread driving the LLM generator
|
|
155
|
+
└── settings_dialog.py # Settings dialog
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
---
|
|
159
|
+
|
|
160
|
+
## Development
|
|
161
|
+
|
|
162
|
+
### Install from source
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
git clone https://github.com/patw/pengy.git
|
|
166
|
+
cd pengy
|
|
167
|
+
pip install -e ".[all]"
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Running tests
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
pip install -e ".[all]"
|
|
174
|
+
python -m pytest tests/ -v
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
179
|
+
## Dependencies
|
|
180
|
+
|
|
181
|
+
| Package | Purpose |
|
|
182
|
+
|---------|---------|
|
|
183
|
+
| PySide6 | Qt6 GUI framework |
|
|
184
|
+
| openai | OpenAI-compatible API client |
|
|
185
|
+
| markdown | Markdown rendering |
|
|
186
|
+
| pygments | Syntax highlighting |
|
|
187
|
+
| ddgs | DuckDuckGo web search |
|
|
188
|
+
| rich | CLI formatting (tables, panels, markdown) |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64">
|
|
2
|
+
<!-- Blue background pill -->
|
|
3
|
+
<circle cx="32" cy="32" r="32" fill="#4a90d9"/>
|
|
4
|
+
<!-- Body -->
|
|
5
|
+
<ellipse cx="32" cy="46" rx="15" ry="15" fill="#1a1a2e"/>
|
|
6
|
+
<!-- Belly -->
|
|
7
|
+
<ellipse cx="32" cy="49" rx="9" ry="9" fill="#f0f0f0"/>
|
|
8
|
+
<!-- Head -->
|
|
9
|
+
<circle cx="32" cy="23" r="13" fill="#1a1a2e"/>
|
|
10
|
+
<!-- White face patch -->
|
|
11
|
+
<ellipse cx="32" cy="25" rx="7.5" ry="8.5" fill="#f0f0f0"/>
|
|
12
|
+
<!-- Eyes -->
|
|
13
|
+
<circle cx="28.5" cy="21" r="2.2" fill="#1a1a2e"/>
|
|
14
|
+
<circle cx="35.5" cy="21" r="2.2" fill="#1a1a2e"/>
|
|
15
|
+
<circle cx="29.1" cy="20.4" r="0.7" fill="white"/>
|
|
16
|
+
<circle cx="36.1" cy="20.4" r="0.7" fill="white"/>
|
|
17
|
+
<!-- Beak -->
|
|
18
|
+
<path d="M 29 25.5 Q 32 30 35 25.5 Z" fill="#f5a623"/>
|
|
19
|
+
<!-- Wings -->
|
|
20
|
+
<ellipse cx="17" cy="46" rx="5" ry="12" fill="#1a1a2e" transform="rotate(-18 17 46)"/>
|
|
21
|
+
<ellipse cx="47" cy="46" rx="5" ry="12" fill="#1a1a2e" transform="rotate(18 47 46)"/>
|
|
22
|
+
<!-- Feet -->
|
|
23
|
+
<ellipse cx="27" cy="60" rx="6" ry="2.5" fill="#f5a623"/>
|
|
24
|
+
<ellipse cx="37" cy="60" rx="6" ry="2.5" fill="#f5a623"/>
|
|
25
|
+
</svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""Pengy CLI - command-line interface."""
|