# Pounce API Reference

URL: /pounce/api/
Section: api
Description: Browse Python API documentation by package.

---

> For a complete page index, fetch /pounce/llms.txt.

Open LLM text
(/pounce/api/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpounce%2Fapi%2Findex.txt)

# Pounce API Reference

Browse Python API documentation by package.

3
Packages

60
Modules

## Packages

Asgi

ASGI protocol bridge.

8 items

(/pounce/api/asgi/)

Net

Network layer — socket binding, listening, and TLS.

3 items

(/pounce/api/net/)

Protocols

Protocol handlers for HTTP/1.1, HTTP/2, and WebSocket.

Each protocol module translates between raw bytes on the...

6 items

(/pounce/api/protocols/)

## Modules

__main__

Allow running pounce via python -m pounce.

(/pounce/api/__main__/)

_bench

Standardized performance benchmarks for pounce.

Spawns a pounce server with built-in ASGI apps and drives load...

(/pounce/api/_bench/)

_cli

Command-line interface for pounce.

(/pounce/api/_cli/)

_compression

Content encoding negotiation and compressor factory.

Parses Accept-Encoding headers, selects the best encoding, and...

(/pounce/api/_compression/)

_concurrency

Shared structured-concurrency helpers.

Single source of truth for the ``FIRST_COMPLETED`` race that...

(/pounce/api/_concurrency/)

_config_file

TOML configuration file loading for pounce.

Searches for configuration in this order:
1.

(/pounce/api/_config_file/)

_config_schema

ServerConfig introspection — JSON Schema export and redacted view.

Two entry points, both consumed by the ``pounce...

(/pounce/api/_config_schema/)

_cpu_affinity

CPU affinity for worker threads (Linux only).

(/pounce/api/_cpu_affinity/)

_debug

Development error pages with rich tracebacks.

(/pounce/api/_debug/)

_dictionary_endpoint

Built-in dictionary serving endpoint for RFC 9842 compression dictionaries.

(/pounce/api/_dictionary_endpoint/)

_drain

Shared drain-503 wire format and write helpers.

(/pounce/api/_drain/)

_errors

Error hierarchy for pounce.

All pounce errors inherit from PounceError.

(/pounce/api/_errors/)

_fast_h1

Fast HTTP/1.1 parser for the sync worker — replaces h11 on the hot path.

(/pounce/api/_fast_h1/)

_h2_handler

HTTP/2 connection handler — manages multiplexed streams over a single connection.

Extracted from ``worker.py`` to...

(/pounce/api/_h2_handler/)

_h3_handler

HTTP/3 connection handler — manages QUIC/UDP streams via zoomies.

HTTP/3 uses QUIC (UDP) transport.

(/pounce/api/_h3_handler/)

_headers

Shared header lookup utilities.

