<div align="center">
# โก FastAPI Gen
**Create production-ready FastAPI applications in seconds**
*From simple APIs to LLM-enabled applications, all without build configuration.*
<p align="center">
<a href="https://github.com/mirpo/fastapi-gen/actions/workflows/test.yml?query=workflow%3Atest+event%3Apush+branch%main">
<img src="https://github.com/mirpo/fastapi-gen/actions/workflows/test.yml/badge.svg?branch=main" alt="Test Status">
</a>
<a href="https://pypi.org/project/fastapi-gen">
<img src="https://img.shields.io/pypi/v/fastapi-gen?color=%2334D058&label=pypi" alt="PyPI version">
</a>
<a href="https://pypi.org/project/fastapi-gen">
<img src="https://img.shields.io/pypi/pyversions/fastapi-gen.svg?color=%2334D058" alt="Python versions">
</a>
<a href="https://pypi.org/project/fastapi-gen">
<img src="https://img.shields.io/pypi/dm/fastapi-gen?color=blue" alt="Downloads">
</a>
<a href="https://github.com/mirpo/fastapi-gen/blob/main/LICENSE">
<img src="https://img.shields.io/badge/license-MIT-green" alt="License">
</a>
</p>
</div>
## โก Quick Start
Get a fully functional FastAPI app running in **30 seconds**:
```bash
# Install
pip install fastapi-gen
# Create your app
fastapi-gen my_app
# Run it
cd my_app && make start
```
**Or use pipx for one-time execution:**
```bash
pipx run fastapi-gen my_app
cd my_app && make start
```
๐ **That's it!** Open [http://localhost:8000/docs](http://localhost:8000/docs) to see your OpenAPI documentation.
> ๐ก **Platform Support:** Works on macOS and Linux | [Report Issues](https://github.com/mirpo/fastapi-gen/issues/new)
## ๐ฏ Why FastAPI Gen?
<div align="center">
| ๐ฏ **Focus on Code** | ๐ **Production Ready** | ๐งช **Testing Included** | ๐ง **Zero Config** |
|:---:|:---:|:---:|:---:|
| Skip boilerplate setup | Enterprise patterns | Real test coverage | Ready-to-run templates |
</div>
---
## ๐ Templates Overview
<details>
<summary><strong>๐ Hello World</strong> - Perfect for Learning FastAPI</summary>
**๐ฏ Best for:** Learning FastAPI fundamentals and starting new projects
**โจ Key Features:**
- ๐ **REST API Fundamentals** - Complete CRUD with validation
- โ๏ธ **Configuration Management** - Both pydantic-settings & dotenv
- ๐ **Dependency Injection** - Clean architecture with `Depends()`
- ๐ **Background Tasks** - Async processing with logging
- ๐ก๏ธ **Exception Handling** - Professional error responses
- โ
**Input Validation** - Advanced Pydantic constraints
- ๐ **Health Monitoring** - Built-in health endpoints
- ๐งช **Complete Tests** - 100% test coverage
[๐ View Details โ](src/templates/hello_world/README.md)
</details>
<details>
<summary><strong>๐ Advanced</strong> - Enterprise Production Template</summary>
**๐ฏ Best for:** Production applications with enterprise features
**โจ Key Features:**
- ๐ **JWT Authentication** - Registration, login, protected routes
- ๐๏ธ **Database Integration** - SQLAlchemy 2.0 async (SQLite/PostgreSQL)
- ๐ก๏ธ **Rate Limiting** - DDoS protection per endpoint
- โก **Caching System** - In-memory + Redis integration ready
- ๐ **WebSocket Support** - Real-time communication
- ๐ **File Upload** - Secure handling + cloud storage ready
- ๐ **Enhanced Security** - CORS, validation, production patterns
- ๐งช **Full Test Suite** - Auth, CRUD, WebSocket, integration
[๐ View Details โ](src/templates/advanced/README.md)
</details>
<details>
<summary><strong>๐ค NLP</strong> - Comprehensive AI Language Processing</summary>
**๐ฏ Best for:** AI applications with natural language processing
**โจ Key Features:**
- ๐ง **8 NLP Capabilities** - Summarization, NER, generation, QA, embeddings, sentiment, classification, similarity
- ๐๏ธ **Production Architecture** - Startup model loading, device auto-detection
- ๐๏ธ **Smart Configuration** - Environment-based config, multiple models
- โก **Performance Optimized** - Model caching, concurrent handling, hardware acceleration
- ๐ **Production Monitoring** - Health checks, model status, logging
- ๐งช **Real AI Testing** - Actual model inference validation
[๐ View Details โ](src/templates/nlp/README.md)
</details>
<details>
<summary><strong>๐ LangChain</strong> - Modern LLM Integration</summary>
**๐ฏ Best for:** Applications using LangChain for LLM workflows
**โจ Key Features:**
- ๐ **Optimized Loading** - Startup caching, memory management
- ๐ **Modern Patterns** - Latest LangChain best practices
- ๐๏ธ **Smart Config** - Auto device detection (CPU/GPU)
- ๐ **Production Ready** - Health checks, monitoring, error handling
- ๐งช **Real Testing** - Actual model inference tests
- ๐ค **Dual Endpoints** - Text generation & question answering
[๐ View Details โ](src/templates/langchain/README.md)
</details>
<details>
<summary><strong>๐ฆ Llama</strong> - Local LLM Powerhouse</summary>
**๐ฏ Best for:** Local LLM inference with llama-cpp-python
**โจ Key Features:**
- ๐ **Local LLM Focus** - Optimized for Gemma/Llama GGUF models
- โก **GPU Acceleration** - Auto GPU detection, configurable layers
- ๐๏ธ **Advanced Config** - Context windows, threading, performance tuning
- ๐๏ธ **Production Ready** - Lifecycle management, health monitoring
- ๐งช **Real Testing** - Actual model inference validation
- ๐ง **Easy Setup** - Auto model download, optimized defaults
> โ ๏ธ **Requirements:** ~4GB model download + 4GB+ RAM
[๐ View Details โ](src/templates/llama/README.md)
</details>
---
## ๐ Template Comparison
| Template | Best For | Complexity | AI/ML | Database | Auth |
|----------|----------|------------|--------|----------|------|
| ๐ **Hello World** | Learning, Simple APIs | โญ | โ | โ | โ |
| ๐ **Advanced** | Production Apps | โญโญโญ | โ | โ
| โ
|
| ๐ค **NLP** | AI Text Processing | โญโญโญโญ | โ
| โ | โ |
| ๐ **LangChain** | LLM Workflows | โญโญโญโญ | โ
| โ | โ |
| ๐ฆ **Llama** | Local LLM | โญโญโญโญโญ | โ
| โ | โ |
## โจ What You Get Out of the Box
<div align="center">
๐ง **Zero Configuration** โข ๐ **Production Patterns** โข ๐งช **Complete Testing** โข ๐ **Code Quality** โข ๐ **Auto Documentation** โข ๐ **Deployment Ready**
</div>
**๐ฏ Focus on Your Code, Not Setup**
All dependencies (FastAPI, Pydantic, Pytest, etc.) are preconfigured. Just create and run:
```bash
fastapi-gen my_app # Create
cd my_app # Enter
make start # Run!
```
**๐ฆ Every Template Includes:**
- โก **Ready-to-run** development environment
- ๐๏ธ **Industry-standard** project structure
- ๐งช **Comprehensive** test suites with examples
- ๐ **Ruff** linting and formatting
- ๐ **Auto-generated** OpenAPI documentation
- ๐ ๏ธ **Makefile** with common development commands
## Creating an App
**You'll need to have Python 3.12+ or later version on your local development machine**. We recommend using the latest LTS version. You can use [pyenv](https://github.com/pyenv/pyenv) (macOS/Linux) to switch Python versions between different projects.
### Basic template
```console
pip3 install fastapi-gen
fastapi-gen my_app
```
or
```console
pip3 install fastapi-gen
fastapi-gen my_app --template hello_world
```
### Advanced template
```console
pip3 install fastapi-gen
fastapi-gen my_app --template advanced
```
### NLP template
```console
pip install fastapi-gen
fastapi-gen my_app --template nlp
```
### Langchain template
```console
pip install fastapi-gen
fastapi-gen my_app --template Langchain
```
### Llama template
```console
pip install fastapi-gen
fastapi-gen my_app --template llama
```
Inside the newly created project, you can run some built-in commands:
### `make start`
Runs the app in development mode.<br>
Open [http://localhost:8000/docs](http://localhost:8000/docs) to view OpenAPI documentation in the browser.
The page will automatically reload if you make changes to the code.
### `make test`
Runs tests.<br>
By default, runs tests related to files changed since the last commit.
## License
`fastapi-gen` is distributed under the terms of the [MIT](https://github.com/mirpo/fastapi-gen/blob/main/LICENSE) license.
Raw data
{
"_id": null,
"home_page": null,
"name": "fastapi-gen",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.12",
"maintainer_email": null,
"keywords": "cli, fastapi, hello world, huggingface, langchain, llama, llama.cpp, named-entity recognition, ner, nlp, summarization, text generation",
"author": null,
"author_email": "Miroslav Pokrovskii <miroslavpokrovskiy@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/e3/49/808ddf849fd14f0e444e63fb161aaa6d06a60b92dea7f43a6d8169169779/fastapi_gen-0.9.0.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n \n# \u26a1 FastAPI Gen\n\n**Create production-ready FastAPI applications in seconds**\n\n*From simple APIs to LLM-enabled applications, all without build configuration.*\n\n<p align=\"center\">\n <a href=\"https://github.com/mirpo/fastapi-gen/actions/workflows/test.yml?query=workflow%3Atest+event%3Apush+branch%main\">\n <img src=\"https://github.com/mirpo/fastapi-gen/actions/workflows/test.yml/badge.svg?branch=main\" alt=\"Test Status\">\n </a>\n <a href=\"https://pypi.org/project/fastapi-gen\">\n <img src=\"https://img.shields.io/pypi/v/fastapi-gen?color=%2334D058&label=pypi\" alt=\"PyPI version\">\n </a>\n <a href=\"https://pypi.org/project/fastapi-gen\">\n <img src=\"https://img.shields.io/pypi/pyversions/fastapi-gen.svg?color=%2334D058\" alt=\"Python versions\">\n </a>\n <a href=\"https://pypi.org/project/fastapi-gen\">\n <img src=\"https://img.shields.io/pypi/dm/fastapi-gen?color=blue\" alt=\"Downloads\">\n </a>\n <a href=\"https://github.com/mirpo/fastapi-gen/blob/main/LICENSE\">\n <img src=\"https://img.shields.io/badge/license-MIT-green\" alt=\"License\">\n </a>\n</p>\n\n</div>\n\n## \u26a1 Quick Start\n\nGet a fully functional FastAPI app running in **30 seconds**:\n\n```bash\n# Install\npip install fastapi-gen\n\n# Create your app\nfastapi-gen my_app\n\n# Run it\ncd my_app && make start\n```\n\n**Or use pipx for one-time execution:**\n```bash\npipx run fastapi-gen my_app\ncd my_app && make start\n```\n\n\ud83d\ude80 **That's it!** Open [http://localhost:8000/docs](http://localhost:8000/docs) to see your OpenAPI documentation.\n\n> \ud83d\udca1 **Platform Support:** Works on macOS and Linux | [Report Issues](https://github.com/mirpo/fastapi-gen/issues/new)\n\n## \ud83c\udfaf Why FastAPI Gen?\n\n<div align=\"center\">\n\n| \ud83c\udfaf **Focus on Code** | \ud83d\ude80 **Production Ready** | \ud83e\uddea **Testing Included** | \ud83d\udd27 **Zero Config** |\n|:---:|:---:|:---:|:---:|\n| Skip boilerplate setup | Enterprise patterns | Real test coverage | Ready-to-run templates |\n\n</div>\n\n---\n\n## \ud83d\udcda Templates Overview\n\n<details>\n<summary><strong>\ud83d\udcda Hello World</strong> - Perfect for Learning FastAPI</summary>\n\n**\ud83c\udfaf Best for:** Learning FastAPI fundamentals and starting new projects\n\n**\u2728 Key Features:**\n- \ud83c\udf10 **REST API Fundamentals** - Complete CRUD with validation\n- \u2699\ufe0f **Configuration Management** - Both pydantic-settings & dotenv\n- \ud83d\udd04 **Dependency Injection** - Clean architecture with `Depends()`\n- \ud83d\udccb **Background Tasks** - Async processing with logging\n- \ud83d\udee1\ufe0f **Exception Handling** - Professional error responses\n- \u2705 **Input Validation** - Advanced Pydantic constraints\n- \ud83d\udc8a **Health Monitoring** - Built-in health endpoints\n- \ud83e\uddea **Complete Tests** - 100% test coverage\n\n[\ud83d\udcd6 View Details \u2192](src/templates/hello_world/README.md)\n\n</details>\n\n<details>\n<summary><strong>\ud83d\ude80 Advanced</strong> - Enterprise Production Template</summary>\n\n**\ud83c\udfaf Best for:** Production applications with enterprise features\n\n**\u2728 Key Features:**\n- \ud83d\udd10 **JWT Authentication** - Registration, login, protected routes\n- \ud83d\uddc4\ufe0f **Database Integration** - SQLAlchemy 2.0 async (SQLite/PostgreSQL)\n- \ud83d\udee1\ufe0f **Rate Limiting** - DDoS protection per endpoint\n- \u26a1 **Caching System** - In-memory + Redis integration ready\n- \ud83d\udd04 **WebSocket Support** - Real-time communication\n- \ud83d\udcc1 **File Upload** - Secure handling + cloud storage ready\n- \ud83d\udd12 **Enhanced Security** - CORS, validation, production patterns\n- \ud83e\uddea **Full Test Suite** - Auth, CRUD, WebSocket, integration\n\n[\ud83d\udcd6 View Details \u2192](src/templates/advanced/README.md)\n\n</details>\n\n<details>\n<summary><strong>\ud83e\udd16 NLP</strong> - Comprehensive AI Language Processing</summary>\n\n**\ud83c\udfaf Best for:** AI applications with natural language processing\n\n**\u2728 Key Features:**\n- \ud83e\udde0 **8 NLP Capabilities** - Summarization, NER, generation, QA, embeddings, sentiment, classification, similarity\n- \ud83c\udfd7\ufe0f **Production Architecture** - Startup model loading, device auto-detection\n- \ud83c\udf9b\ufe0f **Smart Configuration** - Environment-based config, multiple models\n- \u26a1 **Performance Optimized** - Model caching, concurrent handling, hardware acceleration\n- \ud83d\udc8a **Production Monitoring** - Health checks, model status, logging\n- \ud83e\uddea **Real AI Testing** - Actual model inference validation\n\n[\ud83d\udcd6 View Details \u2192](src/templates/nlp/README.md)\n\n</details>\n\n<details>\n<summary><strong>\ud83d\udd17 LangChain</strong> - Modern LLM Integration</summary>\n\n**\ud83c\udfaf Best for:** Applications using LangChain for LLM workflows\n\n**\u2728 Key Features:**\n- \ud83d\ude80 **Optimized Loading** - Startup caching, memory management\n- \ud83c\udd95 **Modern Patterns** - Latest LangChain best practices\n- \ud83c\udf9b\ufe0f **Smart Config** - Auto device detection (CPU/GPU)\n- \ud83d\udc8a **Production Ready** - Health checks, monitoring, error handling\n- \ud83e\uddea **Real Testing** - Actual model inference tests\n- \ud83e\udd16 **Dual Endpoints** - Text generation & question answering\n\n[\ud83d\udcd6 View Details \u2192](src/templates/langchain/README.md)\n\n</details>\n\n<details>\n<summary><strong>\ud83e\udd99 Llama</strong> - Local LLM Powerhouse</summary>\n\n**\ud83c\udfaf Best for:** Local LLM inference with llama-cpp-python\n\n**\u2728 Key Features:**\n- \ud83c\udfe0 **Local LLM Focus** - Optimized for Gemma/Llama GGUF models\n- \u26a1 **GPU Acceleration** - Auto GPU detection, configurable layers\n- \ud83c\udf9b\ufe0f **Advanced Config** - Context windows, threading, performance tuning\n- \ud83c\udfd7\ufe0f **Production Ready** - Lifecycle management, health monitoring\n- \ud83e\uddea **Real Testing** - Actual model inference validation\n- \ud83d\udd27 **Easy Setup** - Auto model download, optimized defaults\n\n> \u26a0\ufe0f **Requirements:** ~4GB model download + 4GB+ RAM\n\n[\ud83d\udcd6 View Details \u2192](src/templates/llama/README.md)\n\n</details>\n\n---\n\n## \ud83d\ude80 Template Comparison\n\n| Template | Best For | Complexity | AI/ML | Database | Auth |\n|----------|----------|------------|--------|----------|------|\n| \ud83d\udcda **Hello World** | Learning, Simple APIs | \u2b50 | \u274c | \u274c | \u274c |\n| \ud83d\ude80 **Advanced** | Production Apps | \u2b50\u2b50\u2b50 | \u274c | \u2705 | \u2705 |\n| \ud83e\udd16 **NLP** | AI Text Processing | \u2b50\u2b50\u2b50\u2b50 | \u2705 | \u274c | \u274c |\n| \ud83d\udd17 **LangChain** | LLM Workflows | \u2b50\u2b50\u2b50\u2b50 | \u2705 | \u274c | \u274c |\n| \ud83e\udd99 **Llama** | Local LLM | \u2b50\u2b50\u2b50\u2b50\u2b50 | \u2705 | \u274c | \u274c |\n\n## \u2728 What You Get Out of the Box\n\n<div align=\"center\">\n\n\ud83d\udd27 **Zero Configuration** \u2022 \ud83d\udcdd **Production Patterns** \u2022 \ud83e\uddea **Complete Testing** \u2022 \ud83d\udd0d **Code Quality** \u2022 \ud83d\udcda **Auto Documentation** \u2022 \ud83d\ude80 **Deployment Ready**\n\n</div>\n\n**\ud83c\udfaf Focus on Your Code, Not Setup**\n\nAll dependencies (FastAPI, Pydantic, Pytest, etc.) are preconfigured. Just create and run:\n\n```bash\nfastapi-gen my_app # Create\ncd my_app # Enter \nmake start # Run!\n```\n\n**\ud83d\udce6 Every Template Includes:**\n- \u26a1 **Ready-to-run** development environment\n- \ud83c\udfd7\ufe0f **Industry-standard** project structure\n- \ud83e\uddea **Comprehensive** test suites with examples\n- \ud83d\udd0d **Ruff** linting and formatting\n- \ud83d\udcda **Auto-generated** OpenAPI documentation\n- \ud83d\udee0\ufe0f **Makefile** with common development commands\n\n## Creating an App\n\n**You'll need to have Python 3.12+ or later version on your local development machine**. We recommend using the latest LTS version. You can use [pyenv](https://github.com/pyenv/pyenv) (macOS/Linux) to switch Python versions between different projects.\n\n### Basic template\n\n```console\npip3 install fastapi-gen\nfastapi-gen my_app\n```\n\nor\n\n```console\npip3 install fastapi-gen\nfastapi-gen my_app --template hello_world\n```\n\n### Advanced template\n\n```console\npip3 install fastapi-gen\nfastapi-gen my_app --template advanced\n```\n\n### NLP template\n\n```console\npip install fastapi-gen\nfastapi-gen my_app --template nlp\n```\n\n### Langchain template\n\n```console\npip install fastapi-gen\nfastapi-gen my_app --template Langchain\n```\n\n### Llama template\n\n```console\npip install fastapi-gen\nfastapi-gen my_app --template llama\n```\n\nInside the newly created project, you can run some built-in commands:\n\n### `make start`\n\nRuns the app in development mode.<br>\nOpen [http://localhost:8000/docs](http://localhost:8000/docs) to view OpenAPI documentation in the browser.\n\nThe page will automatically reload if you make changes to the code.\n\n### `make test`\n\nRuns tests.<br>\nBy default, runs tests related to files changed since the last commit.\n\n## License\n\n`fastapi-gen` is distributed under the terms of the [MIT](https://github.com/mirpo/fastapi-gen/blob/main/LICENSE) license.",
"bugtrack_url": null,
"license": null,
"summary": "Set up a modern REST API by running one command.",
"version": "0.9.0",
"project_urls": {
"Documentation": "https://github.com/mirpo/fastapi-gen#readme",
"Issues": "https://github.com/mirpo/fastapi-gen/issues",
"Source": "https://github.com/mirpo/fastapi-gen"
},
"split_keywords": [
"cli",
" fastapi",
" hello world",
" huggingface",
" langchain",
" llama",
" llama.cpp",
" named-entity recognition",
" ner",
" nlp",
" summarization",
" text generation"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "97b1416816181e0b3983ac8972423f37e95d147db44abe194c17dc1aee840fdc",
"md5": "e375131bcb73c459a7ee660fd65fffd5",
"sha256": "942cf7142a396183ae48fe00de9263ffbc9d760dbb950651ff3f5ff324aeb0e5"
},
"downloads": -1,
"filename": "fastapi_gen-0.9.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "e375131bcb73c459a7ee660fd65fffd5",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.12",
"size": 70610,
"upload_time": "2025-06-29T18:25:15",
"upload_time_iso_8601": "2025-06-29T18:25:15.713252Z",
"url": "https://files.pythonhosted.org/packages/97/b1/416816181e0b3983ac8972423f37e95d147db44abe194c17dc1aee840fdc/fastapi_gen-0.9.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "e349808ddf849fd14f0e444e63fb161aaa6d06a60b92dea7f43a6d8169169779",
"md5": "e6b72d499fdef73769c09d84135d6a85",
"sha256": "6f14720661f24604508f89ebe6261f0f9d00571eb49ab882f1fccfcfca27a991"
},
"downloads": -1,
"filename": "fastapi_gen-0.9.0.tar.gz",
"has_sig": false,
"md5_digest": "e6b72d499fdef73769c09d84135d6a85",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.12",
"size": 55499,
"upload_time": "2025-06-29T18:25:17",
"upload_time_iso_8601": "2025-06-29T18:25:17.448731Z",
"url": "https://files.pythonhosted.org/packages/e3/49/808ddf849fd14f0e444e63fb161aaa6d06a60b92dea7f43a6d8169169779/fastapi_gen-0.9.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-06-29 18:25:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "mirpo",
"github_project": "fastapi-gen#readme",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "fastapi-gen"
}