Skip to content

Commit e01d9fb

Browse files
committed
Updated package v4.9 and updated Docs
1 parent f9832fa commit e01d9fb

File tree

10 files changed

+509
-164
lines changed

10 files changed

+509
-164
lines changed

CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,34 @@
22

33
All notable changes to LocalLab will be documented in this file.
44

5+
## 0.4.9 - 2025-03-11
6+
7+
### Fixed
8+
9+
- Fixed critical issue with `locallab config` command not being respected when running `locallab start`
10+
- Enhanced configuration system to properly load and apply saved settings
11+
- Improved user experience by showing current configuration before prompting for changes
12+
- Added clear feedback when configuration is saved and how to use it
13+
14+
## 0.4.8 - 2025-03-10
15+
16+
### Fixed
17+
18+
- Fixed critical server startup error related to missing 'lifespan' attribute in ServerWithCallback class
19+
- Fixed KeyError in 'locallab info' command by properly handling RAM information
20+
- Significantly improved CLI startup speed through lazy loading of imports
21+
- Enhanced error handling in system information display
22+
- Fixed environment variable conflicts between CLI configuration and OS environment variables
23+
- Improved configuration system to properly handle both CLI and environment variable settings
24+
- Optimized server startup process for faster response time
25+
26+
### Changed
27+
28+
- Reduced unnecessary operations during CLI startup for better performance
29+
- Improved memory usage reporting with proper unit conversion (GB instead of MB)
30+
- Enhanced ServerWithCallback class with proper lifespan initialization
31+
- Updated configuration system to use a unified approach for all settings
32+
533
## 0.4.7 - 2025-03-08
634

735
### Added

README.md

Lines changed: 56 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,13 @@
77

88
LocalLab empowers users to run any Hugging Face AI model locally or on Google Colab with minimal setup required. It automatically configures an API using ngrok, enabling seamless integration into applications from any location. Designed for simplicity, LocalLab makes advanced AI accessible to all, regardless of technical expertise. With built-in model management, performance optimizations, and system monitoring, it ensures efficient and reliable AI operations for developers, researchers, and enthusiasts alike.
99

10+
## What's New in v0.4.9
11+
12+
- **🔧 Fixed Configuration System**: The `locallab config` command now properly saves settings that are respected when running `locallab start`
13+
- **📋 Configuration Display**: The CLI now shows your current configuration before prompting for changes
14+
- **⏩ Skip Unnecessary Prompts**: Only prompts for settings that aren't already configured
15+
- **✅ Clear Feedback**: After saving configuration, the CLI shows what was saved and how to use it
16+
1017
## What Problem Does LocalLab Solve?
1118

1219
- **Local Inference:** Run advanced language models without relying on expensive cloud services.
@@ -38,12 +45,14 @@ LocalLab empowers users to run any Hugging Face AI model locally or on Google Co
3845

3946
## Key Features
4047

48+
- **Interactive CLI:** Configure and run your server with an intuitive command-line interface that adapts to your environment.
4149
- **Multiple Model Support:** Pre-configured models along with the ability to load custom ones on demand.
4250
- **Advanced Optimizations:** Support for FP16, INT8, and INT4 quantization, Flash Attention, and attention slicing.
4351
- **Comprehensive Logging System:** Colorized console output with server status tracking, request monitoring, and performance metrics.
4452
- **Robust Resource Monitoring:** Real-time insights into system performance and resource usage.
4553
- **Flexible Client Libraries:** Comprehensive clients available for both Python and Node.js.
4654
- **Google Colab Friendly:** Dedicated workflow for deploying via Google Colab with public URL access.
55+
- **Persistent Configuration:** Save your settings for future use with the new configuration system.
4756

4857
## Unique Visual Overview
4958

