lemonpie-cli 0.2.0rc2__tar.gz → 0.3.1__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.
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/.gitignore +1 -0
- lemonpie_cli-0.3.1/.release-please/manifest.json +3 -0
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/CHANGELOG.md +37 -0
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/PKG-INFO +26 -21
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/README.md +23 -17
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/docs/ROADMAP.md +9 -2
- lemonpie_cli-0.3.1/docs/config.example.json +10 -0
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/docs/design/code-completion.md +1 -1
- lemonpie_cli-0.3.1/docs/design/feature-ideas.md +187 -0
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/docs/design/model-verification.md +1 -1
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/docs/design/packaging.md +0 -2
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/docs/usage/command-index.md +4 -2
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/pyproject.toml +2 -3
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/src/lemonpie/_version.py +2 -2
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/src/lemonpie/cli/config_cmd.py +119 -45
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/src/lemonpie/cli/parser.py +1 -0
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/src/lemonpie/cli/ui.py +1 -1
- lemonpie_cli-0.3.1/src/lemonpie/client.py +125 -0
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/src/lemonpie/config.py +6 -2
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/src/lemonpie/main.py +104 -27
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/src/lemonpie/paths.py +5 -10
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/src/lemonpie/sessions/storage.py +65 -19
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/tests/conftest.py +13 -11
- lemonpie_cli-0.3.1/tests/test_client.py +218 -0
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/tests/test_config_cmd.py +184 -145
- lemonpie_cli-0.3.1/tests/test_dry_run.py +221 -0
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/tests/test_sessions.py +27 -11
- lemonpie_cli-0.3.1/uv.lock +172 -0
- lemonpie_cli-0.2.0rc2/.release-please/manifest.json +0 -3
- lemonpie_cli-0.2.0rc2/docs/config.example.json +0 -5
- lemonpie_cli-0.2.0rc2/src/lemonpie/engine/ollama.py +0 -49
- lemonpie_cli-0.2.0rc2/src/lemonpie/sessions/__init__.py +0 -0
- lemonpie_cli-0.2.0rc2/uv.lock +0 -325
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/.github/workflows/ci.yml +0 -0
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/.github/workflows/release.yml +0 -0
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/.release-please/config.json +0 -0
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/LICENSE +0 -0
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/src/lemonpie/__init__.py +0 -0
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/src/lemonpie/cli/__init__.py +0 -0
- {lemonpie_cli-0.2.0rc2/src/lemonpie/engine → lemonpie_cli-0.3.1/src/lemonpie}/models.py +0 -0
- {lemonpie_cli-0.2.0rc2/src/lemonpie/engine → lemonpie_cli-0.3.1/src/lemonpie/sessions}/__init__.py +0 -0
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/src/lemonpie/time_utils.py +0 -0
- {lemonpie_cli-0.2.0rc2 → lemonpie_cli-0.3.1}/tests/test_cli.py +0 -0
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.1](https://github.com/famousStratum/LemonPie/compare/v0.3.0...v0.3.1) (2026-11-15)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* add --dry-run flag for previewing actions ([b432c2e](https://github.com/famousStratum/LemonPie/commit/b432c2e115c323af9ee13c13da560891873328ba))
|
|
9
|
+
* add --dry-run flag to preview actions without executing them ([dab6f25](https://github.com/famousStratum/LemonPie/commit/dab6f2527f753375d1489d51610aef743980051f))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* add autouse mock_argv fixture to prevent CI test failures ([3b7745f](https://github.com/famousStratum/LemonPie/commit/3b7745ffd605068c49b3ccbf296e35265e741f28))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Documentation
|
|
18
|
+
|
|
19
|
+
* create a doc for feature ideas ([#45](https://github.com/famousStratum/LemonPie/issues/45)) ([9e83b95](https://github.com/famousStratum/LemonPie/commit/9e83b95456b6657f17b1d3442cf1c984049671a7))
|
|
20
|
+
* update README description and --dry-run status ([999159f](https://github.com/famousStratum/LemonPie/commit/999159f9782039d4049e448121ccbae4538ea779))
|
|
21
|
+
|
|
22
|
+
## [0.3.0](https://github.com/famousStratum/LemonPie/compare/v0.2.0...v0.3.0) (2026-11-11)
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
### ⚠ BREAKING CHANGES
|
|
26
|
+
|
|
27
|
+
* add multi-backend support for OpenAI-compatible inference servers ([#42](https://github.com/famousStratum/LemonPie/issues/42))
|
|
28
|
+
|
|
29
|
+
### Features
|
|
30
|
+
|
|
31
|
+
* add multi-backend support for OpenAI-compatible inference servers ([#42](https://github.com/famousStratum/LemonPie/issues/42)) ([f1cadb6](https://github.com/famousStratum/LemonPie/commit/f1cadb622fdacf4c1e48074e094f27cb62aa79b8))
|
|
32
|
+
|
|
33
|
+
## [0.2.0](https://github.com/famousStratum/LemonPie/compare/v0.2.0-rc2...v0.2.0) (2026-11-11)
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
### Documentation
|
|
37
|
+
|
|
38
|
+
* Make all links absolute in README.md ([#40](https://github.com/famousStratum/LemonPie/issues/40)) ([3ec603e](https://github.com/famousStratum/LemonPie/commit/3ec603e4861008303ccdedc6736dbb178fe52c8c))
|
|
39
|
+
|
|
3
40
|
## [0.2.0-rc2](https://github.com/famousStratum/LemonPie/compare/v0.2.0-rc1...v0.2.0-rc2) (2026-11-01)
|
|
4
41
|
|
|
5
42
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: lemonpie-cli
|
|
3
|
-
Version: 0.
|
|
4
|
-
Summary: LemonPie — A lightweight
|
|
5
|
-
Project-URL: homepage, https://versicode.com/
|
|
3
|
+
Version: 0.3.1
|
|
4
|
+
Summary: LemonPie — A lightweight CLI for LLM inference servers
|
|
5
|
+
Project-URL: homepage, https://versicode.com/projects/lemon-pie
|
|
6
6
|
Project-URL: repository, https://github.com/famousStratum/LemonPie
|
|
7
7
|
Project-URL: issues, https://github.com/famousStratum/LemonPie/issues
|
|
8
8
|
Author-email: famousStratum <info@versicode.com>
|
|
@@ -14,7 +14,6 @@ Classifier: Intended Audience :: Developers
|
|
|
14
14
|
Classifier: Programming Language :: Python :: 3
|
|
15
15
|
Requires-Python: >=3.11
|
|
16
16
|
Requires-Dist: httpx
|
|
17
|
-
Requires-Dist: ollama
|
|
18
17
|
Requires-Dist: platformdirs
|
|
19
18
|
Description-Content-Type: text/markdown
|
|
20
19
|
|
|
@@ -24,21 +23,22 @@ Description-Content-Type: text/markdown
|
|
|
24
23
|

|
|
25
24
|

|
|
26
25
|
|
|
27
|
-
**LemonPie — A lightweight
|
|
26
|
+
**LemonPie — A lightweight CLI for LLM inference servers**
|
|
28
27
|
|
|
29
|
-
LemonPie is a compact CLI for
|
|
28
|
+
LemonPie is a compact CLI for chatting with any OpenAI-compatible inference server — Ollama, llama.cpp, LM Studio, vLLM, and others. It manages chat sessions and persists history locally, designed to be tiny and portable — ideal for lightweight systems and terminal users, but usable anywhere with Python and network access.
|
|
30
29
|
|
|
31
30
|
|
|
32
31
|
|
|
33
32
|
## ✨ Features
|
|
34
|
-
-
|
|
33
|
+
- Works with any OpenAI-compatible backend — Ollama, llama.cpp, LM Studio, vLLM, and more
|
|
34
|
+
- Start and manage chat sessions with any configured model
|
|
35
35
|
- Persist session history in your OS's standard user data directory
|
|
36
|
-
- Configure host, default model, and aliases via a config file in your OS's standard user config directory
|
|
37
|
-
- Interactive setup wizard (`lmConfig --init`)
|
|
36
|
+
- Configure host, backend, API key, default model, and aliases via a config file in your OS's standard user config directory
|
|
37
|
+
- Interactive setup wizard (`lmConfig --init`) — select backend, configure server, verify reachability, and register models
|
|
38
38
|
- Add, remove, and list models with aliases (`lmConfig`)
|
|
39
39
|
- Switch models mid‑session with confirmation
|
|
40
40
|
- Atomic writes for safety (tmp + replace)
|
|
41
|
-
- Streaming responses
|
|
41
|
+
- Streaming responses for real‑time output
|
|
42
42
|
- Graceful handling of Ctrl‑C interrupts
|
|
43
43
|
|
|
44
44
|
|
|
@@ -53,13 +53,12 @@ LemonPie/
|
|
|
53
53
|
│ ├── config.py # Configuration logic & I/O
|
|
54
54
|
│ ├── paths.py # OS-appropriate config/data directory resolution
|
|
55
55
|
│ ├── time_utils.py # Timestamp helpers
|
|
56
|
+
│ ├── client.py # HTTP client & error handling
|
|
57
|
+
│ ├── models.py # Model finding & resolution
|
|
56
58
|
│ ├── cli/
|
|
57
59
|
│ │ ├── parser.py # Argument parsing (lm)
|
|
58
60
|
│ │ ├── ui.py # Terminal helpers & confirmation
|
|
59
61
|
│ │ └── config_cmd.py # Config manager (entrypoint: lmConfig)
|
|
60
|
-
│ ├── engine/
|
|
61
|
-
│ │ ├── models.py # Model finding & resolution
|
|
62
|
-
│ │ └── ollama.py # Ollama client interaction
|
|
63
62
|
│ └── sessions/
|
|
64
63
|
│ └── storage.py # Session persistence
|
|
65
64
|
├── tests/ # pytest suite
|
|
@@ -84,14 +83,16 @@ LemonPie keeps its config file and session history in your OS's standard user di
|
|
|
84
83
|
| Windows | `%LOCALAPPDATA%\lemonpie\` | `%LOCALAPPDATA%\lemonpie\sessions\` |
|
|
85
84
|
|
|
86
85
|
|
|
87
|
-
|
|
86
|
+
All three are overridable via environment variables — `LEMONPIE_HOST`, `LEMONPIE_CONFIG_DIR`, and `LEMONPIE_SESSION_DIR` — useful for testing or running in a container.
|
|
88
87
|
|
|
89
88
|
`docs/config.example.json` is a template. Run `lmConfig --init` to set up your config interactively — it verifies server reachability, lists installed models for selection, and writes the file for you. `lmConfig` also auto-creates a minimal config on first use if you prefer to configure manually.
|
|
90
89
|
|
|
91
90
|
### Example structure:
|
|
92
91
|
```json
|
|
93
92
|
{
|
|
94
|
-
"
|
|
93
|
+
"backend": "ollama",
|
|
94
|
+
"server": "http://localhost:11434",
|
|
95
|
+
"api_key": null,
|
|
95
96
|
"default": "qwen2.5-coder:3b",
|
|
96
97
|
"models": [
|
|
97
98
|
{ "alias": "qwen", "name": "qwen2.5-coder:3b" },
|
|
@@ -99,8 +100,10 @@ Both are overridable via environment variables — `LEMONPIE_CONFIG_DIR` and `LE
|
|
|
99
100
|
]
|
|
100
101
|
}
|
|
101
102
|
```
|
|
102
|
-
|
|
103
|
-
|
|
103
|
+
backend: which inference server you're using (e.g. `ollama`, `llamacpp`, `lmstudio`) \
|
|
104
|
+
server: base URL of your inference server \
|
|
105
|
+
api_key: optional API key for hosted backends (e.g. OpenAI) \
|
|
106
|
+
default: canonical model name (full identifier) \
|
|
104
107
|
models: list of objects with alias (nullable) and name
|
|
105
108
|
|
|
106
109
|
## 🚀 Usage
|
|
@@ -120,6 +123,9 @@ models: list of objects with alias (nullable) and name
|
|
|
120
123
|
- Print current session history\
|
|
121
124
|
`lm -p`
|
|
122
125
|
|
|
126
|
+
- Show what would happen without sending requests or modifying any data (dry run)\
|
|
127
|
+
`lm --dry-run -n "Hello"`
|
|
128
|
+
|
|
123
129
|
- Switch model in current session\
|
|
124
130
|
`lm -m qwen2.5-coder:3b`
|
|
125
131
|
|
|
@@ -135,7 +141,7 @@ models: list of objects with alias (nullable) and name
|
|
|
135
141
|
`lmConfig --list-models`\
|
|
136
142
|
`lmConfig --remove-model qwen`
|
|
137
143
|
|
|
138
|
-
👉 Full [command reference](docs/usage/command-index.md).
|
|
144
|
+
👉 Full [command reference](https://github.com/famousStratum/LemonPie/blob/main/docs/usage/command-index.md).
|
|
139
145
|
|
|
140
146
|
## 🗺 Roadmap
|
|
141
147
|
|
|
@@ -143,12 +149,11 @@ Planned features and improvements:
|
|
|
143
149
|
|
|
144
150
|
- Code completion (autocomplete)
|
|
145
151
|
- Model verification state machine
|
|
146
|
-
- Enhanced error handling and user feedback
|
|
147
152
|
- Cross‑platform packaging (apt, winget, Homebrew)
|
|
148
153
|
- Future schema validation for config/session files
|
|
149
154
|
|
|
150
|
-
👉 See the full [roadmap](docs/ROADMAP.md) for details.
|
|
155
|
+
👉 See the full [roadmap](https://github.com/famousStratum/LemonPie/blob/main/docs/ROADMAP.md) for details.
|
|
151
156
|
|
|
152
157
|
## 📜 License
|
|
153
158
|
|
|
154
|
-
This project is licensed under the **GNU General Public License v3.0** (**GPLv3**).You may redistribute and/or modify it under the terms of the GPL as published by the Free Software Foundation.See the [**license**](LICENSE) file for details.
|
|
159
|
+
This project is licensed under the **GNU General Public License v3.0** (**GPLv3**).You may redistribute and/or modify it under the terms of the GPL as published by the Free Software Foundation.See the [**license**](https://github.com/famousStratum/LemonPie/blob/main/LICENSE) file for details.
|
|
@@ -4,21 +4,22 @@
|
|
|
4
4
|

|
|
5
5
|

|
|
6
6
|
|
|
7
|
-
**LemonPie — A lightweight
|
|
7
|
+
**LemonPie — A lightweight CLI for LLM inference servers**
|
|
8
8
|
|
|
9
|
-
LemonPie is a compact CLI for
|
|
9
|
+
LemonPie is a compact CLI for chatting with any OpenAI-compatible inference server — Ollama, llama.cpp, LM Studio, vLLM, and others. It manages chat sessions and persists history locally, designed to be tiny and portable — ideal for lightweight systems and terminal users, but usable anywhere with Python and network access.
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
## ✨ Features
|
|
14
|
-
-
|
|
14
|
+
- Works with any OpenAI-compatible backend — Ollama, llama.cpp, LM Studio, vLLM, and more
|
|
15
|
+
- Start and manage chat sessions with any configured model
|
|
15
16
|
- Persist session history in your OS's standard user data directory
|
|
16
|
-
- Configure host, default model, and aliases via a config file in your OS's standard user config directory
|
|
17
|
-
- Interactive setup wizard (`lmConfig --init`)
|
|
17
|
+
- Configure host, backend, API key, default model, and aliases via a config file in your OS's standard user config directory
|
|
18
|
+
- Interactive setup wizard (`lmConfig --init`) — select backend, configure server, verify reachability, and register models
|
|
18
19
|
- Add, remove, and list models with aliases (`lmConfig`)
|
|
19
20
|
- Switch models mid‑session with confirmation
|
|
20
21
|
- Atomic writes for safety (tmp + replace)
|
|
21
|
-
- Streaming responses
|
|
22
|
+
- Streaming responses for real‑time output
|
|
22
23
|
- Graceful handling of Ctrl‑C interrupts
|
|
23
24
|
|
|
24
25
|
|
|
@@ -33,13 +34,12 @@ LemonPie/
|
|
|
33
34
|
│ ├── config.py # Configuration logic & I/O
|
|
34
35
|
│ ├── paths.py # OS-appropriate config/data directory resolution
|
|
35
36
|
│ ├── time_utils.py # Timestamp helpers
|
|
37
|
+
│ ├── client.py # HTTP client & error handling
|
|
38
|
+
│ ├── models.py # Model finding & resolution
|
|
36
39
|
│ ├── cli/
|
|
37
40
|
│ │ ├── parser.py # Argument parsing (lm)
|
|
38
41
|
│ │ ├── ui.py # Terminal helpers & confirmation
|
|
39
42
|
│ │ └── config_cmd.py # Config manager (entrypoint: lmConfig)
|
|
40
|
-
│ ├── engine/
|
|
41
|
-
│ │ ├── models.py # Model finding & resolution
|
|
42
|
-
│ │ └── ollama.py # Ollama client interaction
|
|
43
43
|
│ └── sessions/
|
|
44
44
|
│ └── storage.py # Session persistence
|
|
45
45
|
├── tests/ # pytest suite
|
|
@@ -64,14 +64,16 @@ LemonPie keeps its config file and session history in your OS's standard user di
|
|
|
64
64
|
| Windows | `%LOCALAPPDATA%\lemonpie\` | `%LOCALAPPDATA%\lemonpie\sessions\` |
|
|
65
65
|
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
All three are overridable via environment variables — `LEMONPIE_HOST`, `LEMONPIE_CONFIG_DIR`, and `LEMONPIE_SESSION_DIR` — useful for testing or running in a container.
|
|
68
68
|
|
|
69
69
|
`docs/config.example.json` is a template. Run `lmConfig --init` to set up your config interactively — it verifies server reachability, lists installed models for selection, and writes the file for you. `lmConfig` also auto-creates a minimal config on first use if you prefer to configure manually.
|
|
70
70
|
|
|
71
71
|
### Example structure:
|
|
72
72
|
```json
|
|
73
73
|
{
|
|
74
|
-
"
|
|
74
|
+
"backend": "ollama",
|
|
75
|
+
"server": "http://localhost:11434",
|
|
76
|
+
"api_key": null,
|
|
75
77
|
"default": "qwen2.5-coder:3b",
|
|
76
78
|
"models": [
|
|
77
79
|
{ "alias": "qwen", "name": "qwen2.5-coder:3b" },
|
|
@@ -79,8 +81,10 @@ Both are overridable via environment variables — `LEMONPIE_CONFIG_DIR` and `LE
|
|
|
79
81
|
]
|
|
80
82
|
}
|
|
81
83
|
```
|
|
82
|
-
|
|
83
|
-
|
|
84
|
+
backend: which inference server you're using (e.g. `ollama`, `llamacpp`, `lmstudio`) \
|
|
85
|
+
server: base URL of your inference server \
|
|
86
|
+
api_key: optional API key for hosted backends (e.g. OpenAI) \
|
|
87
|
+
default: canonical model name (full identifier) \
|
|
84
88
|
models: list of objects with alias (nullable) and name
|
|
85
89
|
|
|
86
90
|
## 🚀 Usage
|
|
@@ -100,6 +104,9 @@ models: list of objects with alias (nullable) and name
|
|
|
100
104
|
- Print current session history\
|
|
101
105
|
`lm -p`
|
|
102
106
|
|
|
107
|
+
- Show what would happen without sending requests or modifying any data (dry run)\
|
|
108
|
+
`lm --dry-run -n "Hello"`
|
|
109
|
+
|
|
103
110
|
- Switch model in current session\
|
|
104
111
|
`lm -m qwen2.5-coder:3b`
|
|
105
112
|
|
|
@@ -115,7 +122,7 @@ models: list of objects with alias (nullable) and name
|
|
|
115
122
|
`lmConfig --list-models`\
|
|
116
123
|
`lmConfig --remove-model qwen`
|
|
117
124
|
|
|
118
|
-
👉 Full [command reference](docs/usage/command-index.md).
|
|
125
|
+
👉 Full [command reference](https://github.com/famousStratum/LemonPie/blob/main/docs/usage/command-index.md).
|
|
119
126
|
|
|
120
127
|
## 🗺 Roadmap
|
|
121
128
|
|
|
@@ -123,12 +130,11 @@ Planned features and improvements:
|
|
|
123
130
|
|
|
124
131
|
- Code completion (autocomplete)
|
|
125
132
|
- Model verification state machine
|
|
126
|
-
- Enhanced error handling and user feedback
|
|
127
133
|
- Cross‑platform packaging (apt, winget, Homebrew)
|
|
128
134
|
- Future schema validation for config/session files
|
|
129
135
|
|
|
130
|
-
👉 See the full [roadmap](docs/ROADMAP.md) for details.
|
|
136
|
+
👉 See the full [roadmap](https://github.com/famousStratum/LemonPie/blob/main/docs/ROADMAP.md) for details.
|
|
131
137
|
|
|
132
138
|
## 📜 License
|
|
133
139
|
|
|
134
|
-
This project is licensed under the **GNU General Public License v3.0** (**GPLv3**).You may redistribute and/or modify it under the terms of the GPL as published by the Free Software Foundation.See the [**license**](LICENSE) file for details.
|
|
140
|
+
This project is licensed under the **GNU General Public License v3.0** (**GPLv3**).You may redistribute and/or modify it under the terms of the GPL as published by the Free Software Foundation.See the [**license**](https://github.com/famousStratum/LemonPie/blob/main/LICENSE) file for details.
|
|
@@ -27,8 +27,15 @@ Planned logic for `lmConfig --add-model`:
|
|
|
27
27
|
|
|
28
28
|
<sub>*See* docs/design/[code-completion.md](design/code-completion.md) *for brainstorming and design notes.* </sub>
|
|
29
29
|
|
|
30
|
-
## Enhanced error handling and user feedback
|
|
31
|
-
-
|
|
30
|
+
## ~~Enhanced error handling and user feedback~~ ✅ Done
|
|
31
|
+
- Connection refused, timeout, DNS, and protocol errors with actionable hints
|
|
32
|
+
- Tightened exception handling throughout
|
|
33
|
+
|
|
34
|
+
## Multi-backend support ✅ Done
|
|
35
|
+
- Unified OpenAI-compatible HTTP client (`/v1/chat/completions`) works with Ollama, llama.cpp, LM Studio, vLLM, and any compatible server
|
|
36
|
+
- `backend` field in config for identification and hints
|
|
37
|
+
- Optional `api_key` support for hosted APIs
|
|
38
|
+
- `lmConfig --init` guides users through backend selection and server setup
|
|
32
39
|
|
|
33
40
|
## Future schema validation
|
|
34
41
|
- Config/session file validation
|
|
@@ -30,7 +30,7 @@ If you cannot produce code, output an empty string.
|
|
|
30
30
|
|
|
31
31
|
**lmConfig commands:**
|
|
32
32
|
- `lmConfig --set-default-autocomplete <model>` to set the default.
|
|
33
|
-
- `lmConfig --add-model` and the existing state machine should verify the model is available on the
|
|
33
|
+
- `lmConfig --add-model` and the existing state machine should verify the model is available on the server.
|
|
34
34
|
|
|
35
35
|
**Behavior:** If `--model` is passed on the CLI it overrides the default; otherwise use `default_autocomplete_model`.
|
|
36
36
|
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
# 🍋 Feature Ideas & Enhancement Brainstorm
|
|
2
|
+
|
|
3
|
+
**Status:** Draft / Brainstorm
|
|
4
|
+
|
|
5
|
+
This document collects feature ideas and enhancement recommendations for LemonPie.
|
|
6
|
+
It serves as a living reference for prioritization and implementation planning.
|
|
7
|
+
Items are categorized by effort/value and linked to design docs where applicable.
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## 🔥 High Priority — Essential
|
|
12
|
+
|
|
13
|
+
### 1. Session Truncation / Context Management
|
|
14
|
+
|
|
15
|
+
**Problem:** Session history grows without bound. Eventually hits model context limits and inflates API cost. This is a technical bottleneck, not just a convenience issue.
|
|
16
|
+
|
|
17
|
+
**Proposal:**
|
|
18
|
+
- `--max-turns N` — auto-truncate oldest conversation turns (simple, no model call)
|
|
19
|
+
- `--context-size <tokens>` — trim messages to fit a specified context window
|
|
20
|
+
- `--compact` — summarize older turns before sending to reduce client-side memory and network payload size (inference cost is on the server, not the client)
|
|
21
|
+
|
|
22
|
+
**Status:** Not implemented.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
### 2. System Prompt Support
|
|
27
|
+
|
|
28
|
+
**Problem:** No way to give the model a role or instructions outside the conversation. Cannot do "act as a code reviewer" or set context.
|
|
29
|
+
|
|
30
|
+
**Proposal:** Add system prompt via:
|
|
31
|
+
- `lm --system "You are a helpful Python tutor"`
|
|
32
|
+
- `lm --system-file ./system-prompt.txt`
|
|
33
|
+
|
|
34
|
+
Stored per-session so it persists with history. Default system prompt could be configured in `config.json`.
|
|
35
|
+
|
|
36
|
+
**Status:** Not implemented.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
### 3. Interactive REPL Mode
|
|
41
|
+
|
|
42
|
+
**Problem:** `lm` is a single-shot tool — type prompt, get response, exit. No persistent chat.
|
|
43
|
+
|
|
44
|
+
**Proposal:** A `lm --repl` mode that stays in the loop:
|
|
45
|
+
- Accepts user input interactively
|
|
46
|
+
- Auto-appends to current session history
|
|
47
|
+
- Supports slash-commands:
|
|
48
|
+
- `/new` — start a new session
|
|
49
|
+
- `/close` — close current session
|
|
50
|
+
- `/history` — print conversation history
|
|
51
|
+
- `/model <name>` — switch model
|
|
52
|
+
- `/title <text>` — rename session
|
|
53
|
+
- `/exit` — quit
|
|
54
|
+
- Can be combined with existing flags: `lm --repl -m qwen`
|
|
55
|
+
|
|
56
|
+
**Sub-features:** REPL keyboard shortcuts and history (up-arrow for previous prompts, tab completion for model names/aliases, `Ctrl+R` for search). Depends on REPL being implemented first.
|
|
57
|
+
|
|
58
|
+
**Status:** Not implemented. Mentioned in [ROADMAP.md](../ROADMAP.md).
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## ⚡ Medium Priority — Medium Value
|
|
63
|
+
|
|
64
|
+
### 4. Temperature / Sampling Parameters
|
|
65
|
+
|
|
66
|
+
**Proposal:** Add sampling control:
|
|
67
|
+
```
|
|
68
|
+
lm --temperature 0.7 --top-p 0.9 --max-tokens 2048
|
|
69
|
+
```
|
|
70
|
+
Store defaults in `config.json` or allow per-session overrides. Useful for code generation (low temp) vs. brainstorming (high temp).
|
|
71
|
+
|
|
72
|
+
**Status:** Not implemented.
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
### 5. Stdin / Pipe Input
|
|
77
|
+
|
|
78
|
+
**Problem:** No way to pipe text into a prompt. Forces users to type or use `-n "..."` with shell escaping.
|
|
79
|
+
|
|
80
|
+
**Proposal:**
|
|
81
|
+
- `lm -n -m qwen < some_file.py` — send a file's contents as the prompt
|
|
82
|
+
- `cat log.txt | lm "summarize this"` — natural Unix workflow
|
|
83
|
+
- Detect EOF / tty to differentiate pipe from interactive
|
|
84
|
+
|
|
85
|
+
**Status:** Not implemented.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
### 6. Schema Validation for Config
|
|
90
|
+
|
|
91
|
+
**Problem:** Config is entirely duck-typed JSON. Typos like `"serer"` instead of `"server"` cause silent misbehavior.
|
|
92
|
+
|
|
93
|
+
**Proposal:** Validate `config.json` on load:
|
|
94
|
+
- Use `pydantic` or `jsonschema`
|
|
95
|
+
- Warn and auto-migrate on unknown fields
|
|
96
|
+
- Type-check required fields
|
|
97
|
+
|
|
98
|
+
**Status:** Partial — `ensure_models_list()` handles one migration case. No general validation.
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## 🛠 Quick Wins — Low Effort, Noticeable Improvement
|
|
103
|
+
|
|
104
|
+
### 7. `--config <path>` Flag
|
|
105
|
+
|
|
106
|
+
Override the config file location from the CLI. Useful for testing, temporary overrides, or multi-environment setups.
|
|
107
|
+
|
|
108
|
+
**Status:** Not implemented.
|
|
109
|
+
|
|
110
|
+
### 8. `--dry-run` Flag
|
|
111
|
+
|
|
112
|
+
Print the HTTP payload (`/v1/chat/completions` body) without sending it. Debugging tool for verifying prompts, system prompts, and message history.
|
|
113
|
+
|
|
114
|
+
**Status:** Implemented.
|
|
115
|
+
|
|
116
|
+
### 9. Config Migration Warnings
|
|
117
|
+
|
|
118
|
+
Warn the user when loading an old config format (e.g. pre-0.2.0) and auto-migrate. Currently, missing keys silently default to `None`.
|
|
119
|
+
|
|
120
|
+
**Status:** Not implemented.
|
|
121
|
+
|
|
122
|
+
### 10. `lmConfig --update-models`
|
|
123
|
+
|
|
124
|
+
Re-fetch available models from the server without re-running the full `--init` wizard. A quick way to refresh the model list.
|
|
125
|
+
|
|
126
|
+
**Status:** Not implemented.
|
|
127
|
+
|
|
128
|
+
---
|
|
129
|
+
|
|
130
|
+
## ⏳ Deferred
|
|
131
|
+
|
|
132
|
+
### ~~Session Export / Import~~ — Deferred
|
|
133
|
+
|
|
134
|
+
~~**Proposal:**~~
|
|
135
|
+
~~- `lm --export <id> > session.json` — export a session to a file~~
|
|
136
|
+
~~- `lm --import session.json` — import a session from a file~~
|
|
137
|
+
~~- Useful for sharing, migrating, or backup~~
|
|
138
|
+
|
|
139
|
+
**Reason deferred:** Sessions are already JSON files stored on disk. For SBC/low-resource use cases, `scp` or `rsync` for backups, and git for migration, cover the common workflows. A dedicated export/import feature adds complexity for a convenience gap that file operations solve adequately today.
|
|
140
|
+
|
|
141
|
+
**Status:** Deferred — may revisit for schema versioning or batch operations in the future.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
### ~~Model Comparison Mode~~ — Deferred
|
|
146
|
+
|
|
147
|
+
~~`lm --compare model1 model2 --prompt "explain quantum computing"` — sends the same prompt to two models, outputs responses side by side.~~
|
|
148
|
+
|
|
149
|
+
**Reason deferred:** Relatively high resource cost (2× API requests, 2× compute) for a niche feature. Lower priority than core functionality. May revisit if a lightweight streaming side-by-side mode makes sense later.
|
|
150
|
+
|
|
151
|
+
**Status:** Deferred.
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## 📋 Already Planned (Linked Design Docs)
|
|
156
|
+
|
|
157
|
+
### Code Completion
|
|
158
|
+
- See [code-completion.md](code-completion.md)
|
|
159
|
+
- `--autocomplete` flag, system role enforcement, REPL integration
|
|
160
|
+
|
|
161
|
+
### Model Verification State Machine
|
|
162
|
+
- See [model-verification.md](model-verification.md)
|
|
163
|
+
- Server reachability check, model installation, pull workflow
|
|
164
|
+
|
|
165
|
+
### Cross-Platform Packaging
|
|
166
|
+
- See [packaging.md](packaging.md)
|
|
167
|
+
- `.deb`, `winget`, Homebrew distribution
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
## 📌 How to Use This Document
|
|
172
|
+
|
|
173
|
+
1. **Discuss and debate** — add comments, objections, alternatives
|
|
174
|
+
2. **Prioritize** — assign priority labels or move items between sections
|
|
175
|
+
3. **Combine** — ideas can merge (e.g., REPL + System Prompt + Parameters are related)
|
|
176
|
+
4. **Split** — large ideas can be broken into sub-tasks
|
|
177
|
+
5. **When ready**, promote an item to a dedicated design doc and move it to "Implemented"
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
*Last updated: 2026-11-12*
|
|
182
|
+
|
|
183
|
+
---
|
|
184
|
+
|
|
185
|
+
### Changes
|
|
186
|
+
|
|
187
|
+
- **2026-11-12:** Promoted session truncation and REPL mode to essential priority. Reordered essential section: (1) Truncation, (2) System prompt, (3) REPL. Moved compaction back in (client resource savings, not server cost concern). Moved session export/import and model comparison to "Deferred" section (crossed out). Removed "Niche/Fun" section (REPL shortcuts absorbed into REPL section).
|
|
@@ -8,7 +8,7 @@ It defines how LemonPie should handle server reachability, model installation, a
|
|
|
8
8
|
---
|
|
9
9
|
|
|
10
10
|
## 🎯 Goals
|
|
11
|
-
- Ensure models are verified against the
|
|
11
|
+
- Ensure models are verified against the server before being added.
|
|
12
12
|
- Provide clear user feedback for success/failure cases.
|
|
13
13
|
- Support `--force` as a broad override mechanism (alias conflicts, skipping verification).
|
|
14
14
|
- Keep logic predictable and extensible for future improvements.
|
|
@@ -18,7 +18,6 @@ It is intended as a **whiteboard for brainstorming** CI/CD flows, signing, and r
|
|
|
18
18
|
- Build `.deb` packages using `dpkg-buildpackage` or `debhelper`.
|
|
19
19
|
- Host packages in a PPA or custom apt repository.
|
|
20
20
|
- Automate publishing with GitHub Actions.
|
|
21
|
-
- Consider dependency handling (Python, Ollama client).
|
|
22
21
|
|
|
23
22
|
|
|
24
23
|
## 🪟 Windows (winget)
|
|
@@ -31,7 +30,6 @@ It is intended as a **whiteboard for brainstorming** CI/CD flows, signing, and r
|
|
|
31
30
|
## 🍎 macOS (Homebrew)
|
|
32
31
|
- Write a Homebrew formula pointing to GitHub releases.
|
|
33
32
|
- Support `brew install lemonpie`.
|
|
34
|
-
- Handle dependencies (Python, Ollama client).
|
|
35
33
|
- Automate formula updates via CI/CD.
|
|
36
34
|
|
|
37
35
|
|
|
@@ -8,9 +8,9 @@ Useful for both **users** (cheat sheet) and **developers** (tracking CLI surface
|
|
|
8
8
|
## lmConfig
|
|
9
9
|
Manage LemonPie configuration (`config.json`).
|
|
10
10
|
|
|
11
|
-
- `--init` — Interactive setup wizard:
|
|
11
|
+
- `--init` — Interactive setup wizard: select backend, configure server URL (local default or custom), verify reachability, list and select installed models, optionally set a default
|
|
12
12
|
- `--init --force` — Same as `--init` but skip server verification
|
|
13
|
-
- `--host <url>` — Set
|
|
13
|
+
- `--host <url>` — Set server host URL (`http(s)://host:port`)
|
|
14
14
|
- `--default-model <name>` — Set default model using alias or full name (must exist in models)
|
|
15
15
|
- `--add-model <alias> <model>` — Add model mapping: alias → model_full_name
|
|
16
16
|
- `--remove-model <identifier>` — Remove a model mapping by alias or full name
|
|
@@ -33,11 +33,13 @@ Run LemonPie with a given model or prompt.
|
|
|
33
33
|
- `-c, --close` — Close current session
|
|
34
34
|
- `-p, --print` — Print current session history
|
|
35
35
|
- `--delete-all` — Delete all stored sessions
|
|
36
|
+
- `--dry-run` — Print the HTTP payload without sending it (debugging tool)
|
|
36
37
|
- `prompt` — Prompt text (positional argument)
|
|
37
38
|
|
|
38
39
|
---
|
|
39
40
|
|
|
40
41
|
## Notes
|
|
42
|
+
- `--dry-run` prints the full JSON payload to `/v1/chat/completions` and exits (exit code 0)
|
|
41
43
|
- Flags can be combined with prompts, e.g.:
|
|
42
44
|
`lm -m smollm:360m -n "Hello world"`
|
|
43
45
|
- `--force` applies to `lmConfig --add-model` (overwrite alias conflicts) and `lmConfig --init` (skip server verification).
|
|
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "lemonpie-cli"
|
|
7
7
|
dynamic = ["version"]
|
|
8
|
-
description = "LemonPie — A lightweight
|
|
8
|
+
description = "LemonPie — A lightweight CLI for LLM inference servers"
|
|
9
9
|
authors = [
|
|
10
10
|
{ name = "famousStratum", email = "info@versicode.com" }
|
|
11
11
|
]
|
|
@@ -20,13 +20,12 @@ classifiers = [
|
|
|
20
20
|
]
|
|
21
21
|
|
|
22
22
|
dependencies = [
|
|
23
|
-
"ollama",
|
|
24
23
|
"httpx",
|
|
25
24
|
"platformdirs"
|
|
26
25
|
]
|
|
27
26
|
|
|
28
27
|
[project.urls]
|
|
29
|
-
homepage = "https://versicode.com/
|
|
28
|
+
homepage = "https://versicode.com/projects/lemon-pie"
|
|
30
29
|
repository = "https://github.com/famousStratum/LemonPie"
|
|
31
30
|
issues = "https://github.com/famousStratum/LemonPie/issues"
|
|
32
31
|
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '0.
|
|
22
|
-
__version_tuple__ = version_tuple = (0,
|
|
21
|
+
__version__ = version = '0.3.1'
|
|
22
|
+
__version_tuple__ = version_tuple = (0, 3, 1)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|