agentsclimarketplace

Uvicorn

Skill ComeOnOliver/skillshub/skills/TerminalSkills/skills/uvicorn

🧠 The right skill, one API call. AI agent skills registry with token-efficient skill resolution. 5,000+ skills from 500+ top repos.From the repository description

Install
npx -y skills add ComeOnOliver/skillshub --skill uvicorn

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

SKILL.md

2.0 KB, 561 tokens by cl100k_base, as published. Nobody here has run it

Uvicorn

Overview

Uvicorn is a lightning-fast ASGI server for Python. It's the recommended way to run FastAPI, Starlette, and Django ASGI in production. For multi-core utilization, pair it with Gunicorn as a process manager.

Instructions

Step 1: Development

pip install uvicorn[standard]

# Run with auto-reload
uvicorn app.main:app --reload --port 8000

Step 2: Production with Gunicorn

pip install gunicorn

# Gunicorn manages multiple Uvicorn worker processes
gunicorn app.main:app \
  --workers 4 \                    # CPU cores × 2 + 1
  --worker-class uvicorn.workers.UvicornWorker \
  --bind 0.0.0.0:8000 \
  --timeout 120 \
  --graceful-timeout 30 \
  --access-logfile - \
  --error-logfile -

Step 3: Docker Production

FROM python:3.12-slim
WORKDIR /app

COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . .

# Non-root user
RUN adduser --system --uid 1001 app
USER app

# Production command
CMD ["gunicorn", "app.main:app", \
     "--workers", "4", \
     "--worker-class", "uvicorn.workers.UvicornWorker", \
     "--bind", "0.0.0.0:8000", \
     "--timeout", "120"]

Step 4: Programmatic Configuration

# run.py — Uvicorn with programmatic config
import uvicorn

if __name__ == "__main__":
    uvicorn.run(
        "app.main:app",
        host="0.0.0.0",
        port=8000,
        workers=4,
        log_level="info",
        access_log=True,
        proxy_headers=True,        # trust X-Forwarded-* from reverse proxy
        forwarded_allow_ips="*",
    )

Guidelines

  • Development: uvicorn --reload (single process, auto-reload on file changes).
  • Production: gunicorn with UvicornWorker class (multi-process, no reload).
  • Workers formula: (2 × CPU cores) + 1 — e.g., 4 cores → 9 workers.
  • Always use behind a reverse proxy (nginx, Caddy) for TLS termination and static files.
  • Set proxy_headers=True when behind a load balancer to get real client IPs.

What ships with it

Read from the repository

Just SKILL.md. No reference files, no scripts.

Keep looking

Skills are one crate of 325,949. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.