# 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/ff/fa/1e0adf58137bf4b5c7f8145440552ea8f39e801999ae9c7c6abef04c54eb/fastapi_gen-0.5.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\">\n <img src=\"https://github.com/mirpo/fastapi-gen/actions/workflows/test.yml/badge.svg?branch=master\" alt=\"Test\">\n</a>\n<a href=\"https://pypi.org/project/fastapi-gen\" target=\"_blank\">\n <img src=\"https://img.shields.io/pypi/v/fastapi-gen?color=%2334D058&label=pypi%20package\" alt=\"Package version\">\n</a>\n<a href=\"https://pypi.org/project/fastapi-gen\" target=\"_blank\">\n <img src=\"https://img.shields.io/pypi/pyversions/fastapi-gen.svg?color=%2334D058\" alt=\"Supported Python versions\">\n</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.5.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": "2ae698dbfec79ffe6afc13d52866f8c099a82984a79909b2543b62fc5126a191",
"md5": "9bdbced3a3a114b55f92df23002d5144",
"sha256": "1cca4f3642318cf4036084b6287b45e52edcb81d28e21af597b0623fec489475"
},
"downloads": -1,
"filename": "fastapi_gen-0.5.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9bdbced3a3a114b55f92df23002d5144",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 27102,
"upload_time": "2024-04-21T17:02:28",
"upload_time_iso_8601": "2024-04-21T17:02:28.861505Z",
"url": "https://files.pythonhosted.org/packages/2a/e6/98dbfec79ffe6afc13d52866f8c099a82984a79909b2543b62fc5126a191/fastapi_gen-0.5.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fffa1e0adf58137bf4b5c7f8145440552ea8f39e801999ae9c7c6abef04c54eb",
"md5": "f7e1ffe3d4412610389f89170aa3d11d",
"sha256": "2c31f0cb4da16dc61a84e635d68c3067be671a1cf4ac079bfa41bd71f2c93bba"
},
"downloads": -1,
"filename": "fastapi_gen-0.5.1.tar.gz",
"has_sig": false,
"md5_digest": "f7e1ffe3d4412610389f89170aa3d11d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 12712,
"upload_time": "2024-04-21T17:02:30",
"upload_time_iso_8601": "2024-04-21T17:02:30.623206Z",
"url": "https://files.pythonhosted.org/packages/ff/fa/1e0adf58137bf4b5c7f8145440552ea8f39e801999ae9c7c6abef04c54eb/fastapi_gen-0.5.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-21 17:02: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"
}