Skip to content

An AI assistant based on Astro framework and API engineering.

License

Notifications You must be signed in to change notification settings

wanghui5801/Astro-Ai

Repository files navigation

AI Assistant

Astro TypeScript Tailwind CSS Docker Docker Pulls Vercel License: MIT

An AI-powered assistant built with Astro and multiple language model integrations.

Deploy with Vercel

📷 Screenshots

index settings
login

🚀 Features

  • 🤖 Multi-model support (GPT, Claude, Gemini, DeepSeek)
  • 🌓 Dark/Light theme
  • ✨ Markdown & LaTeX support
  • 💾 Chat history with local storage
  • 📱 Responsive design
  • 🔒 Password-protected access

🛠️ Environment Variables

Before deploying, make sure to configure these environment variables:

PUBLIC_OPENAI_API_KEY=     # Your OpenAI API key
PUBLIC_ANTHROPIC_API_KEY=  # Your Anthropic API key
PUBLIC_GOOGLE_API_KEY=     # Your Google API key
PUBLIC_DEEPSEEK_API_KEY=   # Your DeepSeek API key
PUBLIC_DEFAULT_MODEL=      # Default model (e.g., "gpt-3.5-turbo")
PUBLIC_SHOW_SETTINGS=      # Show settings page ("true" or "false")
PUBLIC_ACCESS_PASSWORD=     # Password for accessing the application

🚀 Quick Start

  1. Clone the repository
  2. Install dependencies:
npm install
  1. Create a .env file with the required environment variables
  2. Start the development server:
npm run dev

🧞 Commands

All commands are run from the root of the project, from a terminal:

Command Action
npm install Installs dependencies
npm run dev Starts local dev server at localhost:4321
npm run build Build your production site to ./dist/
npm run preview Preview your build locally, before deploying

🔑 API Keys Setup

Visit the following sites to obtain your API keys:

📄 Deploy with Docker

Deploy on Docker

  1. Pull the Docker image:
docker pull xhh1128/astro-ai:latest
  1. Create .env file with your API keys:
PUBLIC_OPENAI_API_KEY=your-openai-key
PUBLIC_ANTHROPIC_API_KEY=your-anthropic-key
PUBLIC_GOOGLE_API_KEY=your-google-key
PUBLIC_DEEPSEEK_API_KEY=your-deepseek-key
PUBLIC_DEFAULT_MODEL=gpt-4-turbo-preview
PUBLIC_SHOW_SETTINGS=true
  1. Run with Docker:
docker run -d \
  --name astro-ai \
  -p 4321:4321 \
  --env-file .env \
  xhh1128/astro-ai:latest

Or use Docker Compose:

Create docker-compose.yml:

version: '3.8'

services:
  astro-ai:
    image: xhh1128/astro-ai:latest
    ports:
      - "4321:4321"
    environment:
      - PUBLIC_OPENAI_API_KEY=${PUBLIC_OPENAI_API_KEY}
      - PUBLIC_ANTHROPIC_API_KEY=${PUBLIC_ANTHROPIC_API_KEY}
      - PUBLIC_GOOGLE_API_KEY=${PUBLIC_GOOGLE_API_KEY}
      - PUBLIC_DEEPSEEK_API_KEY=${PUBLIC_DEEPSEEK_API_KEY}
      - PUBLIC_DEFAULT_MODEL=${PUBLIC_DEFAULT_MODEL}
      - PUBLIC_SHOW_SETTINGS=${PUBLIC_SHOW_SETTINGS}
      - PUBLIC_ACCESS_PASSWORD=${PUBLIC_ACCESS_PASSWORD}
    restart: unless-stopped

Then run:

docker-compose up -d
  1. Access the application at http://localhost:4321

📄 Deploy on Vercel

  1. Fork this repository
  2. Click the "Deploy with Vercel" button above
  3. Configure the required environment variables in Vercel:
    • PUBLIC_OPENAI_API_KEY
    • PUBLIC_ANTHROPIC_API_KEY
    • PUBLIC_GOOGLE_API_KEY
    • PUBLIC_DEEPSEEK_API_KEY
    • PUBLIC_DEFAULT_MODEL
    • PUBLIC_SHOW_SETTINGS
    • PUBLIC_ACCESS_PASSWORD
  4. Deploy and enjoy! 🎉

📝 Notes

  • ⚠️ Make sure to set up all required API keys in your environment variables
  • ⚙️ The settings page can be enabled/disabled using PUBLIC_SHOW_SETTINGS
  • 💾 Chat history is stored in localStorage

📄 License

MIT License