Single-pass header extraction for ASGI headers (list or tuple of
(name, value) byte...

(/pounce/api/_headers/)

_health

Built-in health check endpoint.

Responds to GET and HEAD requests at the configured ``health_check_path``...

(/pounce/api/_health/)

_hot_reload

Hot reload without connection drops for pounce.

(/pounce/api/_hot_reload/)

_importer

Application importer — resolves string references to ASGI callables.

(/pounce/api/_importer/)

_init

``pounce init`` — scaffold a minimal pounce project in the current directory.

(/pounce/api/_init/)

_introspect

Built-in ``/_pounce/info`` introspection endpoint (Sprint 5).

Disabled by default.

(/pounce/api/_introspect/)

_metrics_handler

Built-in /metrics endpoint for Prometheus scraping.

(/pounce/api/_metrics_handler/)

_middleware

Middleware extension system for server-level request/response processing.

(/pounce/api/_middleware/)

_otel

OpenTelemetry integration for distributed tracing.

Provides automatic span creation for HTTP requests and inbound...

(/pounce/api/_otel/)

_output

Kida template infrastructure and one-shot branded output.

Provides the shared template environment, thread-safe...

(/pounce/api/_output/)

_priority

HTTP Priority Signals (RFC 9218).

Parses the ``Priority`` header (``u=N, i``) from HTTP/2 requests and
provides a...

(/pounce/api/_priority/)

_profile

Request profiling — enabled via POUNCE_PROFILE=1.

Samples every Nth request and logs read/parse/app/drain timings...

(/pounce/api/_profile/)

_proxy

Proxy header validation — extract real client info from trusted reverse proxies.

When ``trusted_hosts`` is...

(/pounce/api/_proxy/)

_rate_limiter

Rate limiting and backpressure for pounce.

Implements token bucket rate limiting per client IP with request...

(/pounce/api/_rate_limiter/)

_reload

File watcher for development mode (``--reload``).

Polls the application's source directory for changes and signals...

(/pounce/api/_reload/)

_request_id

Request ID generation and propagation.

Each request gets a unique ID for tracing across logs and services.
If a...

(/pounce/api/_request_id/)

_request_pipeline

Shared request pipeline — functions used by both Worker and SyncWorker.

(/pounce/api/_request_pipeline/)

_request_queue

Request queuing and load shedding for pounce.

Implements application-level request queueing with bounded...

(/pounce/api/_request_queue/)

_response_frame

Pre-built HTTP response framing for the fused sync path.

Bypasses H1Protocol/h11 for the hot path — serializes...

(/pounce/api/_response_frame/)

_runtime

Runtime detection utilities.

Detects GIL state and determines the appropriate worker mode for the
current Python...

(/pounce/api/_runtime/)

_sendfile

Zero-copy sendfile support for static file serving.

Provides an async callable that uses ``loop.sendfile()`` to...

(/pounce/api/_sendfile/)

_sentry

Sentry error tracking integration for pounce.

(/pounce/api/_sentry/)

_state

Server lifecycle state machine — Elm Architecture via milo.

Centralizes the server lifecycle (init → startup →...

(/pounce/api/_state/)

_static

Static file serving with modern optimizations.

Designed for Bengal SSG output and Chirp static assets.

(/pounce/api/_static/)

_subinterpreter_bootstrap

Subinterpreter worker bootstrap.

This module provides `bootstrap`(), the entry point executed inside
each...

(/pounce/api/_subinterpreter_bootstrap/)

_timeouts

Shared request-input and response-output timeout helpers.

(/pounce/api/_timeouts/)

_timing

Timing utilities and Server-Timing header builder.

Provides monotonic clock helpers for request-level timing and a...

(/pounce/api/_timing/)

_types

ASGI type definitions for pounce.

Typed definitions for the ASGI 3.0 protocol.

(/pounce/api/_types/)

_ws_handler

WebSocket connection handler — HTTP/1.1 upgrade lifecycle.

Extracted from ``worker.py`` to keep protocol-specific...

(/pounce/api/_ws_handler/)

accept_distributor

AcceptDistributor — single-thread accept feeding a shared worker queue.

Eliminates thundering herd on macOS/Windows...

(/pounce/api/accept_distributor/)

async_pool

AsyncPool — dedicated event loop for streaming and WebSocket connections.

Receives handoffs from SyncWorkers when...

(/pounce/api/async_pool/)

config

Server configuration.

(/pounce/api/config/)

display

Application display identity for Pounce startup output.

(/pounce/api/display/)

h3_worker

HTTP/3 worker — runs QUIC/UDP datagram endpoint for HTTP/3.

(/pounce/api/h3_worker/)

lifecycle

Connection lifecycle events — structured, immutable records.

Each event captures a moment in a connection's...

(/pounce/api/lifecycle/)

logging

Logging configuration and access log formatting.

Configures stdlib logging with pounce-specific formatting.

(/pounce/api/logging/)

metrics

Prometheus-compatible metrics collector.

Implements the ``LifecycleCollector`` protocol to track standard...

(/pounce/api/metrics/)

pounce

Pounce — A free-threading-native ASGI server for Python 3.14t.

Pounce is a pure-Python ASGI server designed from...

(/pounce/api/pounce/)

server

Server — orchestrates the full pounce lifecycle.

Manages the state machine:
CONFIG → DETECT → BIND → LIFESPAN →...

(/pounce/api/server/)

supervisor

Supervisor — spawns, monitors, and restarts workers.

The supervisor sits between the ``Server`` and the ``Worker``...

(/pounce/api/supervisor/)

sync_protocol

SyncApp protocol — fused sync request-response path for Pounce.

When a SyncApp is provided, the sync worker calls...

(/pounce/api/sync_protocol/)

sync_worker

SyncWorker — blocking I/O worker for request-response workloads.

One request at a time per thread, no asyncio.

(/pounce/api/sync_worker/)

testing

First-class testing utilities for pounce.

(/pounce/api/testing/)

worker

Worker — the heart of pounce's request handling.

Runs a single asyncio event loop that accepts connections on a...

(/pounce/api/worker/)
