https://github.com/thesurlydev/langchain-services
Various FastAPI endpoints backed by LangChain
https://github.com/thesurlydev/langchain-services
Last synced: 11 months ago
JSON representation
Various FastAPI endpoints backed by LangChain
- Host: GitHub
- URL: https://github.com/thesurlydev/langchain-services
- Owner: thesurlydev
- Created: 2023-07-07T15:56:06.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-18T15:35:42.000Z (about 2 years ago)
- Last Synced: 2025-02-06T18:52:28.543Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 755 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# langchain-services
Various [FastAPI](https://fastapi.tiangolo.com/) endpoints backed by [LangChain](https://langchain.com/).
Two endpoints are currently used by another project, [cover-letter](https://github.com/digitalsanctum/cover-letter), which is used for generating employment cover letters.
## prerequisites
* [poetry](https://python-poetry.org/)
* [uvicorn](https://www.uvicorn.org/) - an ASGI web server implementation for Python
* API keys for SERPAPI and OpenAI.
## run locally
Install dependencies and start the service:
```shell
poetry install
export OPENAI_API_KEY="your key here"
export SERPAPI_API_KEY="your key here"
export LANGCHAIN_SERVICES_API_KEY="your key here"
uvicorn main:app --reload
```
## deploy to fly.io
```shell
fly deploy --app langchain-services --vm-size shared-cpu-1x
```
## test
```shell
curl -s "http://localhost:8000" -d '{"query": "whats the capital of usa"}' -H 'Content-Type: application/json' | jq
```
or using the IntelliJ HTTP Client:
```shell
ijhttp -L VERBOSE test.http
```
### IntelliJ HTTP Client install
```shell
curl -f -L -o ijhttp.zip "https://jb.gg/ijhttp/latest"
unzip ijhttp.zip
```
Then place in your `PATH`