# FastApi Gen
Create LLM-enabled FastAPI applications without build configuration.
<a href="https://github.com/mirpo/fastapi-gen/actions/workflows/test.yml?query=workflow%3Atest+event%3Apush+branch%3Amaster" target="_blank"><img src="https://github.com/mirpo/fastapi-gen/actions/workflows/test.yml/badge.svg?branch=master" alt="Test"></a>
<a href="https://pypi.org/project/fastapi-gen" target="_blank"><img src="https://img.shields.io/pypi/v/fastapi-gen?color=%2334D058&label=pypi%20package" alt="Package version"></a>
<a href="https://pypi.org/project/fastapi-gen" target="_blank"><img src="https://img.shields.io/pypi/pyversions/fastapi-gen.svg?color=%2334D058" alt="Supported Python versions"></a>
---
FastApi Gen works on macOS and Linux.<br>
If something doesn’t work, please [file an issue](https://github.com/mirpo/fastapi-gen/issues/new).
## Quick Overview
```console
pip3 install fastapi-gen
fastapi-gen my_app
cd my_app
make start-dev
```
or
```console
pipx run fastapi-gen my_app
cd my_app
make start-dev
```
If you've previously installed `fastapi-gen` globally via `pip3 install fastapi-gen`, we recommend you reinstall the package using `pip3 install --upgrade --force-reinstall fastapi-gen` or `pipx upgrade fastapi-gen` to ensure that you use the latest version.
Then open http://localhost:8000/docs to see your app OpenAPI documentation.
Available templates:
1. Default - basic template with GET/POST examples.
2. NLP - natural language processing template with examples how to use local Hugginface models for summarization, named-entity recognition and text generation using LLM.
3. Langchain - template with examples how to use LangChain with local Hugginface models (LLMs) for text generation and question answering.
4. Llama - template with examples how to use llama.cpp and llama-cpp-python with local Llama 2 for question asnwering.
*Important notes*:
- Langchain template requires hardware to run and will automatically download required models, be patient.
- Llama template will download around 4GB model from Hugginface and >4GB of RAM.
Each template includes not only code, but also **tests**.
### Get Started Immediately
You **don’t** need to install or configure depencendeices like FastApi or Pytest.<br>
They are preconfigured and hidden so that you can focus on the code.
Create a project, and you’re good to go.
## Creating an App
**You’ll need to have Python 3.7+ 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
```
### 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/master/LICENSE) license.
Raw data
{
"_id": null,
"home_page": null,
"name": "fastapi-gen",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"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/52/0d/e94b26f5faab1f505b81e37f8e4f27384a5b8f2595264a57c8c4f230277d/fastapi_gen-0.6.1.tar.gz",
"platform": null,
"description": "# FastApi Gen\n\nCreate LLM-enabled FastAPI applications without build configuration.\n\n<a href=\"https://github.com/mirpo/fastapi-gen/actions/workflows/test.yml?query=workflow%3Atest+event%3Apush+branch%3Amaster\" target=\"_blank\"><img src=\"https://github.com/mirpo/fastapi-gen/actions/workflows/test.yml/badge.svg?branch=master\" alt=\"Test\"></a>\n<a href=\"https://pypi.org/project/fastapi-gen\" target=\"_blank\"><img src=\"https://img.shields.io/pypi/v/fastapi-gen?color=%2334D058&label=pypi%20package\" alt=\"Package version\"></a>\n<a href=\"https://pypi.org/project/fastapi-gen\" target=\"_blank\"><img src=\"https://img.shields.io/pypi/pyversions/fastapi-gen.svg?color=%2334D058\" alt=\"Supported Python versions\"></a>\n\n---\n\nFastApi Gen works on macOS and Linux.<br>\nIf something doesn\u2019t work, please [file an issue](https://github.com/mirpo/fastapi-gen/issues/new).\n\n## Quick Overview\n\n```console\npip3 install fastapi-gen\nfastapi-gen my_app\ncd my_app\nmake start-dev\n```\n\nor \n\n```console\npipx run fastapi-gen my_app\ncd my_app\nmake start-dev\n```\n\nIf you've previously installed `fastapi-gen` globally via `pip3 install fastapi-gen`, we recommend you reinstall the package using `pip3 install --upgrade --force-reinstall fastapi-gen` or `pipx upgrade fastapi-gen` to ensure that you use the latest version.\n\nThen open http://localhost:8000/docs to see your app OpenAPI documentation.\n\nAvailable templates:\n\n1. Default - basic template with GET/POST examples.\n2. NLP - natural language processing template with examples how to use local Hugginface models for summarization, named-entity recognition and text generation using LLM.\n3. Langchain - template with examples how to use LangChain with local Hugginface models (LLMs) for text generation and question answering.\n4. Llama - template with examples how to use llama.cpp and llama-cpp-python with local Llama 2 for question asnwering.\n\n*Important notes*:\n- Langchain template requires hardware to run and will automatically download required models, be patient.\n- Llama template will download around 4GB model from Hugginface and >4GB of RAM.\n\nEach template includes not only code, but also **tests**.\n\n### Get Started Immediately\n\nYou **don\u2019t** need to install or configure depencendeices like FastApi or Pytest.<br>\nThey are preconfigured and hidden so that you can focus on the code.\n\nCreate a project, and you\u2019re good to go.\n\n## Creating an App\n\n**You\u2019ll need to have Python 3.7+ 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### 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/master/LICENSE) license.\n",
"bugtrack_url": null,
"license": null,
"summary": "Set up a modern REST API by running one command.",
"version": "0.6.1",
"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": "",
"digests": {
"blake2b_256": "db98766dcdbb74d5db529f0f763f12934f594bb4e07e351f9062880ca608c304",
"md5": "571c614469e5552e853011e25e7440f4",
"sha256": "706bf7d0758173ba427e3760eeaa599e549bd4c57690550ff2b00be57cb8e6f1"
},
"downloads": -1,
"filename": "fastapi_gen-0.6.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "571c614469e5552e853011e25e7440f4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 27879,
"upload_time": "2024-10-13T15:08:28",
"upload_time_iso_8601": "2024-10-13T15:08:28.359100Z",
"url": "https://files.pythonhosted.org/packages/db/98/766dcdbb74d5db529f0f763f12934f594bb4e07e351f9062880ca608c304/fastapi_gen-0.6.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "520de94b26f5faab1f505b81e37f8e4f27384a5b8f2595264a57c8c4f230277d",
"md5": "548b5df47a38747509eae9405bd9072c",
"sha256": "28213df933c4ff2c3cf25839181d1c9ccd8d1b3b0a380db0c7f63a38a0fc2a6f"
},
"downloads": -1,
"filename": "fastapi_gen-0.6.1.tar.gz",
"has_sig": false,
"md5_digest": "548b5df47a38747509eae9405bd9072c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 13244,
"upload_time": "2024-10-13T15:08:30",
"upload_time_iso_8601": "2024-10-13T15:08:30.118133Z",
"url": "https://files.pythonhosted.org/packages/52/0d/e94b26f5faab1f505b81e37f8e4f27384a5b8f2595264a57c8c4f230277d/fastapi_gen-0.6.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-13 15:08:30",
"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"
}