/AI-tamago

A local-ready LLM-generated and LLM-driven virtual pet with thoughts and feelings. 100% Javascript.

Primary LanguageTypeScriptMIT LicenseMIT

AI Tamago 🥚🐣

An 100% local, LLM-generated and LLM-driven virtual pet with thoughts, feelings and feedback. Revive your fond memories of Tamagotchi!

All ascii animations are generated using chatgpt (included prompts in the repo).

Have questions? Join AI Stack devs and find me in #ai-tamago channel.

Demo 🪄

ai-tamago-demo.mov

Stack

Prerequisites

Quickstart

1. Fork and Clone repo

Fork the repo to your Github account, then run the following command to clone the repo:

git clone git@github.com:[YOUR_GITHUB_ACCOUNT_NAME]/AI-tamago.git

2. Install dependencies

cd ai-tamago
npm run dev

All client side tamagotchi code is in Tamagotchi.tsx

3. Install Ollama

Instructions are here.

4. Run Supabase locally

  1. Install Supabase CLI
brew install supabase/tap/supabase
  1. Start Supabase

Make sure you are under /ai-tamago directory and run:

supabase start

Tips: To run migrations or reset database -- seed.sql and migrations will run supabase db reset

5. Fill in secrets

Note: The secrets here are for your local supabase instance

cp .env.local.example .env.local

Then get SUPABASE_PRIVATE_KEY by running

supabase status

Copy service_role key and save it as SUPABASE_PRIVATE_KEY in .env.local

6. Set up Inngest

npx inngest-cli@latest dev

Make sure your app is up and running -- Inngest functions (which are used to drive game state) should register automatically.

7. Run app locally

Now you are ready to test out the app locally! To do this, simply run npm run dev under the project root and visit http://localhost:3000.

Deployment Guide

Now you have played with the AI tamago locally -- it's time to deploy it somewhere more permanent so you can access it anytime!

While I'm still writing up a detailed deployment guide, here are the resources you can refer to for deploying different parts of the app: