free-claude-code/server.py
Alishahryar1 f3a7528d49
Some checks are pending
CI / checks (push) Waiting to run
Major refactor: API, providers, messaging, and Anthropic protocol
Consolidates the incremental refactor work into a single change set: modular web tools (api/web_tools), native Anthropic request building and SSE block policy, OpenAI conversion and error handling, provider transports and rate limiting, messaging handler and tree queue, safe logging, smoke tests, and broad test coverage.
2026-04-26 03:01:14 -07:00

32 lines
880 B
Python

"""
Claude Code Proxy - Entry Point
Minimal entry point that builds the ASGI app via :func:`api.app.create_app`.
Run with: uv run uvicorn server:app --host 0.0.0.0 --port 8082 --timeout-graceful-shutdown 5
"""
from api.app import create_app
app = create_app()
__all__ = ["app", "create_app"]
if __name__ == "__main__":
import uvicorn
from cli.process_registry import kill_all_best_effort
from config.settings import get_settings
settings = get_settings()
try:
# timeout_graceful_shutdown ensures uvicorn doesn't hang on task cleanup.
uvicorn.run(
app,
host=settings.host,
port=settings.port,
log_level="debug",
timeout_graceful_shutdown=5,
)
finally:
# Safety net: cleanup subprocesses if lifespan shutdown doesn't fully run.
kill_all_best_effort()