An event-driven AI pipeline using FastAPI, Redpanda, and Docker
This minimal demo shows how to build an event-driven AI pipeline using FastAPI as the gateway, Redpanda (or Kafka) as the message broker, and Docker for deployment.
Notifications You must be signed in to change notification settings
Fork 0
Star 0
BranchesTags
Open more actions menu
Folders and files
NameName
Last commit message
Last commit date
Latest commit
History
4 Commits
4 Commits
api-gateway/app
api-gateway/app
shared
shared
workers
workers
.env
.env
Dockerfile
Dockerfile
README.md
README.md
docker-compose.yml
docker-compose.yml
requirements.txt
requirements.txt
Repository files navigation
A minimal demo for Video 3 showing how a FastAPI gateway hands work to Kafka and how separate workers process the event chain.
Project Structure
ai-kafka-pipeline-demo/ ├── api-gateway/ │ └── app/ │ ├── main.py │ ├── routes/submit.py │ ├── services/publisher.py │ └── config.py ├── workers/ │ ├── extractor/ │ ├── summarizer/ │ └── notifier/ ├── shared/ │ ├── kafka/ │ ├── schemas/ │ ├── config/ │ └── utils/ ├── Dockerfile ├── docker-compose.yml ├── requirements.txt └── .env
Demo Flow
POST /submit to the API gateway
Gateway publishes document.submitted
Extractor consumes and publishes text.extracted
Summarizer consumes and publishes summary.generated
Notifier consumes and logs final completion
Run
docker compose up --build
Test
Open another terminal:
curl -X POST http://localhost:8000/submit \ -H "Content-Type: application/json" \ -d '{ "user_id": "user-1", "content": "Kafka helps decouple AI pipeline stages for scalable processing in production systems." }'
What you should see
API returns Processing started
Extractor logs the incoming event
Summarizer logs the next event
Notifier logs the final pipeline completion
Suggested narration
FastAPI handles intake, not heavy processing.
Kafka turns the request into an event.
Each worker owns one stage.
Shared schemas keep the contracts explicit.
This is the simplest form of a production-style AI pipeline.
I also recorded a full visual code walkthrough breaking down the project structure and explaining the design trade-offs here: https://youtu.be/c2ijN2KAWXw
https://youtu.be/KjvbABpajUs
About
This is a sample kafka driven demo
Resources
Readme
Uh oh!
There was an error while loading. Please reload this page.
Activity
Stars
0 stars
Watchers
0 watching
Forks
0 forks
Report repository
Releases
No releases published
Packages 0
Uh oh!
There was an error while loading. Please reload this page.
Contributors
Uh oh!
There was an error while loading. Please reload this page.
Languages
Python 98.8%
Dockerfile 1.2%