[claude] Extract hardcoded sats limit in consult_grok() (#937) (#1058)
Some checks failed
Tests / lint (push) Has been cancelled
Tests / test (push) Has been cancelled

Co-authored-by: Claude (Opus 4.6) <claude@hermes.local>
Co-committed-by: Claude (Opus 4.6) <claude@hermes.local>
This commit was merged in pull request #1058.
This commit is contained in:
2026-03-23 15:07:40 +00:00
committed by rockachopa
parent af0963a8c7
commit df7358b383
2 changed files with 7 additions and 2 deletions

View File

@@ -125,7 +125,7 @@ def _run_grok_query(message: str) -> dict:
from lightning.factory import get_backend as get_ln_backend
ln = get_ln_backend()
sats = min(settings.grok_max_sats_per_query, 100)
sats = min(settings.grok_max_sats_per_query, settings.grok_sats_hard_cap)
ln.create_invoice(sats, f"Grok: {message[:50]}")
invoice_note = f" | {sats} sats"
except Exception as exc:

View File

@@ -14,10 +14,15 @@ app = typer.Typer(help="Timmy Serve — sovereign AI agent API")
def start(
port: int = typer.Option(8402, "--port", "-p", help="Port for the serve API"),
host: str = typer.Option("0.0.0.0", "--host", "-h", help="Host to bind to"),
price: int = typer.Option(100, "--price", help="Price per request in sats"),
price: int = typer.Option(None, "--price", help="Price per request in sats (default: from config)"),
dry_run: bool = typer.Option(False, "--dry-run", help="Print config and exit (for testing)"),
):
"""Start Timmy in serve mode."""
from config import settings
if price is None:
price = settings.grok_sats_hard_cap
typer.echo(f"Starting Timmy Serve on {host}:{port}")
typer.echo(f"L402 payment proxy active — {price} sats per request")
typer.echo("Press Ctrl-C to stop")