Skip to content

Add FastAPI inference service with Docker deployment#6

Open
bchadburn wants to merge 2 commits into
masterfrom
feature/fastapi-inference-service
Open

Add FastAPI inference service with Docker deployment#6
bchadburn wants to merge 2 commits into
masterfrom
feature/fastapi-inference-service

Conversation

@bchadburn

Copy link
Copy Markdown
Owner

Summary

  • Adds api/ package with FastAPI service (main.py), Pydantic schemas (models.py), and a singleton Recommender class that encapsulates the two-tower + LightGBM inference path
  • Dockerfile (multi-stage, python:3.11-slim) and docker-compose.yml for one-command deployment
  • requirements-api.txt with fastapi and uvicorn pinned separately from ML deps
  • README "Running the API" section with endpoints table and example curl request

Test plan

  • docker compose up — service starts, /health returns {"status": "ok"}
  • POST /recommend with user_id=0, top_k=5 returns 5 items with valid fields
  • POST /recommend with user_id=9999 returns 422 with error message
  • Interactive docs load at http://localhost:8000/docs

Closes #1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add FastAPI inference service with Docker deployment

1 participant