How diegojrobles/ai-server works
AI Server is a Flask REST API for sentiment analysis, with API-key protection, per-IP rate limiting, health and model-list endpoints, and lazy model loading. The principal workflow is a client request to /predict, through rate limiting and authentication, to model inference and a JSON prediction response. Environment settings configure the server, security, and inference. The README also describes a planned async multi-provider gateway; that is future work, not part of the current architecture. The map reflects sampled runtime source; unsampled integrations are omitted.
Main entry points: server.py Flask API routes · model_handler.py Model handler · settings.py Environment settings
Components 7
API layer
- Flask API routes
app/server.py - Rate limiting
app/server.py - API-key auth
app/server.py
Inference
- Model handler
app/model_handler.py - Transformers pipeline
Configuration
- Environment settings
config/settings.py
Other components
- API client
Connections 7
- API client → Flask API routes: sends requests
- Flask API routes → Rate limiting: limits predictions
- Rate limiting → API-key auth: checks key
- API-key auth → Model handler: requests inference
- Model handler → Transformers pipeline: loads and predicts
- Flask API routes → Environment settings: reads settings
- Model handler → Environment settings: reads model config