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-cookbookdir:
- 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_secretstoworkspace/secrets:
cp -r workspace/example_secrets workspace/secrets- Copy
.envfile:
cp example.env .env- Update
.envfile:
- Set the AI apps like
HACKERNEWS_AIyou'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