Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎭 OpenPerso

Open-source AI Character Chat Platform

λˆ„κ΅¬λ‚˜ AI 캐릭터λ₯Ό λ§Œλ“€κ³ , λŒ€ν™”ν•˜κ³ , κ³΅μœ ν•˜λŠ” μ˜€ν”ˆμ†ŒμŠ€ ν”Œλž«νΌ

License: MIT Python 3.12+ Next.js 16 FastAPI PostgreSQL

ν•œκ΅­μ–΄ | English | Quick Start | Contributing


OpenPerso Landing Page

πŸ“– Overview

OpenPerso is a self-hostable, open-source alternative to Character.AI. Build your own AI character platform with full control over your data, models, and user experience.

Why OpenPerso?

  • πŸ”“ Open Source β€” Full transparency. Self-host on your own infrastructure.
  • πŸ€– Model Agnostic β€” Works with any OpenAI-compatible API (OpenAI, Claude, local LLMs via Ollama, etc.)
  • 🧠 Memory System β€” Characters remember past conversations with hybrid global + per-character memory.
  • 🎨 One-Click Creation β€” Generate a complete character from just a name and description.
  • 🌐 Shareable β€” Create characters and share them with the community.
  • πŸ“± Mobile Ready β€” PWA support for mobile home screen installation.
Mobile View Β Β Β  Mobile Explore
πŸ“± λͺ¨λ°”일 μ΅œμ ν™” (PWA)

✨ Features

πŸ’¬ Intelligent Chat

  • Real-time SSE streaming responses
  • In-chat image generation
  • Conversation starters per character
  • Short-term memory with auto-summarization (20+ turns)

🎭 Character Creation

  • AI-powered one-click character generation
  • AI avatar generation (DALLΒ·E / gpt-image)
  • Personality sliders (warmth, humor, formality, etc.)
  • Category system (celebrities, K-content, games, helpers, friends, healing)

🧠 Memory System

  • Global Memory: Rule-based, real-time extraction (name, preferences, facts)
  • Per-Character Memory: LLM-based, async extraction (relationship, context)
  • Vector embeddings via pgvector for semantic recall

πŸ”Š Voice & Multimodal

  • Text-to-Speech via OpenAI TTS API
  • Multiple voice options per character
  • Speech-to-Text via Web Speech API
  • Image generation during conversations

πŸ” Explore & Discover

  • Staff Picks / Trending / Newly Created sections
  • Category-based filtering
  • Search with keyword matching
  • Chat count display on character cards

πŸ›‘οΈ Production Ready

  • JWT authentication (email/password + Google OAuth)
  • API rate limiting with Redis
  • Guest trial (3 turns without sign-up)
  • Account deletion with CASCADE cleanup
  • Privacy policy & Terms of Service pages
πŸ“Έ Screenshots
πŸ” Explore β€” 페λ₯΄μ†Œλ‚˜ 탐색

Explore Page
🎭 Persona β€” 캐릭터 상세

Persona Detail
πŸ’¬ Chat β€” μ‹€μ‹œκ°„ λŒ€ν™”

Chat Interface
✨ Create β€” 원클릭 생성

Create Persona

πŸ—οΈ Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                  Frontend (Next.js 16)                   β”‚
β”‚                                                         β”‚
β”‚  Landing ─ Explore ─ Create ─ Chat ─ Profile ─ Pricing  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚ HTTP / SSE
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚  FastAPI Backend β”‚
              β”‚                 β”‚
              β”‚  Auth ─ Chat    β”‚
              β”‚  Persona ─ LLM  β”‚
              β”‚  Memory ─ TTS   β”‚
              β”‚  Image ─ Admin  β”‚
              β””β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”¬β”˜
                 β”‚      β”‚      β”‚
     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜      β”‚      └───────────┐
     β”‚                  β”‚                  β”‚
