lemonade-interactive-loader 1.0.0
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.
- package/README.md +288 -0
- package/index.js +16 -0
- package/package.json +40 -0
- package/src/README.md +88 -0
- package/src/cli/menu.js +359 -0
- package/src/cli/prompts.js +247 -0
- package/src/cli/setup-wizard.js +243 -0
- package/src/config/constants.js +83 -0
- package/src/config/index.js +49 -0
- package/src/index.js +58 -0
- package/src/services/asset-manager.js +159 -0
- package/src/services/download.js +102 -0
- package/src/services/github.js +72 -0
- package/src/services/server.js +174 -0
- package/src/utils/system.js +150 -0
package/README.md
ADDED
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
# 🍋 Lemonade Launcher
|
|
2
|
+
|
|
3
|
+
[](https://opensource.org/licenses/ISC)
|
|
4
|
+
[](https://nodejs.org/)
|
|
5
|
+
[](#)
|
|
6
|
+
|
|
7
|
+
**The easiest way to manage llama.cpp builds and run Lemonade Server**
|
|
8
|
+
|
|
9
|
+
Lemonade Launcher is a professional, cross-platform CLI tool that simplifies downloading llama.cpp builds and launching Lemonade Server with an intuitive interactive interface.
|
|
10
|
+
|
|
11
|
+
## 🚀 Quick Start
|
|
12
|
+
|
|
13
|
+
### Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
git clone https://github.com/yourusername/lemonade-launcher.git
|
|
17
|
+
cd lemonade-launcher
|
|
18
|
+
npm install
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Running the Tool
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# Start the interactive CLI
|
|
25
|
+
npm start
|
|
26
|
+
# or
|
|
27
|
+
node index.js
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
That's it! You'll be presented with a friendly menu to configure and run your server.
|
|
31
|
+
|
|
32
|
+
## 🎯 What You Can Do
|
|
33
|
+
|
|
34
|
+
### Interactive Menu Options
|
|
35
|
+
|
|
36
|
+
The main menu adapts based on whether you have a configuration saved:
|
|
37
|
+
|
|
38
|
+
**When NO configuration exists:**
|
|
39
|
+
```
|
|
40
|
+
? What would you like to do?
|
|
41
|
+
❯ 🚀 Setup - Configure Lemonade Server
|
|
42
|
+
📦 Download Custom llama.cpp Builds
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**When configuration EXISTS:**
|
|
46
|
+
```
|
|
47
|
+
? What would you like to do?
|
|
48
|
+
❯ ▶️ Start Server with Current Config
|
|
49
|
+
✏️ Edit Configuration
|
|
50
|
+
👁️ View Configuration
|
|
51
|
+
🔄 Reset Configuration
|
|
52
|
+
──────────────────────────────────────
|
|
53
|
+
🚀 Setup - Configure Lemonade Server
|
|
54
|
+
📦 Download Custom llama.cpp Builds
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
| Command | Description |
|
|
58
|
+
|---------|-------------||
|
|
59
|
+
| **▶️ Start Server** | Launch Lemonade Server with saved config (when config exists) |
|
|
60
|
+
| **✏️ Edit Configuration** | Update your saved settings interactively |
|
|
61
|
+
| **👁️ View Configuration** | See your current configuration and installed builds |
|
|
62
|
+
| **🔄 Reset Configuration** | Start fresh by resetting all settings |
|
|
63
|
+
| **🚀 Setup** | Run the 8-question setup wizard to configure everything |
|
|
64
|
+
| **📦 Download Builds** | View, delete, or download custom llama.cpp builds |
|
|
65
|
+
|
|
66
|
+
### The Setup Wizard
|
|
67
|
+
|
|
68
|
+
Just answer 8 simple questions:
|
|
69
|
+
|
|
70
|
+
1. **Network access?** Should the server be accessible from other devices?
|
|
71
|
+
2. **Port number?** Which port should it run on? (default: 8080)
|
|
72
|
+
3. **Logging level?** Choose from info, debug, warning, or error
|
|
73
|
+
4. **Model directory?** Point to existing models (like LM Studio) if needed
|
|
74
|
+
5. **Interface type?** System tray or headless mode
|
|
75
|
+
6. **Custom arguments?** Any additional llama.cpp parameters?
|
|
76
|
+
7. **Custom build?** Use a specific llama.cpp build from GitHub?
|
|
77
|
+
8. **Backend?** Choose auto, vulkan, rocm, or cpu
|
|
78
|
+
|
|
79
|
+
## ✨ Key Features
|
|
80
|
+
|
|
81
|
+
- **🎨 User-Friendly Interface** - Interactive menus, no command-line expertise needed
|
|
82
|
+
- **💾 Smart Configuration** - Save settings once, use them forever
|
|
83
|
+
- **📦 Build Management** - Browse, download, and manage multiple llama.cpp builds
|
|
84
|
+
- **🖥️ Backend Flexibility** - Support for CPU, CUDA, ROCm, Vulkan, and more
|
|
85
|
+
- **🌐 Network Ready** - Easily configure localhost or network access
|
|
86
|
+
- **🔄 Cross-Platform** - Works seamlessly on Windows, Linux, and macOS
|
|
87
|
+
- **🎯 Auto-Detection** - Automatically suggests the best builds for your system
|
|
88
|
+
- **⚡ Quick Launch** - Start your server with a single command
|
|
89
|
+
|
|
90
|
+
## 📖 Documentation
|
|
91
|
+
|
|
92
|
+
- **📚 [Usage Guide](#-quick-start)** - Get started quickly
|
|
93
|
+
- **🔧 [Technical Documentation](TECHNICAL_README.md)** - Deep dive into architecture and API
|
|
94
|
+
- **🛠️ [Troubleshooting](#-troubleshooting)** - Common issues and solutions
|
|
95
|
+
|
|
96
|
+
## 🎬 Usage Examples
|
|
97
|
+
|
|
98
|
+
### First-Time Setup
|
|
99
|
+
|
|
100
|
+
```bash
|
|
101
|
+
$ node index.js
|
|
102
|
+
|
|
103
|
+
╔════════════════════════════════════════════════════════╗
|
|
104
|
+
║ 🍋 Lemonade Interactive Launcher ║
|
|
105
|
+
╚════════════════════════════════════════════════════════╝
|
|
106
|
+
|
|
107
|
+
⚠️ No configuration found. Please run Setup first.
|
|
108
|
+
|
|
109
|
+
? What would you like to do?
|
|
110
|
+
❯ 🚀 Setup - Configure Lemonade Server
|
|
111
|
+
📦 Download Custom llama.cpp Builds
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### After Configuration
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
$ node index.js
|
|
118
|
+
|
|
119
|
+
╔════════════════════════════════════════════════════════╗
|
|
120
|
+
║ 🍋 Lemonade Interactive Launcher ║
|
|
121
|
+
╚════════════════════════════════════════════════════════╝
|
|
122
|
+
|
|
123
|
+
? What would you like to do?
|
|
124
|
+
❯ ▶️ Start Server with Current Config
|
|
125
|
+
✏️ Edit Configuration
|
|
126
|
+
👁️ View Configuration
|
|
127
|
+
🔄 Reset Configuration
|
|
128
|
+
──────────────────────────────────────
|
|
129
|
+
🚀 Setup - Configure Lemonade Server
|
|
130
|
+
📦 Download Custom llama.cpp Builds
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### Downloading a Custom Build
|
|
134
|
+
|
|
135
|
+
1. Select **📦 Download Custom llama.cpp Builds**
|
|
136
|
+
2. Choose **⬇️ Download new build**
|
|
137
|
+
3. Pick a release from the list
|
|
138
|
+
4. Select the asset for your platform
|
|
139
|
+
5. Sit back while it downloads and extracts automatically
|
|
140
|
+
|
|
141
|
+
### Running with Custom Models
|
|
142
|
+
|
|
143
|
+
Point Lemonade Server to your existing model directory (like LM Studio's):
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
? Is there another model directory to use? (example: LM Studio) Yes
|
|
147
|
+
? Enter the model directory path: /home/user/.local/share/lmstudio/models
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
## 🛠️ Configuration
|
|
151
|
+
|
|
152
|
+
Configuration is automatically saved and loaded:
|
|
153
|
+
|
|
154
|
+
- **Location**: `~/.lemonade-launcher/config.json` (Linux/macOS) or `%USERPROFILE%\.lemonade-launcher\config.json` (Windows)
|
|
155
|
+
- **Format**: JSON
|
|
156
|
+
- **Auto-saved**: After every setup or edit
|
|
157
|
+
|
|
158
|
+
### Example Configuration
|
|
159
|
+
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"exposeToNetwork": false,
|
|
163
|
+
"host": "127.0.0.1",
|
|
164
|
+
"port": 8080,
|
|
165
|
+
"logLevel": "info",
|
|
166
|
+
"backend": "auto",
|
|
167
|
+
"modelDir": "None",
|
|
168
|
+
"runMode": "headless",
|
|
169
|
+
"llamacppArgs": "",
|
|
170
|
+
"customLlamacppPath": ""
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## 🌍 Cross-Platform Support
|
|
175
|
+
|
|
176
|
+
### Supported Systems
|
|
177
|
+
|
|
178
|
+
| Platform | Versions | Architecture |
|
|
179
|
+
|----------|----------|--------------|
|
|
180
|
+
| **Windows** | 10, 11 | x64, arm64 |
|
|
181
|
+
| **Linux** | Ubuntu, Debian, CentOS, etc. | x64, arm64, armv7l |
|
|
182
|
+
| **macOS** | 10.15+ (Catalina+) | x64, arm64 (Apple Silicon) |
|
|
183
|
+
|
|
184
|
+
### Automatic Platform Detection
|
|
185
|
+
|
|
186
|
+
Lemonade Launcher automatically:
|
|
187
|
+
- Detects your operating system and architecture
|
|
188
|
+
- Suggests the best matching llama.cpp builds
|
|
189
|
+
- Uses the correct file paths and command syntax
|
|
190
|
+
- Handles platform-specific quirks
|
|
191
|
+
|
|
192
|
+
## 📦 Programmatic Usage
|
|
193
|
+
|
|
194
|
+
Use Lemonade Launcher as a library in your own projects:
|
|
195
|
+
|
|
196
|
+
```javascript
|
|
197
|
+
const {
|
|
198
|
+
fetchAllReleases,
|
|
199
|
+
downloadAndExtractLlamaCpp,
|
|
200
|
+
loadConfig,
|
|
201
|
+
saveConfig
|
|
202
|
+
} = require('./src/index');
|
|
203
|
+
|
|
204
|
+
// Fetch available releases
|
|
205
|
+
const releases = await fetchAllReleases(10);
|
|
206
|
+
|
|
207
|
+
// Download a specific build
|
|
208
|
+
await downloadAndExtractLlamaCpp(asset, version);
|
|
209
|
+
|
|
210
|
+
// Manage configuration
|
|
211
|
+
const config = loadConfig();
|
|
212
|
+
config.port = 9090;
|
|
213
|
+
saveConfig(config);
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
See the [Technical Documentation](TECHNICAL_README.md) for the full API reference.
|
|
217
|
+
|
|
218
|
+
## 🐛 Troubleshooting
|
|
219
|
+
|
|
220
|
+
### Common Issues
|
|
221
|
+
|
|
222
|
+
#### "Command not found" or "npm: command not found"
|
|
223
|
+
**Solution**: Ensure Node.js and npm are installed and in your PATH.
|
|
224
|
+
|
|
225
|
+
#### Permission denied errors (Linux/macOS)
|
|
226
|
+
```bash
|
|
227
|
+
chmod +x index.js
|
|
228
|
+
```
|
|
229
|
+
|
|
230
|
+
#### Permission denied errors (Windows)
|
|
231
|
+
Run Command Prompt or PowerShell as Administrator.
|
|
232
|
+
|
|
233
|
+
#### Build download fails
|
|
234
|
+
- Check your internet connection
|
|
235
|
+
- Ensure you have write permissions to `~/.lemonade-launcher/`
|
|
236
|
+
- Try downloading the asset manually from GitHub
|
|
237
|
+
|
|
238
|
+
#### Server won't start
|
|
239
|
+
- Verify lemonade-server is installed: [lemonade-server.ai](https://lemonade-server.ai)
|
|
240
|
+
- Check that the configuration is correct: `node index.js` → View Configuration
|
|
241
|
+
- Try running with debug logging: Set log level to "debug" in setup
|
|
242
|
+
|
|
243
|
+
### Getting Help
|
|
244
|
+
|
|
245
|
+
1. Check the [Technical Documentation](TECHNICAL_README.md)
|
|
246
|
+
2. Review the [Troubleshooting Guide](TECHNICAL_README.md#troubleshooting)
|
|
247
|
+
3. Open an issue on GitHub
|
|
248
|
+
|
|
249
|
+
## 🤝 Contributing
|
|
250
|
+
|
|
251
|
+
Contributions are welcome! Here's how you can help:
|
|
252
|
+
|
|
253
|
+
1. **Fork** the repository
|
|
254
|
+
2. **Create** a feature branch (`git checkout -b feature/amazing-feature`)
|
|
255
|
+
3. **Make** your changes
|
|
256
|
+
4. **Test** thoroughly on your platform
|
|
257
|
+
5. **Commit** your changes (`git commit -m 'Add amazing feature'`)
|
|
258
|
+
6. **Push** to the branch (`git push origin feature/amazing-feature`)
|
|
259
|
+
7. **Open** a Pull Request
|
|
260
|
+
|
|
261
|
+
### Code of Conduct
|
|
262
|
+
|
|
263
|
+
- Be respectful and inclusive
|
|
264
|
+
- Follow the existing code style
|
|
265
|
+
- Write clear commit messages
|
|
266
|
+
- Document your changes
|
|
267
|
+
|
|
268
|
+
## 📚 Resources
|
|
269
|
+
|
|
270
|
+
- [Technical Documentation](TECHNICAL_README.md) - Architecture, API reference, and development guide
|
|
271
|
+
- [llama.cpp](https://github.com/ggml-org/llama.cpp) - The underlying inference engine
|
|
272
|
+
- [Lemonade Server](https://lemonade-server.ai) - The server being launched
|
|
273
|
+
|
|
274
|
+
## 📄 License
|
|
275
|
+
|
|
276
|
+
This project is licensed under the ISC License. See the [LICENSE](LICENSE) file for details.
|
|
277
|
+
|
|
278
|
+
## 🙏 Acknowledgments
|
|
279
|
+
|
|
280
|
+
- [llama.cpp](https://github.com/ggml-org/llama.cpp) team for the amazing inference engine
|
|
281
|
+
- [Lemonade Server](https://lemonade-server.ai) for the server implementation
|
|
282
|
+
- The Node.js community for the fantastic ecosystem
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
**Made with 🍋 by Nxtmind**
|
|
287
|
+
|
|
288
|
+
*Happy prompting!*
|
package/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Lemonade Launcher - Main Entry Point
|
|
5
|
+
*
|
|
6
|
+
* This file serves as the primary entry point for the CLI tool.
|
|
7
|
+
* All functionality has been refactored into modular components under src/
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
const { runCLI } = require('./src/index');
|
|
11
|
+
|
|
12
|
+
// Run the CLI
|
|
13
|
+
runCLI().catch(err => {
|
|
14
|
+
console.error('Error:', err.message);
|
|
15
|
+
process.exit(1);
|
|
16
|
+
});
|
package/package.json
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "lemonade-interactive-loader",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Interactive CLI tool to launch Lemonade Server with custom arguments and download llama.cpp releases - Cross-platform (Windows/Linux)",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"lemonade-interactive-loader": "./index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"start": "node index.js",
|
|
11
|
+
"dev": "node index.js",
|
|
12
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
13
|
+
},
|
|
14
|
+
"keywords": [
|
|
15
|
+
"llama.cpp",
|
|
16
|
+
"lemonade",
|
|
17
|
+
"llm",
|
|
18
|
+
"cli",
|
|
19
|
+
"cross-platform",
|
|
20
|
+
"windows",
|
|
21
|
+
"linux"
|
|
22
|
+
],
|
|
23
|
+
"author": "",
|
|
24
|
+
"license": "ISC",
|
|
25
|
+
"type": "commonjs",
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=14.0.0"
|
|
28
|
+
},
|
|
29
|
+
"os": [
|
|
30
|
+
"win32",
|
|
31
|
+
"linux",
|
|
32
|
+
"darwin"
|
|
33
|
+
],
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"adm-zip": "^0.5.16",
|
|
36
|
+
"inquirer": "^8.2.6",
|
|
37
|
+
"tar": "^7.5.9",
|
|
38
|
+
"unzipper": "^0.12.3"
|
|
39
|
+
}
|
|
40
|
+
}
|
package/src/README.md
ADDED
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
# Lemonade Launcher - Source Code Structure
|
|
2
|
+
|
|
3
|
+
> **Note:** For comprehensive technical documentation, API references, and development guides, please see the main [TECHNICAL_README.md](../TECHNICAL_README.md) in the project root.
|
|
4
|
+
|
|
5
|
+
This directory contains the modular source code for the Lemonade Launcher CLI tool.
|
|
6
|
+
|
|
7
|
+
## Directory Structure
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
src/
|
|
11
|
+
├── index.js # Main entry point and module exports
|
|
12
|
+
├── config/ # Configuration management
|
|
13
|
+
│ ├── index.js # Config load/save/reset functions
|
|
14
|
+
│ └── constants.js # Application constants and defaults
|
|
15
|
+
├── services/ # Business logic services
|
|
16
|
+
│ ├── github.js # GitHub API interactions
|
|
17
|
+
│ ├── download.js # File download and extraction
|
|
18
|
+
│ ├── asset-manager.js # Installed asset management
|
|
19
|
+
│ └── server.js # Server launch and management
|
|
20
|
+
├── utils/ # Utility functions
|
|
21
|
+
│ └── system.js # System detection and formatting
|
|
22
|
+
└── cli/ # Command-line interface
|
|
23
|
+
├── menu.js # Main menu and command handling
|
|
24
|
+
├── prompts.js # Interactive prompts and selections
|
|
25
|
+
└── setup-wizard.js # Configuration setup wizard
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Module Overview
|
|
29
|
+
|
|
30
|
+
### Config (`config/`)
|
|
31
|
+
- **constants.js**: Centralized configuration for paths, defaults, and constants
|
|
32
|
+
- **index.js**: Configuration persistence (load, save, reset)
|
|
33
|
+
|
|
34
|
+
### Services (`services/`)
|
|
35
|
+
- **github.js**: Fetch releases from llama.cpp GitHub repository
|
|
36
|
+
- **download.js**: Download files and extract archives (zip/tar.gz)
|
|
37
|
+
- **asset-manager.js**: Manage installed llama.cpp builds
|
|
38
|
+
- **server.js**: Launch lemonade-server with configuration
|
|
39
|
+
|
|
40
|
+
### Utils (`utils/`)
|
|
41
|
+
- **system.js**: System detection, byte formatting, asset categorization
|
|
42
|
+
|
|
43
|
+
### CLI (`cli/`)
|
|
44
|
+
- **menu.js**: Main menu system and command routing
|
|
45
|
+
- **prompts.js**: Interactive prompts for release/asset selection
|
|
46
|
+
- **setup-wizard.js**: 8-question setup wizard
|
|
47
|
+
|
|
48
|
+
## Architecture Principles
|
|
49
|
+
|
|
50
|
+
1. **Separation of Concerns**: Each module has a single responsibility
|
|
51
|
+
2. **Dependency Injection**: Modules depend on abstractions, not concretions
|
|
52
|
+
3. **Cross-Platform**: All code works on Windows, Linux, and macOS
|
|
53
|
+
4. **Error Handling**: Proper error handling with informative messages
|
|
54
|
+
5. **Modularity**: Easy to test, maintain, and extend
|
|
55
|
+
|
|
56
|
+
## Usage
|
|
57
|
+
|
|
58
|
+
### As CLI Tool
|
|
59
|
+
```bash
|
|
60
|
+
node index.js
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### As Module
|
|
64
|
+
```javascript
|
|
65
|
+
const {
|
|
66
|
+
loadConfig,
|
|
67
|
+
fetchAllReleases,
|
|
68
|
+
downloadAndExtractLlamaCpp,
|
|
69
|
+
launchLemonadeServer
|
|
70
|
+
} = require('./src/index');
|
|
71
|
+
|
|
72
|
+
// Use exported functions programmatically
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Adding New Features
|
|
76
|
+
|
|
77
|
+
1. Create new module in appropriate directory
|
|
78
|
+
2. Export functions from `src/index.js`
|
|
79
|
+
3. Update documentation
|
|
80
|
+
4. Add tests (when test framework is added)
|
|
81
|
+
|
|
82
|
+
## Code Style
|
|
83
|
+
|
|
84
|
+
- Use ES6+ syntax
|
|
85
|
+
- Async/await for asynchronous operations
|
|
86
|
+
- JSDoc comments for public APIs
|
|
87
|
+
- Consistent error handling patterns
|
|
88
|
+
- Modular and reusable code
|