<img src="https://github.com/Shaunwei/RealChar/raw/ios-release-v0.0.4-draft/realtime_ai_character/static/logo.png" alt="RealChar-logo" width="80%" style="padding: 40px"/>
🎙️🤖Create, customize and talk to your AI Character/Companion in realtime🎙️🤖
<a href="https://discord.gg/e4AYNnFg2F">
<img src="https://img.shields.io/badge/discord-join%20chat-blue.svg?style=for-the-badge" alt="Join our Discord" height="20">
</a>
<a href="https://twitter.com/agishaun">
<img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/agishaun?style=for-the-badge" height="20">
<a href="https://github.com/Shaunwei/RealChar">
<img alt="GitHub" src="https://img.shields.io/github/stars/Shaunwei/RealChar?style=for-the-badge&color=gold" height="20">
</a>
<a href="https://github.com/Shaunwei/RealChar/commits/main">
<img alt="GitHub" src="https://img.shields.io/github/last-commit/Shaunwei/RealChar/main?style=for-the-badge" height="20">
</a>
<a href="https://github.com/Shaunwei/RealChar/blob/main/README.md" target="_blank">
<img src="https://img.shields.io/static/v1?label=license&message=MIT&color=green&style=for-the-badge" alt="License" height="20">
</a>
<a href="https://hub.docker.com/repository/docker/shaunly/real_char/general" target="_blank">
<img alt="Docker Pulls" src="https://img.shields.io/docker/pulls/shaunly/real_char?style=for-the-badge" height="20">
</a>
Try our site at RealChar.ai
(We are also beta-testing our iOS mobile app📱! Sign up here)
Not sure how to pronounce RealChar? Listen to this 👉 audip
https://github.com/Shaunwei/RealChar/assets/5101573/5de0b023-6cf3-4947-84cb-596f429d109e
https://github.com/Shaunwei/RealChar/assets/5101573/62a1f3d1-1166-4254-9119-97647be52c42
Demo settings: Web, GPT4, ElevenLabs with voice clone, Chroma, Google Speech to Text
<img src="https://storage.googleapis.com/assistly/static/realchar/techstackv003.jpeg" alt="RealChar-tech-stack" width="100%" style="padding: 20px"/>
<img src="https://storage.googleapis.com/assistly/static/realchar/compare.png">
Before you begin setting up this project, please ensure you have completed the following tasks:
👇click me
This application utilizes the OpenAI API to access its powerful language model capabilities. In order to use the OpenAI API, you will need to obtain an API token.
To get your OpenAI API token, follow these steps:
export OPENAI_API_KEY=<your API key>(Optional) To use Azure OpenAI API instead, refer to the following section:
export OPENAI_API_TYPE=azureIf you want to use the earlier version 2023-03-15-preview:
export OPENAI_API_VERSION=2023-03-15-preview
export OPENAI_API_BASE=https://your-base-url.openai.azure.com
export OPENAI_API_MODEL_DEPLOYMENT_NAME=gpt-35-turbo-16k
export OPENAI_API_EMBEDDING_DEPLOYMENT_NAME=text-embedding-ada-002
👇click me
To get your Anthropic API token, follow these steps:
export ANTHROPIC_API_KEY=<your API key>👇click me
To get your Google Cloud API credentials.json, follow these steps:
google_credentials.json in the root folder of this project. Check GCP websiteSPEECH_TO_TEXT_USE to use GOOGLE in your .env file👇click me
Visit ElevenLabs to create an account. You'll need this to access the text to speech and voice cloning features.
In your Profile Setting, you can get an API Key. Save it in a safe place.
Set API key in your .env file:
ELEVEN_LABS_API_KEY=<api key>
sh
git clone https://github.com/Shaunwei/RealChar.git && cd RealCharbrew install portaudio
brew install ffmpeg
sh
sudo apt update
sudo apt install portaudio19-dev
sudo apt install ffmpeg
- Then install all python requirementssh
pip install -r requirements.txt
```
sh
sqlite3 test.db "VACUUM;"sh
alembic upgrade head
This ensures your database schema is up to date. Please run this after every time you pull the main branch..env: update API keys and select module
sh
cp .env.example .envcli.py or use uvicorn directly
sh
python cli.py run-uvicorn
# or
uvicorn realtime_ai_character.main:appsh
cd client/web
npm install
npm start
After running these commands, a local development server will start, and your default web browser will open a new tab/window pointing to this server (usually http://localhost:3000).sh
python client/cli.pyclient/mobile/ios/rac/rac.xcodeproj/project.pbxproj in Xcode and run the appNote if you want to remotely connect to a RealChar server, SSL set up is required to establish the audio connection.
👇click me
sh
docker pull shaunly/real_char:latest
docker tag shaunly/real_char:latest realtime-ai-character
(Or you want build yourself) Build docker image
sh
python cli.py docker-build
If you have issues with docker (especially on a non-Linux machine), please refer to https://docs.docker.com/get-docker/ (installation) and https://docs.docker.com/desktop/troubleshoot/overview/ (troubleshooting).Run docker image with .env file
sh
python cli.py docker-run
Go to http://localhost:8000 (NOT 0.0.0.0:8000) to start talking or use terminal client
sh
python client/cli.py
👇click me
You can now use Anyscale Endpoint to serve Llama-2 models in your RealChar easily! Simply register an account with Anyscale Endpoint. Once you get the API key, set this environment variable in your .env file:
ANYSCALE_ENDPOINT_API_KEY=<your API Key>
By default, we show the largest servable Llama-2 model (70B) in the Web UI. You can change the model name (meta-llama/Llama-2-70b-chat-hf) to other models, e.g. 13b or 7b versions.
If you have access to LangSmith, you can edit these environment variables to enable:
LANGCHAIN_TRACING_V2=false # default off
LANGCHAIN_ENDPOINT=https://api.smith.langchain.com
LANGCHAIN_API_KEY=YOUR_LANGCHAIN_API_KEY
LANGCHAIN_PROJECT=YOUR_LANGCHAIN_PROJECT
And it should work out of the box.
Please check out our Contribution Guide!
$ claude mcp add RealChar \
-- python -m otcore.mcp_server <graph>