Skip to content

phidatahq/ai-cookbook

Repository files navigation

AI Cookbook

This repo contains a collection of AI recipes/patterns built using phidata

Live Demos

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.

Setup

  1. Clone the git repo

from the ai-cookbook dir:

  1. Create + activate a virtual env:
python3 -m venv aienv
source aienv/bin/activate
  1. Install phidata:
pip install phidata
  1. Setup workspace:
phi ws setup
  1. Copy workspace/example_secrets to workspace/secrets:
cp -r workspace/example_secrets workspace/secrets
  1. Copy .env file:
cp example.env .env
  1. 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-***

Run AI Cookbook locally

  1. Install docker desktop

  2. Start the workspace using:

phi ws up
  1. Stop the workspace using:
phi ws down