Skip to content

Commit 28b8283

Browse files
authored
feat: spitter - copy ollama models to a remote host (#187)
* feat: spitter - copy ollama models to a remote host * feat: spitter - copy ollama models to a remote host * feat: spitter - copy ollama models to a remote host * feat: spitter - copy ollama models to a remote host
1 parent b3ef546 commit 28b8283

File tree

6 files changed

+397
-28
lines changed

6 files changed

+397
-28
lines changed

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ The application allows users to interactively select models, sort, filter, edit,
2525
- [Top](#top)
2626
- [Inspect](#inspect)
2727
- [Link](#link)
28+
- [Spit (Copy to Remote)](#spit-copy-to-remote)
2829
- [Command-line Options](#command-line-options)
2930
- [Configuration](#configuration)
3031
- [Installation and build from source](#installation-and-build-from-source)
@@ -51,6 +52,7 @@ It's in active development, so there are some bugs and missing features, however
5152
- Link models to LM Studio
5253
- Copy / rename models
5354
- Push models to a registry
55+
- Copy models to remote hosts (spit)
5456
- Show running models
5557
- Has some cool bugs
5658

@@ -150,6 +152,22 @@ When linking models to LM Studio, Gollama creates a Modelfile with the template
150152

151153
Note: Linking requires admin privileges if you're running Windows.
152154

155+
#### Spit (Copy to Remote)
156+
157+
The spit functionality allows you to copy Ollama models to remote hosts. This is useful for distributing models across multiple machines or creating backups.
158+
159+
You can use the command-line interface:
160+
161+
```shell
162+
# Copy a specific model to a remote host
163+
gollama --spit my-model --remote http://remote-host:11434
164+
165+
# Copy all models to a remote host
166+
gollama --spit-all --remote http://remote-host:11434
167+
```
168+
169+
This functionality uses the [spitter](https://github.com/sammcj/spitter) package to handle the model copying process.
170+
153171
#### Command-line Options
154172

155173
- `-l`: List all available Ollama models and exit
@@ -168,6 +186,9 @@ Note: Linking requires admin privileges if you're running Windows.
168186
- `-v`: Print the version and exit
169187
- `-h`, or `--host`: Specify the host for the Ollama API
170188
- `-H`: Shortcut for `-h http://localhost:11434` (connect to local Ollama API)
189+
- `--spit <model>`: Copy a model to a remote host
190+
- `--spit-all`: Copy all models to a remote host
191+
- `--remote <url>`: Remote host URL for spit operations (e.g., http://remote-host:11434)
171192
- `--vram`: Estimate vRAM usage for a model. Accepts:
172193
- Ollama models (e.g. `llama3.1:8b-instruct-q6_K`, `qwen2:14b-q4_0`)
173194
- HuggingFace models (e.g. `NousResearch/Hermes-2-Theta-Llama-3-8B`)
@@ -483,6 +504,7 @@ Please fork the repository and create a pull request with your changes.
483504
- [Ollama](https://ollama.com/)
484505
- [Llama.cpp](https://github.com/ggerganov/llama.cpp)
485506
- [Charmbracelet](https://charm.sh/)
507+
- [Spitter](https://github.com/sammcj/spitter) - For model copying functionality
486508
487509
Thank you to folks such as Matt Williams, Fahd Mirza and AI Code King for giving this a shot and providing feedback.
488510
@@ -495,5 +517,3 @@ Thank you to folks such as Matt Williams, Fahd Mirza and AI Code King for giving
495517
Copyright © 2024 Sam McLeod
496518
497519
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
498-
499-
<script src="http://api.html5media.info/1.1.8/html5media.min.js"></script>

go.mod

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,70 @@
11
module github.com/sammcj/gollama
22

3-
go 1.23.4
3+
go 1.24.0
4+
5+
toolchain go1.24.2
46

57
require (
68
github.com/charmbracelet/bubbles v0.20.0
7-
github.com/charmbracelet/bubbletea v1.3.2
8-
github.com/charmbracelet/lipgloss v1.0.0
9+
github.com/charmbracelet/bubbletea v1.3.4
10+
github.com/charmbracelet/lipgloss v1.1.0
911
github.com/fsnotify/fsnotify v1.8.0
1012
github.com/natefinch/lumberjack v2.0.0+incompatible
1113
github.com/olekukonko/tablewriter v0.0.5
12-
github.com/ollama/ollama v0.5.8
13-
github.com/rs/zerolog v1.33.0
14+
github.com/ollama/ollama v0.6.4
15+
github.com/rs/zerolog v1.34.0
16+
github.com/sammcj/spitter v1.0.1
1417
github.com/shirou/gopsutil/v3 v3.24.5
15-
github.com/spf13/viper v1.19.0
16-
golang.org/x/term v0.29.0
18+
github.com/spf13/viper v1.20.1
19+
golang.org/x/term v0.30.0
1720
)
1821

1922
require (
2023
github.com/BurntSushi/toml v1.4.0 // indirect
2124
github.com/atotto/clipboard v0.1.4 // indirect
2225
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
26+
github.com/charmbracelet/colorprofile v0.3.0 // indirect
2327
github.com/charmbracelet/harmonica v0.2.0 // indirect
2428
github.com/charmbracelet/x/ansi v0.8.0 // indirect
29+
github.com/charmbracelet/x/cellbuf v0.0.13 // indirect
2530
github.com/charmbracelet/x/term v0.2.1 // indirect
2631
github.com/erikgeiser/coninput v0.0.0-20211004153227-1c3628e74d0f // indirect
2732
github.com/go-ole/go-ole v1.3.0 // indirect
33+
github.com/go-viper/mapstructure/v2 v2.2.1 // indirect
2834
github.com/hashicorp/hcl v1.0.0 // indirect
2935
github.com/lucasb-eyer/go-colorful v1.2.0 // indirect
30-
github.com/lufia/plan9stats v0.0.0-20240909124753-873cd0166683 // indirect
36+
github.com/lufia/plan9stats v0.0.0-20250317134145-8bc96cf8fc35 // indirect
3137
github.com/magiconair/properties v1.8.9 // indirect
3238
github.com/mattn/go-colorable v0.1.14 // indirect
3339
github.com/mattn/go-isatty v0.0.20 // indirect
3440
github.com/mattn/go-localereader v0.0.1 // indirect
3541
github.com/mattn/go-runewidth v0.0.16 // indirect
42+
github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db // indirect
3643
github.com/mitchellh/mapstructure v1.5.0 // indirect
3744
github.com/muesli/ansi v0.0.0-20230316100256-276c6243b2f6 // indirect
3845
github.com/muesli/cancelreader v0.2.2 // indirect
39-
github.com/muesli/termenv v0.15.2 // indirect
46+
github.com/muesli/termenv v0.16.0 // indirect
4047
github.com/pelletier/go-toml/v2 v2.2.3 // indirect
4148
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
4249
github.com/rivo/uniseg v0.4.7 // indirect
43-
github.com/sagikazarmark/locafero v0.7.0 // indirect
50+
github.com/sagikazarmark/locafero v0.9.0 // indirect
4451
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
4552
github.com/sahilm/fuzzy v0.1.1 // indirect
53+
github.com/schollz/progressbar/v3 v3.18.0 // indirect
4654
github.com/sourcegraph/conc v0.3.0 // indirect
47-
github.com/spf13/afero v1.12.0 // indirect
55+
github.com/spf13/afero v1.14.0 // indirect
4856
github.com/spf13/cast v1.7.1 // indirect
4957
github.com/spf13/pflag v1.0.6 // indirect
5058
github.com/subosito/gotenv v1.6.0 // indirect
51-
github.com/tklauser/go-sysconf v0.3.14 // indirect
52-
github.com/tklauser/numcpus v0.9.0 // indirect
59+
github.com/tklauser/go-sysconf v0.3.15 // indirect
60+
github.com/tklauser/numcpus v0.10.0 // indirect
61+
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
5362
github.com/yusufpapurcu/wmi v1.2.4 // indirect
5463
go.uber.org/multierr v1.11.0 // indirect
55-
golang.org/x/exp v0.0.0-20250210185358-939b2ce775ac // indirect
56-
golang.org/x/sync v0.11.0 // indirect
57-
golang.org/x/sys v0.30.0 // indirect
58-
golang.org/x/text v0.22.0 // indirect
64+
golang.org/x/exp v0.0.0-20250305212735-054e65f0b394 // indirect
65+
golang.org/x/sync v0.12.0 // indirect
66+
golang.org/x/sys v0.31.0 // indirect
67+
golang.org/x/text v0.23.0 // indirect
5968
gopkg.in/ini.v1 v1.67.0 // indirect
6069
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
6170
gopkg.in/yaml.v2 v2.4.0 // indirect

0 commit comments

Comments
 (0)