An open API service indexing awesome lists of open source software.

https://github.com/mdalamin5/fastapi-for-machine-learning-and-agentic-ai

A practical FastAPI-based repository for building and deploying APIs, starting from web and database projects to serving ML, DL, and LLM models. Ideal for learning scalable AI deployment and modern API design with Python, Pydantic, and production-ready tools like LangChain and HuggingFace.
https://github.com/mdalamin5/fastapi-for-machine-learning-and-agentic-ai

agentic-ai api-server artificial-intelligence auth0 docker fastapi machine-learning restful-api

Last synced: 2 months ago
JSON representation

A practical FastAPI-based repository for building and deploying APIs, starting from web and database projects to serving ML, DL, and LLM models. Ideal for learning scalable AI deployment and modern API design with Python, Pydantic, and production-ready tools like LangChain and HuggingFace.

Awesome Lists containing this project

README

          

# FASTAPI for AI & ML Projects ๐Ÿš€

This repository is a practical playground and professional archive for building and deploying APIs using **FastAPI**, with a special focus on integrating **Machine Learning (ML)**, **Deep Learning (DL)**, and **Large Language Models (LLMs)**.

---

## ๐Ÿ”ฅ Why This Repository?
As modern AI systems increasingly require robust and scalable deployment, this repo is a hands-on learning and development space to:

- Design RESTful APIs for web and database interactions.
- Build and serve AI/ML/DL/LLM models through FastAPI.
- Practice production-level API standards and design patterns.

---

## ๐Ÿ“Œ Goals
- โœ… Practice building RESTful APIs using FastAPI.
- โœ… Integrate databases (e.g., PostgreSQL, MongoDB).
- ๐Ÿ”„ Deploy ML models (scikit-learn, XGBoost, etc.) with FastAPI.
- ๐Ÿ”„ Serve DL models (TensorFlow, PyTorch).
- ๐Ÿ”„ Deploy LLMs with LangChain, HuggingFace, or Groq API.
- โœ… Implement Pydantic models for request validation.
- ๐Ÿ”„ Add authentication (JWT, OAuth2).
- ๐Ÿ”„ Write test cases using pytest.

---

## ๐Ÿงฐ Tech Stack

- **FastAPI** โ€“ Web framework
- **Uvicorn** โ€“ ASGI server
- **SQLAlchemy** โ€“ ORM (for SQL-based projects)
- **MongoDB / PostgreSQL** โ€“ Databases
- **Pydantic** โ€“ Data validation
- **Docker** โ€“ Containerization (future integration)
- **PyTorch / TensorFlow / Scikit-Learn** โ€“ AI/ML/DL libraries
- **LangChain / HuggingFace** โ€“ LLM integrations

---

## ๐Ÿš€ Getting Started

### 1. Clone the Repository
```bash
git https://github.com/MDalamin5/FastAPI-for-Machine-Learning-and-Agentic-Ai.git
```

### 2. Create and Activate Virtual Environment
```bash
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
```

### 3. Install Dependencies
```bash
pip install -r requirements.txt
```

### 4. Run the FastAPI App
```bash
uvicorn main:app --reload
```

Visit `http://127.0.0.1:8000/docs` for the Swagger UI.

---

## ๐Ÿ“„ Example Use Cases
- User authentication system (JWT based)
- Prediction API for housing price model
- Image classification using DL models
- Chatbot with LangChain and vector stores
- AI Tutor API for math or science

---

## ๐Ÿงช Testing
```bash
pytest tests/
```

---

## ๐Ÿ“š Learning Resources
- [FastAPI Documentation](https://fastapi.tiangolo.com/)
- [Full Stack FastAPI PostgreSQL](https://github.com/tiangolo/full-stack-fastapi-postgresql)
- [Deployment with Docker & FastAPI](https://testdriven.io/blog/fastapi-docker/)
- [LangChain Documentation](https://docs.langchain.com/)

---

## ๐Ÿ‘จโ€๐Ÿ’ป Author
**Al-Amin** โ€“ [GitHub](https://github.com/mdalamin5) | [LinkedIn](https://www.linkedin.com/in/mdalamin5)

---

## ๐Ÿ“œ License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

---

## ๐ŸŒŸ Contribute & Star
If you find this repo useful or inspiring, feel free to **star** โญ the project and **contribute** with ideas, code, or improvements!