Repository navigation
Conversation
Guest chat accounts (is_guest, from Metering) are landing-page visitors with a small credit and no login. Their requests are ordinary requests with one difference: a chat request always carries an output limit of at most GUEST_MAX_OUTPUT_TOKENS (default 8,192), written into the request so the provider enforces it. Metering holds credit for that limit, so a guest's answer can never cost more than its hold; without a limit the request would go upstream unbounded and could leave a debt nobody pays. 8,192 covers almost every answer, reasoning included: over a week of production traffic on DeepSeek V4.1 Flash, answers averaged about 1,100 output tokens and the longest was about 15,000. A 1,024 limit left hard questions with an empty answer, all of it spent on reasoning. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
Merged into #22. |
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.
Part of guest chat: a landing-page visitor chats without signing up. Companion PRs: dappnode/dappnode-nexus (control plane, metering, UI) and dappnode/infrastructure (settings). Supersedes #18. Stacked on #19, which supplies the prompt estimate every hold uses.
What this changes
A guest is an ordinary account (
is_guestfrom Metering) with a small credit and no login. Its requests are ordinary requests with one difference: a chat request always carries an output limit of at mostGUEST_MAX_OUTPUT_TOKENS(default 8,192), written into the request so the provider enforces it.Why: Metering holds credit for the request's output limit. Without one, the request goes upstream unbounded and a longer answer is charged as debt (dappnode-nexus#151). A guest can't pay a debt, so the limit keeps a guest's answer within its hold.
Why 8,192 and not lower:
Everything else is untouched: any model the credit covers, tools, images, the key's PII mode. #18 restricted models, fields and request size; none of that is needed once the hold is honest.
Tests
guest_output_test.go: the limit is written (absent, larger, smaller kept,max_completion_tokensname kept), Metering holds for it, and other fields pass through; signed-in requests get no limit.is_guestflag survives the Metering response, and an older Metering without it means "not a guest".go test ./...andgo vet ./...pass.🤖 Generated with Claude Code