β”Œβ”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”   β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
β”‚PostgreSQL β”‚    β”‚     Redis     β”‚   β”‚    MinIO     β”‚
β”‚+ pgvector β”‚    β”‚  Cache/Queue  β”‚   β”‚  S3 Storage  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ› οΈ Tech Stack

Layer Technology
Frontend Next.js 16 (App Router), TypeScript, Tailwind CSS, shadcn/ui
Backend FastAPI, Python 3.12, SQLAlchemy 2.0 (async), Alembic
Database PostgreSQL 16 + pgvector
Cache Redis
Storage MinIO (S3-compatible)
LLM Any OpenAI-compatible API
TTS OpenAI TTS API
Auth JWT + Google OAuth
Infra Docker Compose (dev) β†’ Kubernetes (prod)

πŸš€ Quick Start

Prerequisites

  • Docker & Docker Compose (for PostgreSQL, Redis, MinIO)
  • Node.js 20+ and npm
  • Python 3.12+
  • uv (recommended Python package manager)
  • OpenAI API Key (or any OpenAI-compatible API)

1. Clone & Configure

git clone https://github.com/Daewooki/OpenPerso.git
cd OpenPerso

# Copy environment template
cp .env.example .env

Edit .env and fill in your API keys:

# Required: Your LLM API key
LLM_API_KEY=sk-your-openai-api-key
LLM_SUB_API_KEY=sk-your-openai-api-key

# Change in production!
SECRET_KEY=your-secret-key-here
POSTGRES_PASSWORD=your-secure-password

2. Start Infrastructure

docker-compose up -d

This starts PostgreSQL (port 5434), Redis (port 6381), and MinIO (port 9200).

3. Start Backend

cd backend

# Install dependencies
uv sync

# Run database migrations
PYTHONPATH=. uv run alembic upgrade head

# Start the server
PYTHONPATH=. .venv/bin/uvicorn app.main:app --reload --port 8200

An admin account is auto-created on first startup (configure via ADMIN_EMAIL and ADMIN_PASSWORD in .env).

4. Start Frontend

cd frontend

# Install dependencies
npm install

# Start dev server
npm run dev -- -p 3200

5. Open

Visit http://localhost:3200 and start creating AI characters!

6. (Optional) Seed Characters

cd backend
PYTHONPATH=. .venv/bin/python scripts/seed_personas.py

This adds 6 sample characters (Einstein, Sherlock Holmes, Coding Mentor, etc.)


πŸ“ Project Structure

openperso/
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ app/
β”‚   β”‚   β”œβ”€β”€ api/v1/          # REST API endpoints
β”‚   β”‚   β”‚   β”œβ”€β”€ auth.py      # Login, register, JWT
β”‚   β”‚   β”‚   β”œβ”€β”€ chat.py      # SSE streaming chat
β”‚   β”‚   β”‚   β”œβ”€β”€ personas.py  # CRUD + generation
β”‚   β”‚   β”‚   β”œβ”€β”€ explore.py   # Featured, trending, new
β”‚   β”‚   β”‚   β”œβ”€β”€ guest.py     # Guest trial (3 turns)
β”‚   β”‚   β”‚   β”œβ”€β”€ voice.py     # TTS endpoints
β”‚   β”‚   β”‚   └── ...
β”‚   β”‚   β”œβ”€β”€ models/           # SQLAlchemy ORM models
β”‚   β”‚   β”œβ”€β”€ schemas/          # Pydantic validation
β”‚   β”‚   β”œβ”€β”€ services/         # Business logic
β”‚   β”‚   β”‚   β”œβ”€β”€ chat.py       # Chat + streaming
β”‚   β”‚   β”‚   β”œβ”€β”€ llm.py        # LLM abstraction layer
β”‚   β”‚   β”‚   β”œβ”€β”€ memory.py     # Memory extraction
β”‚   β”‚   β”‚   β”œβ”€β”€ persona_gen.py # AI character generation
β”‚   β”‚   β”‚   β”œβ”€β”€ image_gen.py  # Image generation
β”‚   β”‚   β”‚   β”œβ”€β”€ tts.py        # Text-to-speech
β”‚   β”‚   β”‚   └── ...
β”‚   β”‚   └── workers/          # Background tasks
β”‚   β”œβ”€β”€ alembic/              # DB migrations
β”‚   └── scripts/              # Seed data, utilities
β”œβ”€β”€ frontend/
β”‚   └── src/
β”‚       β”œβ”€β”€ app/              # Next.js pages (App Router)
β”‚       β”‚   β”œβ”€β”€ (auth)/       # Login, Register
β”‚       β”‚   β”œβ”€β”€ (main)/       # Explore, Chat, Create, Profile
β”‚       β”‚   └── trial/        # Guest trial
β”‚       β”œβ”€β”€ components/       # Reusable React components
β”‚       β”œβ”€β”€ hooks/            # Custom React hooks
β”‚       β”œβ”€β”€ lib/              # API client, utilities
β”‚       └── types/            # TypeScript definitions
β”œβ”€β”€ nginx/                    # Reverse proxy config
β”œβ”€β”€ docker-compose.yml        # Dev infrastructure
β”œβ”€β”€ docker-compose.prod.yml   # Production deployment
└── docs/                     # Planning documents

