studiolink 0.1.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.
- studiolink-0.1.0/LICENSE +21 -0
- studiolink-0.1.0/PKG-INFO +272 -0
- studiolink-0.1.0/README.md +231 -0
- studiolink-0.1.0/pyproject.toml +37 -0
- studiolink-0.1.0/setup.cfg +4 -0
- studiolink-0.1.0/src/studiolink/__init__.py +5 -0
- studiolink-0.1.0/src/studiolink/__main__.py +6 -0
- studiolink-0.1.0/src/studiolink/cli.py +337 -0
- studiolink-0.1.0/src/studiolink/config.py +55 -0
- studiolink-0.1.0/src/studiolink/lmstudio_adapter.py +109 -0
- studiolink-0.1.0/src/studiolink/models.py +161 -0
- studiolink-0.1.0/src/studiolink/ollama_adapter.py +160 -0
- studiolink-0.1.0/src/studiolink/ports.py +19 -0
- studiolink-0.1.0/src/studiolink/service.py +246 -0
- studiolink-0.1.0/src/studiolink/state.py +68 -0
- studiolink-0.1.0/src/studiolink/syncer.py +188 -0
- studiolink-0.1.0/src/studiolink.egg-info/PKG-INFO +272 -0
- studiolink-0.1.0/src/studiolink.egg-info/SOURCES.txt +19 -0
- studiolink-0.1.0/src/studiolink.egg-info/dependency_links.txt +1 -0
- studiolink-0.1.0/src/studiolink.egg-info/entry_points.txt +2 -0
- studiolink-0.1.0/src/studiolink.egg-info/top_level.txt +1 -0
studiolink-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nerve
|
|
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.
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: studiolink
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Sync Ollama-downloaded GGUF models into LM Studio.
|
|
5
|
+
Author: StudioLink contributors
|
|
6
|
+
License: MIT License
|
|
7
|
+
|
|
8
|
+
Copyright (c) 2026 Nerve
|
|
9
|
+
|
|
10
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
11
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
12
|
+
in the Software without restriction, including without limitation the rights
|
|
13
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
14
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
15
|
+
furnished to do so, subject to the following conditions:
|
|
16
|
+
|
|
17
|
+
The above copyright notice and this permission notice shall be included in all
|
|
18
|
+
copies or substantial portions of the Software.
|
|
19
|
+
|
|
20
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
21
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
22
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
23
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
24
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
25
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
26
|
+
SOFTWARE.
|
|
27
|
+
|
|
28
|
+
Project-URL: Homepage, https://github.com/MananJK/StudioLink
|
|
29
|
+
Project-URL: Repository, https://github.com/MananJK/StudioLink
|
|
30
|
+
Keywords: ollama,lm-studio,gguf,cli,sync
|
|
31
|
+
Classifier: Development Status :: 3 - Alpha
|
|
32
|
+
Classifier: Environment :: Console
|
|
33
|
+
Classifier: Intended Audience :: End Users/Desktop
|
|
34
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
35
|
+
Classifier: Programming Language :: Python :: 3
|
|
36
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
37
|
+
Requires-Python: >=3.12
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
License-File: LICENSE
|
|
40
|
+
Dynamic: license-file
|
|
41
|
+
|
|
42
|
+
# StudioLink
|
|
43
|
+
|
|
44
|
+
**Sync Ollama-downloaded GGUF models into LM Studio.**
|
|
45
|
+
|
|
46
|
+
StudioLink is a Python CLI tool that bridges Ollama and LM Studio. It treats Ollama as the source of truth, discovers GGUF-backed models from Ollama manifests, and imports them into LM Studio via the `lms` CLIโusing hard links by default to save disk space.
|
|
47
|
+
|
|
48
|
+
## Features
|
|
49
|
+
|
|
50
|
+
- ๐ **Scan** - Discover all GGUF models available in your Ollama library
|
|
51
|
+
- ๐ **Sync** - Import models into LM Studio with one command
|
|
52
|
+
- ๐ **Status** - Track which models are synced and their current state
|
|
53
|
+
- ๐ฉบ **Doctor** - Verify prerequisites and diagnose issues
|
|
54
|
+
- ๐ **Smart linking** - Uses hard links by default, falls back to copy when needed
|
|
55
|
+
- ๐พ **State tracking** - Remembers what's been synced to avoid re-importing
|
|
56
|
+
|
|
57
|
+
## Prerequisites
|
|
58
|
+
|
|
59
|
+
Before using StudioLink, ensure you have:
|
|
60
|
+
|
|
61
|
+
1. **Ollama** installed and available at `~/.ollama/models/`
|
|
62
|
+
2. **LM Studio** with the `lms` CLI installed at `~/.lmstudio/bin/lms.exe`
|
|
63
|
+
3. **Python 3.12+**
|
|
64
|
+
|
|
65
|
+
## Installation
|
|
66
|
+
|
|
67
|
+
> **PyPI install coming soon!** For now, install from source:
|
|
68
|
+
|
|
69
|
+
```powershell
|
|
70
|
+
# Clone the repository
|
|
71
|
+
git clone https://github.com/MananJK/StudioLink.git
|
|
72
|
+
cd StudioLink
|
|
73
|
+
|
|
74
|
+
# Install in editable mode
|
|
75
|
+
pip install -e .
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Quick Start
|
|
79
|
+
|
|
80
|
+
```powershell
|
|
81
|
+
# Scan for available models
|
|
82
|
+
sdl scan
|
|
83
|
+
|
|
84
|
+
# Import a specific model
|
|
85
|
+
sdl sync <modelname>
|
|
86
|
+
|
|
87
|
+
# Import all discovered models
|
|
88
|
+
sdl sync --all
|
|
89
|
+
|
|
90
|
+
# Check sync status
|
|
91
|
+
sdl status
|
|
92
|
+
|
|
93
|
+
# Verify everything is set up correctly
|
|
94
|
+
sdl doctor
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Commands
|
|
98
|
+
|
|
99
|
+
### `sdl scan`
|
|
100
|
+
Discover all GGUF-backed Ollama models available for import.
|
|
101
|
+
|
|
102
|
+
```powershell
|
|
103
|
+
# Basic scan
|
|
104
|
+
sdl scan
|
|
105
|
+
|
|
106
|
+
# Output as JSON
|
|
107
|
+
sdl scan --json
|
|
108
|
+
|
|
109
|
+
# Verbose output (debug logging)
|
|
110
|
+
sdl -v scan
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
**Output:**
|
|
114
|
+
```
|
|
115
|
+
Discovered 3 model(s):
|
|
116
|
+
- <modelname> [ready]
|
|
117
|
+
blob: C:\Users\...\ollama\models\blobs\sha256-...
|
|
118
|
+
- <modelname2> [stale]
|
|
119
|
+
blob: C:\Users\...\ollama\models\blobs\sha256-...
|
|
120
|
+
issues: model blob is missing from the Ollama blob store
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### `sdl sync`
|
|
124
|
+
Import one or more models into LM Studio.
|
|
125
|
+
|
|
126
|
+
```powershell
|
|
127
|
+
# Import specific model(s)
|
|
128
|
+
sdl sync <modelname>
|
|
129
|
+
sdl sync <model1> <model2> <model3>
|
|
130
|
+
|
|
131
|
+
# Import all discovered models
|
|
132
|
+
sdl sync --all
|
|
133
|
+
|
|
134
|
+
# Preview without making changes (dry run)
|
|
135
|
+
sdl sync <modelname> --dry-run
|
|
136
|
+
|
|
137
|
+
# Use a specific link mode
|
|
138
|
+
sdl sync <modelname> --hard-link
|
|
139
|
+
sdl sync <modelname> --copy
|
|
140
|
+
sdl sync <modelname> --symbolic-link
|
|
141
|
+
|
|
142
|
+
# Verbose output
|
|
143
|
+
sdl -v sync --all
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
**Options:**
|
|
147
|
+
- `--all` - Sync every discovered model
|
|
148
|
+
- `--dry-run` - Preview the import without making changes
|
|
149
|
+
- `--copy` - Use copy mode instead of hard links
|
|
150
|
+
- `--hard-link` - Force hard link mode (default)
|
|
151
|
+
- `--symbolic-link` - Use symbolic links
|
|
152
|
+
|
|
153
|
+
### `sdl status`
|
|
154
|
+
Show discovered models and their sync state.
|
|
155
|
+
|
|
156
|
+
```powershell
|
|
157
|
+
sdl status
|
|
158
|
+
sdl status --json
|
|
159
|
+
sdl -v status
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
**Output:**
|
|
163
|
+
```
|
|
164
|
+
Discovered 3 model(s); 1 tracked as synced.
|
|
165
|
+
- <modelname>: synced
|
|
166
|
+
imported: 2026-04-12T10:30:00+00:00
|
|
167
|
+
- <modelname2>: stale
|
|
168
|
+
issues: model blob is missing from the Ollama blob store
|
|
169
|
+
- <modelname3>: pending
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### `sdl doctor`
|
|
173
|
+
Check local StudioLink prerequisites and diagnose issues.
|
|
174
|
+
|
|
175
|
+
```powershell
|
|
176
|
+
sdl doctor
|
|
177
|
+
sdl doctor --json
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
**Checks include:**
|
|
181
|
+
- Ollama executable exists
|
|
182
|
+
- LM Studio CLI (`lms`) exists
|
|
183
|
+
- Ollama manifests and blobs directories exist
|
|
184
|
+
- LM Studio models directory exists
|
|
185
|
+
- Hard-link volume compatibility (same drive)
|
|
186
|
+
- Discovered Ollama models
|
|
187
|
+
- Blob presence validation
|
|
188
|
+
- GGUF header validation
|
|
189
|
+
|
|
190
|
+
### `sdl help`
|
|
191
|
+
Show all available commands and their descriptions.
|
|
192
|
+
|
|
193
|
+
```powershell
|
|
194
|
+
sdl help
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Global Options
|
|
198
|
+
|
|
199
|
+
All commands support these global options:
|
|
200
|
+
|
|
201
|
+
- `-v, --verbose` - Enable verbose output (debug logging)
|
|
202
|
+
- `--version` - Show version information
|
|
203
|
+
- `--help` - Show help for the specific command
|
|
204
|
+
|
|
205
|
+
```powershell
|
|
206
|
+
# Examples
|
|
207
|
+
sdl -v scan # Scan with debug logging
|
|
208
|
+
sdl sync --help # Show help for sync command
|
|
209
|
+
sdl --version # Show version
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## Model Readiness States
|
|
213
|
+
|
|
214
|
+
When scanning or checking status, models can have these states:
|
|
215
|
+
|
|
216
|
+
| State | Description | Action Required |
|
|
217
|
+
|-------|-------------|-----------------|
|
|
218
|
+
| **ready** | Model blob exists and has valid GGUF header | Ready to sync |
|
|
219
|
+
| **stale** | Manifest exists but blob is missing | Run `ollama pull <model>` to restore |
|
|
220
|
+
| **invalid** | Blob exists but missing GGUF magic bytes | Model may be corrupted |
|
|
221
|
+
| **synced** | Already imported into LM Studio | No action needed |
|
|
222
|
+
| **pending** | Ready but not yet synced | Run `sdl sync` |
|
|
223
|
+
|
|
224
|
+
## Configuration
|
|
225
|
+
|
|
226
|
+
StudioLink uses the following default paths (Windows):
|
|
227
|
+
|
|
228
|
+
| Setting | Default Path | Environment Variable |
|
|
229
|
+
|---------|--------------|---------------------|
|
|
230
|
+
| Ollama executable | `~\AppData\Local\Programs\Ollama\ollama.exe` | `STUDIOLINK_OLLAMA_EXE` |
|
|
231
|
+
| LM Studio CLI | `~\.lmstudio\bin\lms.exe` | `STUDIOLINK_LMS_EXE` |
|
|
232
|
+
| Ollama models | `~\.ollama\models` | `STUDIOLINK_OLLAMA_MODELS_DIR` |
|
|
233
|
+
| LM Studio models | `~\.lmstudio\models` | `STUDIOLINK_LMSTUDIO_MODELS_DIR` |
|
|
234
|
+
| State directory | `~\.sdl` | `STUDIOLINK_STATE_DIR` |
|
|
235
|
+
|
|
236
|
+
## How It Works
|
|
237
|
+
|
|
238
|
+
1. **Scanning** - Reads Ollama manifest files from `~/.ollama/models/manifests/` to discover models
|
|
239
|
+
2. **Blob Resolution** - Locates GGUF blobs in `~/.ollama/models/blobs/` by digest
|
|
240
|
+
3. **Validation** - Verifies blobs start with GGUF magic bytes
|
|
241
|
+
4. **Import Aliases** - Creates human-readable `.gguf` aliases in `~/.sdl/imports/`
|
|
242
|
+
5. **LM Studio Import** - Uses `lms import` CLI to import models
|
|
243
|
+
6. **State Tracking** - Saves sync records to `~/.sdl/state.json`
|
|
244
|
+
|
|
245
|
+
## Troubleshooting
|
|
246
|
+
|
|
247
|
+
### "model blob is missing from the Ollama blob store"
|
|
248
|
+
The model manifest exists but the actual blob file has been deleted or purged by Ollama. Re-download it:
|
|
249
|
+
```powershell
|
|
250
|
+
ollama pull <model-name>
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
### Hard link fails (cross-volume)
|
|
254
|
+
StudioLink automatically falls back to copy mode if hard links fail (e.g., Ollama and StudioLink state are on different drives). Use `--verbose` to see the fallback in action.
|
|
255
|
+
|
|
256
|
+
### LM Studio import fails
|
|
257
|
+
Run `sdl doctor` to verify:
|
|
258
|
+
- LM Studio is installed
|
|
259
|
+
- `lms` CLI is in PATH
|
|
260
|
+
- Import directories are writable
|
|
261
|
+
|
|
262
|
+
## Design Notes
|
|
263
|
+
|
|
264
|
+
- **Ollama as source of truth** - StudioLink never modifies Ollama's model store
|
|
265
|
+
- **Hard links by default** - Space-efficient, creates references rather than copies
|
|
266
|
+
- **Cross-volume fallback** - Automatically copies when hard links aren't possible
|
|
267
|
+
- **State persistence** - Tracks imports to avoid redundant operations
|
|
268
|
+
- **CLI-only** - No GUI, designed for automation and scripting
|
|
269
|
+
|
|
270
|
+
## License
|
|
271
|
+
|
|
272
|
+
MIT License - See [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
# StudioLink
|
|
2
|
+
|
|
3
|
+
**Sync Ollama-downloaded GGUF models into LM Studio.**
|
|
4
|
+
|
|
5
|
+
StudioLink is a Python CLI tool that bridges Ollama and LM Studio. It treats Ollama as the source of truth, discovers GGUF-backed models from Ollama manifests, and imports them into LM Studio via the `lms` CLIโusing hard links by default to save disk space.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- ๐ **Scan** - Discover all GGUF models available in your Ollama library
|
|
10
|
+
- ๐ **Sync** - Import models into LM Studio with one command
|
|
11
|
+
- ๐ **Status** - Track which models are synced and their current state
|
|
12
|
+
- ๐ฉบ **Doctor** - Verify prerequisites and diagnose issues
|
|
13
|
+
- ๐ **Smart linking** - Uses hard links by default, falls back to copy when needed
|
|
14
|
+
- ๐พ **State tracking** - Remembers what's been synced to avoid re-importing
|
|
15
|
+
|
|
16
|
+
## Prerequisites
|
|
17
|
+
|
|
18
|
+
Before using StudioLink, ensure you have:
|
|
19
|
+
|
|
20
|
+
1. **Ollama** installed and available at `~/.ollama/models/`
|
|
21
|
+
2. **LM Studio** with the `lms` CLI installed at `~/.lmstudio/bin/lms.exe`
|
|
22
|
+
3. **Python 3.12+**
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
> **PyPI install coming soon!** For now, install from source:
|
|
27
|
+
|
|
28
|
+
```powershell
|
|
29
|
+
# Clone the repository
|
|
30
|
+
git clone https://github.com/MananJK/StudioLink.git
|
|
31
|
+
cd StudioLink
|
|
32
|
+
|
|
33
|
+
# Install in editable mode
|
|
34
|
+
pip install -e .
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Quick Start
|
|
38
|
+
|
|
39
|
+
```powershell
|
|
40
|
+
# Scan for available models
|
|
41
|
+
sdl scan
|
|
42
|
+
|
|
43
|
+
# Import a specific model
|
|
44
|
+
sdl sync <modelname>
|
|
45
|
+
|
|
46
|
+
# Import all discovered models
|
|
47
|
+
sdl sync --all
|
|
48
|
+
|
|
49
|
+
# Check sync status
|
|
50
|
+
sdl status
|
|
51
|
+
|
|
52
|
+
# Verify everything is set up correctly
|
|
53
|
+
sdl doctor
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Commands
|
|
57
|
+
|
|
58
|
+
### `sdl scan`
|
|
59
|
+
Discover all GGUF-backed Ollama models available for import.
|
|
60
|
+
|
|
61
|
+
```powershell
|
|
62
|
+
# Basic scan
|
|
63
|
+
sdl scan
|
|
64
|
+
|
|
65
|
+
# Output as JSON
|
|
66
|
+
sdl scan --json
|
|
67
|
+
|
|
68
|
+
# Verbose output (debug logging)
|
|
69
|
+
sdl -v scan
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
**Output:**
|
|
73
|
+
```
|
|
74
|
+
Discovered 3 model(s):
|
|
75
|
+
- <modelname> [ready]
|
|
76
|
+
blob: C:\Users\...\ollama\models\blobs\sha256-...
|
|
77
|
+
- <modelname2> [stale]
|
|
78
|
+
blob: C:\Users\...\ollama\models\blobs\sha256-...
|
|
79
|
+
issues: model blob is missing from the Ollama blob store
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### `sdl sync`
|
|
83
|
+
Import one or more models into LM Studio.
|
|
84
|
+
|
|
85
|
+
```powershell
|
|
86
|
+
# Import specific model(s)
|
|
87
|
+
sdl sync <modelname>
|
|
88
|
+
sdl sync <model1> <model2> <model3>
|
|
89
|
+
|
|
90
|
+
# Import all discovered models
|
|
91
|
+
sdl sync --all
|
|
92
|
+
|
|
93
|
+
# Preview without making changes (dry run)
|
|
94
|
+
sdl sync <modelname> --dry-run
|
|
95
|
+
|
|
96
|
+
# Use a specific link mode
|
|
97
|
+
sdl sync <modelname> --hard-link
|
|
98
|
+
sdl sync <modelname> --copy
|
|
99
|
+
sdl sync <modelname> --symbolic-link
|
|
100
|
+
|
|
101
|
+
# Verbose output
|
|
102
|
+
sdl -v sync --all
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
**Options:**
|
|
106
|
+
- `--all` - Sync every discovered model
|
|
107
|
+
- `--dry-run` - Preview the import without making changes
|
|
108
|
+
- `--copy` - Use copy mode instead of hard links
|
|
109
|
+
- `--hard-link` - Force hard link mode (default)
|
|
110
|
+
- `--symbolic-link` - Use symbolic links
|
|
111
|
+
|
|
112
|
+
### `sdl status`
|
|
113
|
+
Show discovered models and their sync state.
|
|
114
|
+
|
|
115
|
+
```powershell
|
|
116
|
+
sdl status
|
|
117
|
+
sdl status --json
|
|
118
|
+
sdl -v status
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
**Output:**
|
|
122
|
+
```
|
|
123
|
+
Discovered 3 model(s); 1 tracked as synced.
|
|
124
|
+
- <modelname>: synced
|
|
125
|
+
imported: 2026-04-12T10:30:00+00:00
|
|
126
|
+
- <modelname2>: stale
|
|
127
|
+
issues: model blob is missing from the Ollama blob store
|
|
128
|
+
- <modelname3>: pending
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### `sdl doctor`
|
|
132
|
+
Check local StudioLink prerequisites and diagnose issues.
|
|
133
|
+
|
|
134
|
+
```powershell
|
|
135
|
+
sdl doctor
|
|
136
|
+
sdl doctor --json
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**Checks include:**
|
|
140
|
+
- Ollama executable exists
|
|
141
|
+
- LM Studio CLI (`lms`) exists
|
|
142
|
+
- Ollama manifests and blobs directories exist
|
|
143
|
+
- LM Studio models directory exists
|
|
144
|
+
- Hard-link volume compatibility (same drive)
|
|
145
|
+
- Discovered Ollama models
|
|
146
|
+
- Blob presence validation
|
|
147
|
+
- GGUF header validation
|
|
148
|
+
|
|
149
|
+
### `sdl help`
|
|
150
|
+
Show all available commands and their descriptions.
|
|
151
|
+
|
|
152
|
+
```powershell
|
|
153
|
+
sdl help
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
## Global Options
|
|
157
|
+
|
|
158
|
+
All commands support these global options:
|
|
159
|
+
|
|
160
|
+
- `-v, --verbose` - Enable verbose output (debug logging)
|
|
161
|
+
- `--version` - Show version information
|
|
162
|
+
- `--help` - Show help for the specific command
|
|
163
|
+
|
|
164
|
+
```powershell
|
|
165
|
+
# Examples
|
|
166
|
+
sdl -v scan # Scan with debug logging
|
|
167
|
+
sdl sync --help # Show help for sync command
|
|
168
|
+
sdl --version # Show version
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
## Model Readiness States
|
|
172
|
+
|
|
173
|
+
When scanning or checking status, models can have these states:
|
|
174
|
+
|
|
175
|
+
| State | Description | Action Required |
|
|
176
|
+
|-------|-------------|-----------------|
|
|
177
|
+
| **ready** | Model blob exists and has valid GGUF header | Ready to sync |
|
|
178
|
+
| **stale** | Manifest exists but blob is missing | Run `ollama pull <model>` to restore |
|
|
179
|
+
| **invalid** | Blob exists but missing GGUF magic bytes | Model may be corrupted |
|
|
180
|
+
| **synced** | Already imported into LM Studio | No action needed |
|
|
181
|
+
| **pending** | Ready but not yet synced | Run `sdl sync` |
|
|
182
|
+
|
|
183
|
+
## Configuration
|
|
184
|
+
|
|
185
|
+
StudioLink uses the following default paths (Windows):
|
|
186
|
+
|
|
187
|
+
| Setting | Default Path | Environment Variable |
|
|
188
|
+
|---------|--------------|---------------------|
|
|
189
|
+
| Ollama executable | `~\AppData\Local\Programs\Ollama\ollama.exe` | `STUDIOLINK_OLLAMA_EXE` |
|
|
190
|
+
| LM Studio CLI | `~\.lmstudio\bin\lms.exe` | `STUDIOLINK_LMS_EXE` |
|
|
191
|
+
| Ollama models | `~\.ollama\models` | `STUDIOLINK_OLLAMA_MODELS_DIR` |
|
|
192
|
+
| LM Studio models | `~\.lmstudio\models` | `STUDIOLINK_LMSTUDIO_MODELS_DIR` |
|
|
193
|
+
| State directory | `~\.sdl` | `STUDIOLINK_STATE_DIR` |
|
|
194
|
+
|
|
195
|
+
## How It Works
|
|
196
|
+
|
|
197
|
+
1. **Scanning** - Reads Ollama manifest files from `~/.ollama/models/manifests/` to discover models
|
|
198
|
+
2. **Blob Resolution** - Locates GGUF blobs in `~/.ollama/models/blobs/` by digest
|
|
199
|
+
3. **Validation** - Verifies blobs start with GGUF magic bytes
|
|
200
|
+
4. **Import Aliases** - Creates human-readable `.gguf` aliases in `~/.sdl/imports/`
|
|
201
|
+
5. **LM Studio Import** - Uses `lms import` CLI to import models
|
|
202
|
+
6. **State Tracking** - Saves sync records to `~/.sdl/state.json`
|
|
203
|
+
|
|
204
|
+
## Troubleshooting
|
|
205
|
+
|
|
206
|
+
### "model blob is missing from the Ollama blob store"
|
|
207
|
+
The model manifest exists but the actual blob file has been deleted or purged by Ollama. Re-download it:
|
|
208
|
+
```powershell
|
|
209
|
+
ollama pull <model-name>
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
### Hard link fails (cross-volume)
|
|
213
|
+
StudioLink automatically falls back to copy mode if hard links fail (e.g., Ollama and StudioLink state are on different drives). Use `--verbose` to see the fallback in action.
|
|
214
|
+
|
|
215
|
+
### LM Studio import fails
|
|
216
|
+
Run `sdl doctor` to verify:
|
|
217
|
+
- LM Studio is installed
|
|
218
|
+
- `lms` CLI is in PATH
|
|
219
|
+
- Import directories are writable
|
|
220
|
+
|
|
221
|
+
## Design Notes
|
|
222
|
+
|
|
223
|
+
- **Ollama as source of truth** - StudioLink never modifies Ollama's model store
|
|
224
|
+
- **Hard links by default** - Space-efficient, creates references rather than copies
|
|
225
|
+
- **Cross-volume fallback** - Automatically copies when hard links aren't possible
|
|
226
|
+
- **State persistence** - Tracks imports to avoid redundant operations
|
|
227
|
+
- **CLI-only** - No GUI, designed for automation and scripting
|
|
228
|
+
|
|
229
|
+
## License
|
|
230
|
+
|
|
231
|
+
MIT License - See [LICENSE](LICENSE) for details.
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "studiolink"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Sync Ollama-downloaded GGUF models into LM Studio."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.12"
|
|
11
|
+
license = { file = "LICENSE" }
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "StudioLink contributors" }
|
|
14
|
+
]
|
|
15
|
+
keywords = ["ollama", "lm-studio", "gguf", "cli", "sync"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 3 - Alpha",
|
|
18
|
+
"Environment :: Console",
|
|
19
|
+
"Intended Audience :: End Users/Desktop",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Programming Language :: Python :: 3",
|
|
22
|
+
"Programming Language :: Python :: 3.12",
|
|
23
|
+
]
|
|
24
|
+
dependencies = []
|
|
25
|
+
|
|
26
|
+
[project.urls]
|
|
27
|
+
Homepage = "https://github.com/MananJK/StudioLink"
|
|
28
|
+
Repository = "https://github.com/MananJK/StudioLink"
|
|
29
|
+
|
|
30
|
+
[project.scripts]
|
|
31
|
+
sdl = "studiolink.cli:main"
|
|
32
|
+
|
|
33
|
+
[tool.setuptools]
|
|
34
|
+
package-dir = {"" = "src"}
|
|
35
|
+
|
|
36
|
+
[tool.setuptools.packages.find]
|
|
37
|
+
where = ["src"]
|