From 12a98a47b72b7e05f26675d12b49cd49e4692d8e Mon Sep 17 00:00:00 2001 From: Jonas Jaszkowic Date: Thu, 7 Nov 2024 17:00:11 +0100 Subject: [PATCH] Feat/readme (#24) * chore: readme * fix: typo * docs: add @Jaszkowic as a contributor * docs: update @Jaszkowic as a contributor * docs: add @raphael-arce as a contributor * chore: contributors * fix: typo --- .all-contributorsrc | 36 +++++++++++++++++++++++ readme.md | 70 ++++++++++++++++++++++++++++++++++++--------- 2 files changed, 92 insertions(+), 14 deletions(-) create mode 100644 .all-contributorsrc diff --git a/.all-contributorsrc b/.all-contributorsrc new file mode 100644 index 0000000..52872ba --- /dev/null +++ b/.all-contributorsrc @@ -0,0 +1,36 @@ +{ + "projectName": "ber-gpt-backend", + "projectOwner": "technologiestiftung", + "repoType": "github", + "repoHost": "https://github.com", + "files": [ + "README.md" + ], + "imageSize": 100, + "commit": true, + "commitConvention": "angular", + "contributors": [ + { + "login": "Jaszkowic", + "name": "Jonas Jaszkowic", + "avatar_url": "https://avatars.githubusercontent.com/u/10830180?v=4", + "profile": "https://github.com/Jaszkowic", + "contributions": [ + "code", + "infra", + "doc" + ] + }, + { + "login": "raphael-arce", + "name": "Raphael.A", + "avatar_url": "https://avatars.githubusercontent.com/u/8709861?v=4", + "profile": "https://github.com/raphael-arce", + "contributions": [ + "code" + ] + } + ], + "contributorsPerLine": 7, + "linkToUsage": true +} diff --git a/readme.md b/readme.md index 4469d0c..04e4b7d 100644 --- a/readme.md +++ b/readme.md @@ -2,38 +2,54 @@ -[![All Contributors](https://img.shields.io/badge/all_contributors-0-orange.svg?style=flat-square)](#contributors-) +[![All Contributors](https://img.shields.io/badge/all_contributors-2-orange.svg?style=flat-square)](#contributors-) # BärGPT Backend -This project serves as the backend for the "BärGPT" project. It exposes various endpoints which are used to communicate with LLMs. +This project serves as the backend for the "BärGPT" project, see [BärGPT Frontend](https://github.com/technologiestiftung/ber-gpt-frontend). + +It exposes various endpoints which are used to communicate with LLMs. + +It allows for communicating with OpenAI API and a self-hosted LLM on Azure. ## Prerequisites - OpenAI Account and API key (https://platform.openai.com/) +- Azure account and deployed LLM model on Azure (https://azure.com/) - Node.js (https://nodejs.org/en) - NVM (https://github.com/nvm-sh/nvm) -## Installation +## Development setup -- `git clone git@github.com:technologiestiftung/ber-gpt-backend .git` -- `nvm install` -- `nvm use` -- `npm install` +- `git clone git@github.com:technologiestiftung/ber-gpt-backend.git` -## Usage or Deployment +Prepare env variables by copying `.env.sample` to `.env` and setting the appropriate values: -- `npm run dev` +``` +CORS_ALLOWED_ORIGIN=http://localhost:5173 +RATE_LIMIT_REQUESTS_PER_MINUTE=30 +X_API_KEY="set to a secure api key of your choice" -## Development +# config for Azure LLM +AZURE_LLM_API_KEY=... +AZURE_LLM_ENDPOINT="https://.openai.azure.com/openai/deployments/gpt-35-turbo-16k/chat/completions?api-version=2023-03-15-preview" -tbd... +# config for OpenAI LLM +OPENAI_ENDPOINT="https://api.openai.com/v1/chat/completions" +OPENAI_API_KEY=sk-... +``` -## Tests +Install dependencies: -tbd... +- `nvm install && nvm use` +- `npm ci` + +Run the API: + +- `npm run dev` +- API is now running on `http://localhost:3000` ## Contributing @@ -43,6 +59,32 @@ Before you create a pull request, write an issue so we can discuss your changes. Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/docs/en/emoji-key)): + + + + + + + + + + + + + + + +
Jonas Jaszkowic
Jonas Jaszkowic

💻 🚇 📖
Raphael.A
Raphael.A

💻
+ + Add your contributions + +
+ + + + + + @@ -92,4 +134,4 @@ Texts and content available as [CC BY](https://creativecommons.org/licenses/by/3 ## Related Projects -- BärGPT Frontend (https://github.com/technologiestiftung/ber-gpt-frontend) \ No newline at end of file +- BärGPT Frontend (https://github.com/technologiestiftung/ber-gpt-frontend)