πŸ”§ Configuration

Environment Variables

All configuration is done via .env file. See .env.example for the full list.

Variable Description Required
LLM_API_KEY OpenAI (or compatible) API key βœ…
LLM_MODEL Main chat model (default: gpt-4o)
LLM_SUB_API_KEY API key for auxiliary tasks βœ…
LLM_SUB_MODEL Auxiliary model (default: gpt-4o-mini)
SECRET_KEY JWT signing secret βœ… prod
POSTGRES_PASSWORD Database password βœ… prod
ADMIN_EMAIL Auto-created admin email
ADMIN_PASSWORD Auto-created admin password
GOOGLE_CLIENT_ID Google OAuth client ID
GOOGLE_CLIENT_SECRET Google OAuth client secret

Using Different LLM Providers

OpenPerso works with any OpenAI-compatible API:

# OpenAI (default)
LLM_API_URL=https://api.openai.com/v1
LLM_MODEL=gpt-4o

# Ollama (local)
LLM_API_URL=http://localhost:11434/v1
LLM_MODEL=llama3

# Any OpenAI-compatible provider
LLM_API_URL=https://your-provider.com/v1
LLM_MODEL=your-model-name

πŸ’° Pricing Model

OpenPerso includes a built-in freemium pricing UI β€” ready for monetization.

Pricing Page

πŸ—ΊοΈ Roadmap

  • Text chat with SSE streaming
  • AI character generation (one-click)
  • Memory system (global + per-character)
  • AI avatar generation
  • In-chat image generation
  • Voice output (TTS)
  • Guest trial mode
  • Explore page (featured, trending, new)
  • PWA support
  • SEO (sitemap, OG tags)
  • Voice input (real-time STT)
  • Voice chat mode (bidirectional)
  • Avatar animation (lip-sync)
  • Group chat (multiple characters)
  • Character marketplace
  • Creator analytics dashboard
  • Plugin system
  • Multi-language support (i18n)

🀝 Contributing

Contributions are welcome! See CONTRIBUTING.md for guidelines.

# Fork β†’ Clone β†’ Branch β†’ Code β†’ PR
git checkout -b feature/amazing-feature
git commit -m 'feat: add amazing feature'
git push origin feature/amazing-feature

πŸ“„ License

This project is licensed under the MIT License.


πŸ™ Acknowledgments


⭐ Star this repo if you find it useful!

Made with ❀️ by Daewooki

About

🎭 Open-source AI character chat platform β€” Create, chat, and share AI personas. Self-hostable Character.AI alternative.

Topics

Resources

Contributing

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages