Create, Customize and Talk to your AI Character/Companion in Realtime
RealChar. – Your Realtime AI Character
?️?Create, customize and talk to your AI Character/Companion in realtime?️?
✨ Demo
For the best demo experience, try our site at realchar.ai
elon-edit-camera.mp4
Demo settings: Web, GPT4, ElevenLabs with voice clone, Chroma, Google Speech to Text
? Key Features
- Easy to use: No coding required to create your own AI character.
- Customizable: You can customize your AI character’s personality, background, and even voice
- Realtime: Talk to or message your AI character in realtime
- Multi-Platform: You can talk to your AI character on web, terminal and mobile(Yes. we open source our mobile app)
- Most up-to-date AI: We use the most up-to-date AI technology to power your AI character, including OpenAI, Anthropic Claude 2, Chroma, Whisper, ElevenLabs, etc.
- Modular: You can easily swap out different modules to customize your flow. Less opinionated, more flexible. Great project to start your AI Engineering journey.
? Tech stack
- ✅Web: Vanilla JS, WebSockets
- ✅Mobile: Swift, WebSockets
- ✅Backend: FastAPI, SQLite, Docker
- ✅Data Ingession: LlamaIndex, Chroma
- ✅LLM Orchestration: LangChain, Chroma
- ✅LLM: OpenAI GPT3.5/4, Anthropic Claude 2
- ✅Speech to Text: Local Whisper, OpenAI Whisper API, Google Speech to Text
- ✅Text to Speech: ElevenLabs
- ✅Voice Clone: ElevenLabs
? Comparison with existing products
?? Prerequisites
Before you begin setting up this project, please ensure you have completed the following tasks:
1. LLM – OpenAI API Token
?click meThis 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:
- Go to the OpenAI website and sign up for an account if you haven’t already.
- Once you’re logged in, navigate to the API keys page.
- Generate a new API key by clicking on the “Create API Key” button.
- Copy the API key and store it safely.
- Add the API key to your environment variable, e.g.
export OPENAI_API_KEY=<your API key>
1.1 (Optional) Prepare LLM – Anthropic(Claude 2) API Token
?click meTo get your OpenAI API token, follow these steps:
- Go to the Anthropic website and sign up for an account if you haven’t already.
- Once you’re logged in, navigate to the API keys page.
- Generate a new API key by clicking on the “Create Key” button.
- Copy the API key and store it safely.
- Add the API key to your environment variable, e.g.
export ANTHROPIC_API_KEY=<your API key>
2. (Optional) Prepare Speech to Text – Google Cloud API
?click meTo get your Google Cloud API credentials.json, follow these steps:
- Go to the GCP website and sign up for an account if you haven’t already.
- Follow the guide to create a project and enable Speech to Text API
- Put
google_credentials.json
in the root folder of this project. Check GCP website - Change
SPEECH_TO_TEXT_USE
to useGOOGLE
in your.env
file
3. Prepare Text to Speech – ElevenLabs API Key
?click me1. Creating an ElevenLabs Account Visit [ElevenLabs](https://beta.elevenlabs.io/) 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>
? Installation via Python
- Step 1. Clone the repo
git clone https://github.com/Shaunwei/RealChar.git && cd RealChar
- Step 2. Install requirements
# for mac brew install portaudio brew install ffmpeg
- Then install all python requirements
pip install -r requirements.txt
- Step 3. Create an empty sqlite database if you have not done so before
sqlite3 test.db "VACUUM;"
- Step 4. Run db upgrade
alembic upgrade head
- Step 5. Setup
.env
: update API keys and select modulecp .env.example .env
- Step 6. Run server with
cli.py
or use uvicorn directlypython cli.py run-uvicorn # or uvicorn realtime_ai_character.main:app
- Step 7. Run client:
- Use GPT4 for better conversation and Wear headphone for best audio(avoid echo)
- Web client: Open your web browser and navigate to http://localhost:8000
- (Optional) Terminal client: Run the following command in your terminal
python client/cli.py
- (Optional) mobile client: open
client/mobile/ios/rac/rac.xcodeproj/project.pbxproj
in Xcode and run the app
- Step 8. Select one character to talk to, then start talking
(Optional) ? Installation via Docker
?click me-
Docker image: you can use our docker image directly
docker pull shaunly/real_char:latest
(Or you want build yourself) Build docker image
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
filepython cli.py docker-run
-
Go to http://localhost:8000 to start talking or use terminal client
python client/cli.py