Serve a model
Using a coding agent? You do not need this page: after gerald install the
agent starts and stops the model itself. See
Coding agents. gerald serve is for editors, and for
when you want the model running where you can see it.
gerald serve # same as: gerald serve rubyserve runs in the foreground. When the model is loaded it prints:
Ready: http://127.0.0.1:8080/v1Model: gerald/ruby:0.2.0Backend: a91eab67d8389d979d29fdf6633b2edd0718eb4b (cuda)Ctrl-C stops Gerald and its backend. It never stops on its own.
If agents had already started a model in the background, serve stops that
one first (Stopped the background model.) and agents use yours.
First run
Section titled “First run”Nothing installed yet? serve signs you in, shows the release and its size,
and asks before downloading:
Download gerald/ruby:0.2.0 (4.7 GB)? [y/N]It checks free space first, then the download’s size and SHA-256 before the
model is registered. --yes answers the prompts for scripts; without a
terminal and without --yes, Gerald stops and says to rerun with it.
Which release
Section titled “Which release”| You type | You get |
|---|---|
ruby |
The installed release: stable, then preview, then alpha, else the newest |
ruby:alpha |
The release on a channel: stable, preview or alpha |
ruby:0.2.0 |
An exact release |
serve never updates a model. To move to a newer release:
gerald models pull rubyDevice
Section titled “Device”Gerald picks the device itself:
- Metal on Apple Silicon.
- CUDA on Linux with NVIDIA driver 525 or newer. An older driver falls back to Vulkan and says so.
- Vulkan on Linux with a Vulkan loader and a GPU.
- CPU, only after asking:
No supported GPU found. Use CPU (slow)?
Override it with --device cpu|cuda|vulkan|metal.
Default 8080. Change it with --port, and pass the same port to
gerald stats --port and to your editor.
If you use coding agents on another port, the agent setup needs it too; see Coding agents.
Two modes, one endpoint
Section titled “Two modes, one endpoint”gerald/ruby serves both from POST /v1/completions:
- Tab completes the current line: a request with no
instruction. - Implement writes one method: a request with an
instruction.
Each mode takes one request at a time, and Tab is never queued behind Implement. Details are in the HTTP API.
Only on this machine
Section titled “Only on this machine”The server binds to 127.0.0.1, refuses non-loopback hosts and any request
with a browser Origin, and makes no outbound connections while serving.