Migrate from Uvicorn

Switch from Uvicorn to Pounce with minimal changes

2 min read 449 words

Overview

If you're running an ASGI app with Uvicorn today, switching to Pounce is straightforward. The CLI syntax and configuration concepts are similar.

CLI Comparison

# Uvicorn
uvicorn myapp:app --host 0.0.0.0 --port 8000 --workers 4 --reload

# Pounce
pounce myapp:app --host 0.0.0.0 --port 8000 --workers 4 --reload

Flag Mapping

Uvicorn Flag Pounce Equivalent Notes
--host --host Same
--port --port Same
--workers --workers Pounce uses threads on 3.14t
--reload --reload Built-in, no watchfiles needed
--log-level --log-level Same levels
--ssl-certfile --ssl-certfile Same
--ssl-keyfile --ssl-keyfile Same
--root-path --root-path Same
--no-access-log --no-access-log Same
--factory (automatic) Usemyapp:create_app()syntax
--http h11 (default) h11 is the default backend
--http httptools (not needed) Built-in fast parser handles this
--ws websockets pounce[ws] Uses wsproto instead
--h11-max-incomplete-event-size ServerConfig(h11_max_incomplete_event_size=...) Programmatic only (no CLI flag)

Programmatic Comparison

# Uvicorn
import uvicorn
uvicorn.run("myapp:app", host="0.0.0.0", port=8000, workers=4)

# Pounce
import pounce
pounce.run("myapp:app", host="0.0.0.0", port=8000, workers=4)

Key Differences

Migration Steps

  1. 1

    Install Pounce

    uv add bengal-pounce
    
  2. 2

    Replace the run command

    # Before
    uvicorn myapp:app --host 0.0.0.0 --workers 4
    
    # After
    pounce myapp:app --host 0.0.0.0 --workers 4
    
  3. 3

    Update Dockerfile / systemd

    Update deployment configs if applicable.

  4. 4

    Test your application

    Pounce serves standard ASGI, so any compliant app works without code changes.

Verify Migration

Migration Verification

0/4 complete
  • Pounce installed (pounce --helpworks)
  • Run command replaced (uvicorn → pounce)
  • Dockerfile / systemd updated if applicable
  • Application tested and serving correctly

See Also