feat: add spinloop gateway, a fleet's OpenAI-compatible front door - #170
Merged
Merged
Conversation
outofcoffee
force-pushed
the
gateway
branch
3 times, most recently
from
September 12, 2026 20:54
1816d40 to
a76cd11
Compare
outofcoffee
force-pushed
the
gateway
branch
from
September 12, 2026 23:59
a76cd11 to
a68a038
Compare
outofcoffee
marked this pull request as ready for review
September 13, 2026 00:00
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Serves a fleet under one OpenAI-compatible endpoint: an agent's Spinloop names the gateway's address in its
FLEET, and the agent needs only the gateway's token.Summary
spinloop gatewaycommand andinternal/gateway: one OpenAI-compatible endpoint in front of afleet.yaml./v1/modelslists what the fleet is running; completion requests are routed with the fleet's own selector; a node is woken from its own Spinloop source when nothing is serving, and the request is held until the engine answers; the caller's authorisation is swapped for the engine key the node's fleet entry nameswake: on|offsetting in the fleet file decides whether routing may start an engine; off refuses without starting anything, naming the node and thespinloop fleet startcommand that wouldFLEETmay now name an endpoint (a URL) as well as a fleet file: the launch is pointed at it, with the OpenAI-compatible prefix added where needed, and authenticates with the endpoint's token through the launch's existing key chain.spinloop fleet routeanswers an endpoint without querying or starting a nodeBASEURLinto the pushed deploy config, translated to the engine's bind exactly as a localservedoes. Without it a node with no preset woke onto the engine's own default bind — loopback for llama.cpp — which nothing but the node itself could reachexamples/gateway-docker/: two daemon nodes and two gateways over them (one waking, onewake: off) in containers. It is the gateway's integration test, run per PR by a new CI jobdocs/commands/gateway.md, the endpoint form ofFLEETindocs/spinloop-file.md, thewakesetting indocs/commands/fleet.mdImplementation details
internal/fleet; the handler reuses a fan-out reading taken within the last two seconds rather than fanning out per requestengine:override taking responsibility for reachability, is never selected — and when it is the only candidate, the failure says so