Skip to content

Commit e0e76d7

Browse files
committed
Updated Docs for Windows Compatibility
1 parent 1611e73 commit e0e76d7

File tree

4 files changed

+195
-40
lines changed

4 files changed

+195
-40
lines changed

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,30 @@ graph TD
4444

4545
## 📦 Installation & Setup
4646

47-
### 1. Install Required Packages
47+
### Windows Setup
48+
1. **Install Required Build Tools**
49+
- Install [Microsoft C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/)
50+
- Select "Desktop development with C++"
51+
- Install [CMake](https://cmake.org/download/)
52+
- Add to PATH during installation
53+
54+
2. **Install Packages**
55+
```powershell
56+
pip install locallab locallab-client
57+
```
58+
59+
3. **Verify PATH**
60+
- If `locallab` command isn't found, add Python Scripts to PATH:
61+
```powershell
62+
# Find Python location
63+
where python
64+
# Add Scripts folder to PATH (e.g., C:\Users\YOU\AppData\Local\Programs\Python\Python311\Scripts\)
65+
```
66+
- Or use: `python -m locallab start`
67+
68+
> 🔍 Having issues? See our [Windows Troubleshooting Guide](./docs/guides/troubleshooting.md#windows-specific-issues)
4869
70+
### Linux/Mac Setup
4971
```bash
5072
# Install both server and client packages
5173
pip install locallab locallab-client

docs/guides/getting-started.md

Lines changed: 83 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,48 @@ This guide will help you start using LocalLab, whether you're new to AI or an ex
1010
- GPU optional but recommended
1111
- Internet connection for downloading models
1212

13+
#### Additional Requirements for Windows
14+
- Microsoft C++ Build Tools (for some dependencies)
15+
- CMake (for model compilation)
16+
- Python added to PATH
17+
1318
### For Google Colab
1419
- Just a Google account!
1520
- Internet connection
1621

1722
## 🚀 Step-by-Step Setup
1823

19-
### Step 1: Install Required Packages
24+
### Windows Setup
25+
26+
1. **Install Required Build Tools**
27+
```powershell
28+
# First, install Microsoft C++ Build Tools
29+
# Download from: https://visualstudio.microsoft.com/visual-cpp-build-tools/
30+
# Select "Desktop development with C++"
31+
32+
# Then install CMake
33+
# Download from: https://cmake.org/download/
34+
# Make sure to add to PATH during installation
35+
```
36+
37+
2. **Install Python Packages**
38+
```powershell
39+
# Install the server package
40+
pip install locallab
41+
42+
# Install the client package
43+
pip install locallab-client
44+
```
45+
46+
3. **Add to PATH (if needed)**
47+
- Find your Python Scripts directory:
48+
```powershell
49+
where python
50+
```
51+
- Add the Scripts folder to PATH (e.g., `C:\Users\YOU\AppData\Local\Programs\Python\Python311\Scripts\`)
52+
- Restart your terminal
2053
21-
First, you need to install both the server and client packages:
54+
### Linux/Mac Setup
2255
2356
```bash
2457
# Install the server package
@@ -28,25 +61,64 @@ pip install locallab
2861
pip install locallab-client
2962
```
3063

31-
### Step 2: Start the Server
64+
### Configure LocalLab (Required First Step)
3265

33-
You have two options:
66+
Before starting the server, you should configure LocalLab. You have two options:
3467

35-
#### Option A: Using Command Line (Recommended for Beginners)
68+
#### Option A: Using CLI (Recommended)
3669
```bash
37-
# Start with interactive setup
70+
# Run the configuration wizard
71+
locallab config
72+
```
73+
74+
This will help you configure:
75+
- Model selection
76+
- Memory optimizations
77+
- GPU settings
78+
- System resources
79+
80+
#### Option B: Using Python Code
81+
```python
82+
from locallab.cli.config import set_config_value, save_config
83+
from locallab.cli.interactive import prompt_for_config
84+
85+
# Method 1: Interactive Configuration
86+
config = prompt_for_config()
87+
save_config(config)
88+
89+
# Method 2: Direct Configuration
90+
set_config_value("model_id", "microsoft/phi-2")
91+
set_config_value("enable_quantization", True)
92+
set_config_value("quantization_type", "int8")
93+
set_config_value("enable_attention_slicing", True)
94+
```
95+
96+
### Start the Server
97+
98+
After configuring, you can start the server:
99+
100+
#### Option A: Using Command Line
101+
```bash
102+
# Start with saved configuration
38103
locallab start
104+
105+
# Or start with specific options
106+
locallab start --model microsoft/phi-2 --quantize --quantize-type int8
39107
```
40-
This will:
41-
- Guide you through setup
42-
- Help choose a model
43-
- Configure optimizations
44-
- Start the server
45108

46109
#### Option B: Using Python Code
47110
```python
48111
from locallab import start_server
112+
113+
# Start with saved configuration
49114
start_server()
115+
116+
# Or start with specific options
117+
start_server(
118+
model_id="microsoft/phi-2",
119+
enable_quantization=True,
120+
quantization_type="int8"
121+
)
50122
```
51123

52124
### Step 3: Connect with a Client

docs/guides/troubleshooting.md

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

33
## 🔍 Common Issues for Beginners
44

5+
### Windows-Specific Issues
6+
7+
#### 'locallab' Command Not Found
8+
**Problem:** After installation, the `locallab` command isn't recognized
9+
```
10+
'locallab' is not recognized as an internal or external command
11+
```
12+
**Solution:**
13+
1. Check if Python's Scripts directory is in PATH:
14+
```cmd
15+
where python
16+
```
17+
2. Add Python Scripts to PATH:
18+
- Find your Python install location (e.g., `C:\Users\YOU\AppData\Local\Programs\Python\Python311\`)
19+
- Add `Scripts` folder to PATH: `C:\Users\YOU\AppData\Local\Programs\Python\Python311\Scripts\`
20+
- Restart your terminal
21+
22+
Alternative: Use the module directly:
23+
```cmd
24+
python -m locallab start
25+
```
26+
27+
#### Compiler/Build Tools Missing
28+
**Problem:** Installation fails with errors about missing compiler or CMake
29+
```
30+
error: Microsoft Visual C++ 14.0 or greater is required
31+
```
32+
or
33+
```
34+
'nmake' is not recognized
35+
CMAKE_C_COMPILER not set
36+
```
37+
**Solution:**
38+
1. Install Build Tools:
39+
- Download [Microsoft C++ Build Tools](https://visualstudio.microsoft.com/visual-cpp-build-tools/)
40+
- During installation, select "Desktop development with C++"
41+
2. Install CMake:
42+
- Download from [cmake.org](https://cmake.org/download/)
43+
- Add to PATH during installation
44+
3. Restart your terminal and try installation again:
45+
```cmd
46+
pip install locallab --no-cache-dir
47+
```
48+
549
### Installation Issues
650

751
**Problem:** `pip install` fails

setup.py

Lines changed: 45 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,55 @@
11
from setuptools import setup, find_packages
2+
import platform
23

34
with open("README.md", "r", encoding="utf-8") as fh:
45
long_description = fh.read()
56

6-
setup(
7-
name="locallab",
8-
version="0.5.1",
9-
packages=find_packages(include=["locallab", "locallab.*"]),
10-
install_requires=[
11-
"fastapi>=0.95.0,<1.0.0",
12-
"uvicorn>=0.21.1,<1.0.0",
13-
"pydantic>=2.0.0,<3.0.0",
14-
"python-dotenv>=0.21.0,<1.0.0",
15-
"python-multipart>=0.0.5",
16-
"dataclasses-json>=0.5.7,<1.0.0",
17-
"torch>=2.0.0,<3.0.0",
18-
"transformers>=4.28.1,<5.0.0",
19-
"accelerate>=0.18.0,<1.0.0",
7+
# Base requirements
8+
install_requires = [
9+
"fastapi>=0.95.0,<1.0.0",
10+
"uvicorn>=0.21.1,<1.0.0",
11+
"pydantic>=2.0.0,<3.0.0",
12+
"python-dotenv>=0.21.0,<1.0.0",
13+
"python-multipart>=0.0.5",
14+
"dataclasses-json>=0.5.7,<1.0.0",
15+
"torch>=2.0.0,<3.0.0",
16+
"transformers>=4.28.1,<5.0.0",
17+
"accelerate>=0.18.0,<1.0.0",
18+
"click>=8.1.3,<9.0.0",
19+
"rich>=13.3.4,<14.0.0",
20+
"pyngrok>=6.0.0,<7.0.0",
21+
"requests>=2.28.2,<3.0.0",
22+
"httpx>=0.24.0",
23+
"colorama>=0.4.4",
24+
"websockets>=10.0",
25+
"psutil>=5.8.0",
26+
"nest-asyncio>=1.5.1",
27+
"fastapi-cache2>=0.2.1",
28+
"huggingface_hub>=0.16.0",
29+
"typing_extensions>=4.0.0",
30+
"questionary>=1.10.0",
31+
]
32+
33+
# Platform-specific dependencies
34+
if platform.system() == "Windows":
35+
install_requires.extend([
36+
"bitsandbytes-windows>=0.37.2",
37+
"llama-cpp-python>=0.1.77",
38+
])
39+
else:
40+
install_requires.extend([
2041
"bitsandbytes>=0.38.0,<1.0.0",
2142
"llama-cpp-python>=0.1.74,<1.0.0",
22-
"click>=8.1.3,<9.0.0",
23-
"rich>=13.3.4,<14.0.0",
24-
"pyngrok>=6.0.0,<7.0.0",
25-
"requests>=2.28.2,<3.0.0",
2643
"netifaces>=0.11.0",
27-
"httpx>=0.24.0",
28-
"colorama>=0.4.4",
29-
"websockets>=10.0",
30-
"psutil>=5.8.0",
31-
"nest-asyncio>=1.5.1",
32-
"fastapi-cache2>=0.2.1",
3344
"nvidia-ml-py3>=7.352.0",
34-
"huggingface_hub>=0.16.0",
3545
"pynvml>=11.0.0",
36-
"typing_extensions>=4.0.0",
37-
"questionary>=1.10.0",
38-
],
46+
])
47+
48+
setup(
49+
name="locallab",
50+
version="0.5.1",
51+
packages=find_packages(include=["locallab", "locallab.*"]),
52+
install_requires=install_requires,
3953
extras_require={
4054
"dev": [
4155
"pytest>=7.0.0",
@@ -57,6 +71,9 @@
5771
"Programming Language :: Python :: 3.9",
5872
"Programming Language :: Python :: 3.10",
5973
"Programming Language :: Python :: 3.11",
74+
"Operating System :: Microsoft :: Windows",
75+
"Operating System :: POSIX :: Linux",
76+
"Operating System :: MacOS",
6077
],
6178
python_requires=">=3.9",
6279
entry_points={

0 commit comments

Comments
 (0)