Skip to content

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.

Terminal window
gerald serve # same as: gerald serve ruby

serve runs in the foreground. When the model is loaded it prints:

Ready: http://127.0.0.1:8080/v1
Model: gerald/ruby:0.2.0
Backend: 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.

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.

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:

Terminal window
gerald models pull ruby

Gerald picks the device itself:

  1. Metal on Apple Silicon.
  2. CUDA on Linux with NVIDIA driver 525 or newer. An older driver falls back to Vulkan and says so.
  3. Vulkan on Linux with a Vulkan loader and a GPU.
  4. 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.

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.

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.