Skip to content

Configure and troubleshoot

Download this guide as Markdown

An endpoint can set a model override in its @summon(..., model=...) declaration. Otherwise Runtime resolves SUMMONPOT_MODEL when handling a request, falling back to openai:gpt-4o-mini. Select a provider-supported model name and install the corresponding Summonpot provider extra when required. Credentials are provider-specific environment configuration; never commit them or print them in logs. The provider-neutral runtime and optional dependencies are defined in pyproject.toml.

For agent-backed local wiring, set SUMMONPOT_MODEL=test. This avoids provider credentials but does not make capability execution inert: the test model may call declared operations with placeholder arguments. Use harmless, isolated operations only. For a no-model demonstration that makes no model call, use the fully qualifying direct-execution guide.

Runtime accepts retries, Pydantic AI usage_limits, and timeout. Set limits deliberately for the workload; timeout applies to execution, not side-effect rollback. Provider throttling can be returned as 429; upstream provider errors are surfaced as 502. A request-level timeout maps to 504. See runtime implementation and HTTP mapping.

In v0.10.0, public failure bodies use fixed, redacted messages rather than reflecting exception text, provider response bodies, validation input, prompts, or capability data. The HTTP boundary keeps distinct status categories: 422 for malformed request input or a receiving-operation input-contract mismatch; 429 for usage exhaustion or provider throttling; 502 for invalid operation/model output or other upstream provider failures; 504 for runtime deadline expiry; and 500 for other execution/configuration failures. Do not rely on private exception details or undocumented response fields as a client contract. Normal logs use allowlisted endpoint/failure fields and omit exception text and chains; use your own appropriately access-controlled diagnostics for application-specific investigation.

Runtime.timeout is one monotonic runtime deadline covering runtime request preparation, execution, and finalization, with checks before application effects. It does not include HTTP body parsing, FastAPI request validation, or response serialization. Synchronous preparation, finalization, and capability functions cannot be preempted while running; a timeout does not establish that such work stopped or that its effects were rolled back. If a timeout happens after an operation starts, its outcome may be uncertain. Design side-effecting operations with application-owned idempotency, transaction, and reconciliation controls. The direct path does not replay through a model after execution starts.

Symptom Likely boundary What to inspect
Registration raises for an explicit operation Contract is incomplete or unsupported Confirm every callable parameter is bound/defaulted, source vocabulary is supported, annotations are compatible, and output is declared.
HTTP 422 Invalid body/query or injected receiver mismatch Compare payload with generated OpenAPI and receiving parameter annotations. Application code should not start for rejected request values.
HTTP 429 Usage limit or provider throttling Logs distinguish configured usage exhaustion from upstream throttling; keep public messages redacted.
HTTP 502 Provider request failed Check selected model, installed provider integration, credentials, and upstream availability in operator logs.
HTTP 504 Runtime timed out Check timeout budget and operation/provider latency. A timed-out side effect may already have occurred.
test response is placeholder text Test model is for wiring, not quality Test schema and route behavior; do not infer semantic output quality.
Side effect occurred despite an error Validation/timeout is not a transaction Put authorization, transactionality, idempotency, and compensation in the application operation.

Public failure bodies are intentionally fixed rather than exposing provider text or operation details that may contain request data or secrets. Use server logs with appropriate access controls for diagnosis; do not echo sensitive exception bodies to clients.

Install summonpot[serve,cli], then use summonpot serve app.py --host 127.0.0.1 --port 8000. Binding to loopback avoids exposing an experimental endpoint to the network. The CLI loads a Python file containing a Summon instance named summon; package commands are defined in cli.py. Review deployment exposure, authentication, rate limits, secrets, and capability authority before binding publicly.

Exercise transport and contract boundaries

Section titled “Exercise transport and contract boundaries”

Use the current-checkout path/method lesson to inspect GET/POST/PUT/PATCH/DELETE/HEAD OpenAPI contracts, prove the URL owns path values, and observe HEAD without a response body. It is a stateless, model-backed transport demonstration, not database CRUD. Its tests use keyless model fixtures that consume actual validated request evidence, not live-provider qualification.

The defaults and metadata lesson executes directly without model access. It demonstrates that an immutable callable default stays application-owned and a value accepted by the broader request model can still fail the receiving operation contract before application code starts. Its omitted output declaration is shorthand included from version 0.15.0; the guide explains the explicit-output alternative.

  • Authorize every request inside application-owned operations; request fields are not trusted identity.
  • Expose narrow operations, never ambient process/database/shell authority.
  • Treat all declared functions as real side effects even under the keyless model.
  • Add idempotency and transaction controls in application code when required.
  • Keep timeouts and provider limits; do not claim they roll back application changes.
  • Treat schema validation as structure/type enforcement, not factual or provenance verification.