@@ -77,6 +86,7 @@ sequenceDiagram
7786
For full documentation and detailed guides, please visit our [documentation page](https://github.com/Developer-Utkarsh/LocalLab/blob/main/docs/README.md).
7887

7988
- [Getting Started Guide](https://github.com/Developer-Utkarsh/LocalLab/blob/main/docs/guides/getting-started.md)
89+
- [CLI Guide](https://github.com/Developer-Utkarsh/LocalLab/blob/main/docs/guides/cli.md)
8090
- [Python Client](https://github.com/Developer-Utkarsh/LocalLab/blob/main/docs/clients/python/README.md)
8191
- [Node.js Client](https://github.com/Developer-Utkarsh/LocalLab/blob/main/docs/clients/nodejs/README.md)
8292
- [Client Comparison](https://github.com/Developer-Utkarsh/LocalLab/blob/main/docs/clients/comparison.md)
@@ -91,14 +101,30 @@ For full documentation and detailed guides, please visit our [documentation page
91101
pip install locallab
92102
```
93103

94-
2. **Starting the Server Locally:**
104+
2. **Using the CLI (New!):**
105+
106+
```bash
107+
# Start the server with interactive configuration
108+
locallab start
109+
110+
# Start with specific options
111+
locallab start --model microsoft/phi-2 --quantize --quantize-type int8
112+
113+
# Run the configuration wizard without starting the server
114+
locallab config
115+
116+
# Display system information
117+
locallab info
118+
```
119+
120+
3. **Starting the Server Programmatically:**
95121

96122
```python
97123
from locallab import start_server
98124
start_server()
99125
```
100126

101-
3. **Starting the Server on Google Colab:**
127+
4. **Starting the Server on Google Colab:**
102128

103129
```python
104130
!pip install locallab
@@ -117,7 +143,7 @@ For full documentation and detailed guides, please visit our [documentation page
117143
start_server(use_ngrok=True) # Creates a public URL accessible from anywhere
118144
```
119145

120-
4. **Connecting your Client:**
146+
5. **Connecting your Client:**
121147

122148
```python
123149
from locallab.client import LocalLabClient
@@ -130,6 +156,33 @@ For full documentation and detailed guides, please visit our [documentation page
130156
print(response)
131157
```
132158

159+
## CLI Features (New in v0.4.8!)
160+
161+
LocalLab now includes a powerful command-line interface with the following features:
162+
163+
- **Interactive Configuration:** Guided setup for all server settings
164+
- **Environment Detection:** Smart defaults based on your system
165+
- **Persistent Settings:** Configuration stored in `~/.locallab/config.json`
166+
- **System Information:** Detailed insights about your hardware
167+
- **Performance Optimizations:** Easy configuration of quantization and other optimizations
168+
- **Google Colab Integration:** Automatic detection and configuration for Colab environments
169+
170+
Example CLI usage:
171+
172+
```bash
173+
# Start with interactive prompts
174+
locallab start
175+
176+
# Configure with specific options
177+
locallab start --model microsoft/phi-2 --port 8080 --quantize --attention-slicing
178+
179+
# Run configuration wizard
180+
locallab config
181+
182+
# Check system resources
183+
locallab info
184+
```
185+
133186
## Join the Community
134187

135188
- Report issues on our [GitHub Issues](https://github.com/Developer-Utkarsh/LocalLab/issues).

docs/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,29 @@ Welcome to the LocalLab documentation! This guide is your one-stop resource for
66

77
LocalLab empowers you to run AI inference servers either locally or through Google Colab. With advanced model management, performance optimizations, and robust system monitoring, LocalLab is built to deliver efficient, on-demand AI capabilities.
88

9+
## What's New in v0.4.9
10+
11+
Our latest release brings significant improvements to the configuration system:
12+
13+
- **🔧 Fixed Configuration Persistence**: The `locallab config` command now properly saves settings that are respected when running `locallab start`
14+
- **📋 Configuration Display**: The CLI now shows your current configuration before prompting for changes
15+
- **⏩ Skip Unnecessary Prompts**: Only prompts for settings that aren't already configured
16+
- **✅ Clear Feedback**: After saving configuration, the CLI shows what was saved and how to use it
17+
18+
[Read the full changelog](../CHANGELOG.md) for more details.
19+
20+
## What's New in v0.4.8
21+
22+
Our previous release brought significant improvements to the LocalLab CLI:
23+
24+
- **⚡ Lightning-Fast Startup**: Optimized for quick response time with lazy loading
25+
- **🛡️ Robust Error Handling**: Better diagnostics and recovery from common issues
26+
- **🔄 Unified Configuration**: Seamless integration between CLI options and environment variables
27+
- **📊 Enhanced System Information**: Improved hardware reporting with the `locallab info` command
28+
- **🔧 Fixed Critical Issues**: Resolved server startup errors and configuration conflicts
29+
30+
[Read the full changelog](../CHANGELOG.md) for more details.
31+
932
## Visual Overview
1033

1134
### Architecture Diagram

docs/guides/cli.md

Lines changed: 105 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ LocalLab provides a powerful command-line interface (CLI) that makes it easy to
1111
5. [Environment Variables](#environment-variables)
1212
6. [Configuration Storage](#configuration-storage)
1313
7. [Google Colab Integration](#google-colab-integration)
14+
8. [New in v0.4.9](#new-in-v049)
15+
9. [New in v0.4.8](#new-in-v048)
1416

1517
## Installation
1618

@@ -85,7 +87,7 @@ Example interactive session:
8587
8688
🔧 Would you like to configure advanced options? [y/N]:
8789
88-
✅ Configuration complete! Starting server...
90+
✅ Configuration complete!
8991
```
9092

9193
## Command Reference
@@ -114,14 +116,29 @@ locallab start --model microsoft/phi-2 --quantize --quantize-type int8
114116

115117
### `locallab config`
116118

117-
Run the configuration wizard without starting the server.
119+
Run the configuration wizard without starting the server. This command now shows your current configuration and allows you to modify it.
118120

119121
Example:
120122

121123
```bash
122124
locallab config
123125
```
124126

127+
Output:
128+
129+
```
130+
📋 Current Configuration:
131+
port: 8000
132+
model_id: microsoft/phi-2
133+
enable_quantization: true
134+
quantization_type: int8
135+
enable_attention_slicing: true
136+
enable_flash_attention: false
137+
enable_better_transformer: false
138+
139+
Would you like to reconfigure these settings? [Y/n]:
140+
```
141+
125142
### `locallab info`
126143

127144
Display system information.
@@ -179,6 +196,92 @@ start_server(use_ngrok=True, port=8080)
179196

180197
The CLI will detect that it's running in Colab and prompt for any missing required settings, such as the ngrok authentication token if `use_ngrok=True` is specified.
181198

199+
## New in v0.4.9
200+
201+
Version 0.4.9 brings significant improvements to the configuration system:
202+
203+
### 🔄 Persistent Configuration That Works
204+
205+
- **Fixed Configuration Persistence**: The `locallab config` command now properly saves settings that are respected when running `locallab start`
206+
- **Configuration Display**: The `config` command now shows your current configuration before prompting for changes
207+
- **Skip Unnecessary Prompts**: The CLI now only prompts for settings that aren't already configured
208+
- **Clear Feedback**: After saving configuration, the CLI shows what was saved and how to use it
209+
210+
### 🛠️ Improved Configuration Workflow
211+
212+
```bash
213+
# Step 1: Configure your settings once
214+
locallab config
215+
216+
# Step 2: Start the server using your saved configuration
217+
locallab start
218+
```
219+
220+
With this improved workflow, you only need to configure your settings once, and they'll be remembered for future sessions.
221+
222+
### Example Configuration Session
223+
224+
```
225+
$ locallab config
226+
227+
📋 Current Configuration:
228+
port: 8000
229+
model_id: microsoft/phi-2
230+
enable_quantization: true
231+
quantization_type: int8
232+
enable_attention_slicing: true
233+
234+
Would you like to reconfigure these settings? [Y/n]: n
235+
Configuration unchanged.
236+
237+
$ locallab start
238+
🎮 GPU detected with 8192MB free of 16384MB total
239+
💾 System memory: 12288MB free of 16384MB total
240+
241+
✅ Using saved configuration!
242+
```
243+
244+
## New in v0.4.8
245+
246+
Version 0.4.8 brings significant improvements to the CLI:
247+
248+
### ⚡ Lightning-Fast Startup
249+
250+
- **Lazy Loading**: The CLI now uses lazy loading for imports, resulting in much faster startup times
251+
- **Optimized Initialization**: Reduced unnecessary operations during CLI startup
252+
- **Faster Response**: Commands like `locallab info` now respond almost instantly
253+
254+
### 🛡️ Improved Error Handling
255+
256+
- **Robust Error Recovery**: Better handling of common errors like missing dependencies
257+
- **Informative Messages**: More helpful error messages that guide you to solutions
258+
- **Graceful Fallbacks**: The CLI now gracefully handles missing or invalid configuration values
259+
260+
### 🔄 Unified Configuration System
261+
262+
- **Seamless Integration**: CLI options, environment variables, and configuration files now work together harmoniously
263+
- **Consistent Behavior**: No more conflicts between different ways of setting configuration values
264+
- **Clear Precedence**: Environment variables take precedence over saved configuration, which takes precedence over defaults
265+
266+
### 📊 Enhanced System Information
267+
268+
- **Detailed Hardware Info**: The `locallab info` command now provides more detailed information about your system
269+
- **Better Memory Reporting**: Improved memory usage reporting with proper unit conversion (GB instead of MB)
270+
- **GPU Details**: More comprehensive GPU information when available
271+
272+
### Example Usage
273+
274+
```bash
275+
# Start with interactive configuration - now much faster!
276+
locallab start
277+
278+
# Use the improved system information command
279+
locallab info
280+
281+
# Configure with specific options - now with better error handling
282+
locallab start --model microsoft/phi-2 --quantize --quantize-type int8 --attention-slicing
283+
```
284+
182285
## Using the CLI in Python Code
183286

184287
You can also use the CLI functionality directly in your Python code:

docs/guides/getting-started.md

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,20 @@ This guide will help you start using LocalLab, whether you're running it locally
1414

1515
2. **Start the Server**
1616

17-
**Using Command Line (New!)**
17+
**Using Command Line (Improved in v0.4.8!)**
1818

1919
```bash
20-
# Interactive setup wizard
20+
# Interactive setup wizard - now with faster startup and better error handling
2121
locallab start
2222

2323
# Or with specific options
24-
locallab start --model microsoft/phi-2 --quantize
24+
locallab start --model microsoft/phi-2 --quantize --quantize-type int8 --attention-slicing
25+
26+
# Run the configuration wizard without starting the server
27+
locallab config
28+
29+
# Check your system resources
30+
locallab info
2531
```
2632

2733
**Using Python**
@@ -54,11 +60,12 @@ This guide will help you start using LocalLab, whether you're running it locally
5460

5561
3. **Start Server**
5662

57-
**Using Interactive Setup (New!)**
63+
**Using Interactive Setup (Enhanced in v0.4.8!)**
5864

5965
```python
6066
from locallab import start_server
6167
# This will prompt for any missing settings, including ngrok token
68+
# Now with improved error handling and faster startup
6269
start_server(use_ngrok=True)
6370
```
6471

@@ -75,6 +82,32 @@ This guide will help you start using LocalLab, whether you're running it locally
7582
client = LocalLabClient("https://xxxx-xx-xx-xxx-xx.ngrok-free.app") # Use URL from logs
7683
```
7784

85+
## CLI Features (New & Improved in v0.4.8)
86+
87+
LocalLab's command-line interface has been significantly enhanced with:
88+
89+
- **Lightning-Fast Startup**: Optimized for quick response time
90+
- **Robust Error Handling**: Better diagnostics and recovery from common issues
91+
- **Unified Configuration System**: Seamlessly integrates CLI options with environment variables
92+
- **Persistent Settings**: Your configuration is saved in `~/.locallab/config.json`
93+
- **System Information Command**: Get detailed insights about your hardware with `locallab info`
94+
95+
```bash
96+
# Examples of CLI usage
97+
98+
# Start with interactive configuration
99+
locallab start
100+
101+
# Start with specific model and optimizations
102+
locallab start --model microsoft/phi-2 --quantize --quantize-type int8
103+
104+
# Configure without starting
105+
locallab config
106+
107+
# Check system resources
108+
locallab info
109+
```
110+
78111
## First Steps
79112

80113
### 1. Generate Text

0 commit comments

Comments
 (0)