https://www.loom.com/share/fea73acba34948c09b7e7960dc1d1cd1
https://www.loom.com/share/81cad00f51b04b1ab823cb3f58fda866
Edit: Streaming is now implemented! Use it through the Streamlit UI or find the endpoints on the API documentation page
- TinyGen UI
- Production API Base Url
- Public Postman Collection To Interact With API
- TinyGen Project Overview
- Python
- FastAPI
- Google Cloud Run (API Deployment)
- Streamlit & Streamlit Cloud (Frontend + Deployment)
- Supabase (LLM Call Storage)
- Clone the project project to your computer
git clone https://github.com/tawsifkamal/TinyGen.git
- Navigate to this project in your terminal
cd TinyGen
- Obtain the secrets. Use your own or contact me!
If using your own, create a .env file and add the following api keys:
GITHUB_API_TOKEN=
SUPABASE_URL=
SUPABASE_KEY=
OPENAI_API_KEY=
- Github API is required to process all of the files from a given repository
- Supabase is used to store all of the prompts, repoUrls, and responses provided to TinyGen
- OpenAI is the provider for all models used for TinyGen (GPT-4 and GPT-3.5)
- Install Virtualenv if not it does not exist on your local machine:
pip install virtualenv
- Create a virtual environment
virtualenv venv
- Activate the virtual environment
source venv/bin/activate
- Install all necessary packages
pip install -r requirements.txt
- Start the Fast API Server
uvicorn api.api:app --reload
- Open another terminal and start the streamlit frontend
streamlit run frontend/🤖_TinyGen.py
I know it's a bit wierd to have a funky emoji for a file name. But that's how Streamlit chose to do its user design.🤷🏽♂️ Please let me know if you do have any problems with running the file!
The following endpoints are available when making api calls. A public workspace on postman is linked here
Full link
Otherwise, feel free to call the APIs yourself using your preferred API client. The endpoints are listed below:
If using local API, base_url = http://localhost:8000
If using prod API, base_url = https://tiny-gen-zbkbev3qaq-uc.a.run.app
Tip! The docs for the API is located at the root endpoint /
Call TinyGen 1.0
POST /tiny_gen_one/call
- Body Schema = {repoUrl: str, prompt: str}
Call TinyGen 2.0
POST /tiny_gen_two/call
- Body Schema = {repoUrl: str, prompt: str}
Fetch Past TinyGen 1.0 Calls From Supabase
GET /tiny_gen_one/get_past_calls
Fetch Past TinyGen 2.0 Calls From Supabase
GET /tiny_gen_two/get_past_calls
Get API Docs
GET /tiny_gen_two/get_past_calls