This repo contains a collection of AI recipes/patterns built using phidata
The AI cookbook apps are live and can be accessed at:
- HackerNews AI that interacts with the HN API to summarize stories, users, find out what's trending, summarize topics.
- Streamlit App serving a PDF, Image and Website Assistant (password: admin)
- FastApi serving a PDF Assistant.
- Clone the git repo
from the
ai-cookbook
dir:
- Create + activate a virtual env:
python3 -m venv aienv
source aienv/bin/activate
- Install
phidata
:
pip install phidata
- Setup workspace:
phi ws setup
- Copy
workspace/example_secrets
toworkspace/secrets
:
cp -r workspace/example_secrets workspace/secrets
- Copy
.env
file:
cp example.env .env
- Update
.env
file:
- Set the AI apps like
HACKERNEWS_AI
you'd like to enable as True - Set your
OPENAI_API_KEY
HACKERNEWS_AI=True
# OPENAI_API_KEY=sk-***
- You can also export these as environment variable like:
export OPENAI_API_KEY=sk-***
-
Install docker desktop
-
Start the workspace using:
phi ws up
- Open localhost:8501 to view the Streamlit App.
- Open localhost:8000/docs to view the FastApi docs.
- If HackerNews AI is enabled, open localhost:8502 to view HackerNews AI.
- If Jupyter is enabled, open localhost:8888 to view JupyterLab UI.
- Stop the workspace using:
phi ws down