Repository navigation
One spending ceiling across several ZeroClaw instances (tested on v0.8.5) #11766
domondi1
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
If you run more than one ZeroClaw instance (on different machines, or with separate config directories), each one tracks its own cost and enforces its own
daily_limit_usd. Together they can spend a multiple of what you meant to allow.I wanted one ceiling for all of them, so I pointed a
customprovider at a gateway that reserves each call's worst-case cost against one shared budget before forwarding it to OpenAI. No ZeroClaw code changes, just config:How I tested it: the v0.8.5 release binary, two instances with separate config directories, a $0.01 ceiling, and a local stand-in for OpenAI that reports token usage sized from each request (so no real spend). ZeroClaw's default prompt is about 16K tokens per turn, so $0.01 covers two answers. Alternating messages between the instances: 2 answered, then 14 refused across both, before anything reached the provider. On a refusal ZeroClaw prints "The selected model provider rejected the request" and sends no retry. The reason and every call's cost are in
GET .../hosted/v1/work/<id>with the workspace key.Limits worth knowing:
custom(OpenAI-compatible) provider. In v0.8.5 the nativeanthropicprovider doesn't applyextra_headers, so direct-Anthropic setups can't send the headers this needs.Disclosure: I work on Inferrail, the gateway used here. The hosted version gives each workspace 250 runs a month free (all instances on one work id count as one run). The gateway is also open source (
pip install inferrail), so you can run it yourself and point every instance at that one gateway instead. Full recipe: https://github.com/domondi1/inferrail/blob/main/docs/integrations.mdAll reactions