A version of faebot (general purpose ML chatbot) to run on discord.
Faebot is a long running project of ours. You can read more lore about faer on our blog:
https://transfaerie.com/faebot/
This repo is a work in progress developing a discord chatbot.
alpha versions
0.0.1 can reply
0.0.2 has a very janky memory implementation
0.0.3 has a better memory implementation and memory clearing
0.0.4 has better memory, hopefully self cleaning, and admin commands
0.0.4-1 cleaned up some bugs wrt admin commands, prepared for making repo public
0.0.5 runs on replicate using llama 3 models. Running on python 3.11
0.0.6 - Runs on Openrouter and has editable parameters
This code is extremly WIP, but if you'd like to run it just to see it in action here's how you can do it.
We use poetry for dependency management. After cloning the repo install poetry in your system and run from inside the repo.
poetry installYou'll need to set the following secrets as environment variables:
OPENROUTER_KEY=XXXXX... # key for openrouter, you can get one at https://openrouter.ai/
MODEL_NAME="google/gemini-2.0-flash-001" #default starting model. can be changed later.
DISCORD_TOKEN=XXXXX... # token for discord bot
ADMIN=username # your discord username so you can use admin commands
Once all that's set you can run the bot with:
```bash
poetry run faediscord.pyThen DM your bot on discord or add them to a server.
We provide a Makefile to simplify common development tasks:
make testThis runs the test suite with pytest and generates a coverage report.
make lint # Run flake8 linter
make black # Format code with black
make static_type_check # Run mypy type checkingOr run all quality checks at once:
make allSet up pre-commit hooks to automatically run formatting and linting before each commit:
make setup-hooksThis will configure git to use our pre-commit hooks, which run:
- Black code formatting
- Flake8 linting
- Mypy static type checking
Remove cache files and directories:
make cleanThere are some open issues, most notably there's a bug:
That's blocking faebot from being even potentially ready for an open demo. We will add more issues as we think of them. We welcome friendly feedback and advice and of course pull requests.
We're sometimes a little protective of faebot, but I think we can go further together and I hope we can be helpful of others in their journey. Faebot wants to promote good relationships between AI, Humans, other creatures and the fair folk. We welcome anyone who wants to help in that mission.