How to watch and steer a running server
This guide shows how to see what a running rzb serve holds, free a model's memory, and apply a configuration change without restarting. It assumes the server runs on your Mac and you have a shell on that Mac: these routes answer the machine itself only.
See what the server holds
curl -s http://127.0.0.1:7920/rzb/status | python3 -m json.tool
models lists what is loaded, whether a request holds it (busy), how many wait (queued) and how long before keep_alive unloads it. recent_requests shows the last 50 requests with their model, tokens and duration. memory shows what MLX holds now and at its peak. To watch it change, open rzb tui in another terminal (its Dashboard refreshes every second), or repeat the call: watch -n 1 'curl -s http://127.0.0.1:7920/rzb/status'.
Free a model's memory now
curl -s -X POST http://127.0.0.1:7920/rzb/models/qwen3/unload
Use the name clients use: a declared id, or a Hugging Face id such as mlx-community/Qwen3-4B-4bit (the / stays as is in the path). The answer says unloaded, or not_loaded when there was nothing to free.
In rzb tui, select the model on the Dashboard and press u: the answer shows under the requests.
If the answer is a 409 model_busy, a request is generating with the model or waiting for it. Nothing was unloaded: retry once busy is false and queued is 0 in the status. The next request for the model loads it again.
Apply a configuration change without restarting
-
Edit the file the server was started with (
rzb serve --config server.yaml). -
Check it:
rzb config validate server.yaml. -
Tell the server to read it again, with either:
curl -s -X POST http://127.0.0.1:7920/rzb/config/reloador, which writes the outcome to the server's log instead:
kill -HUP "$(pgrep -f 'rzb serve')" -
Read the answer (or the log line
configuration reloaded from …):unloadedandunload_when_idlename the loaded models you removed or moved to another source; they are freed now, or once their requests end.restart_requirednames theserver:keys you changed that only apply after a restart (host,port,api_key_env,cors_origin): stop the server and start it again for those.
If the file has a problem, the answer is a 400 invalid_config listing it, and the server keeps the configuration it had: fix the file and reload again. A server started without --config answers 409 no_config_file: there is no file to read, so restart it with one.
Variants
- The server has an API key: add
-H "Authorization: Bearer $RZB_API_KEY"to eachcurl; these routes need it like/v1. - The server listens on another port: change
7920in the URLs. - You are on another machine: the routes answer 403
local_only. Run the commands on the Mac itself, for instance overssh, or forward the port (ssh -L 7920:127.0.0.1:7920 mac) and callhttp://127.0.0.1:7920locally: the server then sees a connection from itself.
See also
- Every field and status of these routes: HTTP API reference.
- What each key does on reload: configuration reference.
- Why these routes exist and stay local: OpenAI compatibility; how unloading fits the model lifecycle: model lifecycle.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
|