This is a repository containing components of Discord bot integrated with Cerebras AI for ultra-fast inference.
Deployed on Render.com, with per-user conversation memory and long-response handling. Note that this bot by default will use llama 3.3 70B model. You may change the model in bot.py if you want, but the model must be available in the list offered by Cerebras.
-
bot.py
Main Discord bot with Cerebras AI integration -
requirements.txt
Python dependencies -
render.yaml
Render.com deployment configuration
!ask <question>— Ask the AI anything!reset— Clear your conversation history!ping— Check bot status- Maintains conversation context per user
- Automatically splits long responses (handles Discord’s 2000-character limit)
Before proceeding with the subsequent steps, clone this repository into your own GitHub account.
- Go to the Discord Developer Portal
- Create a New Application
- Navigate to the Bot section
- Click Create Bot
- Copy the Bot Token. This will be your
DISCORD_BOT_TOKEN - Enable Message Content Intent under Privileged Gateway Intents
Go to https://cloud.cerebras.ai and create an account, then obtain the API key for it. This will be your CEREBRAS_API_KEY.
Go to https://www.render.com and do the following steps:
- Create a new Web Service
- Connect it to the cloned GitHub repository
- Render will auto-detect it's a Python app
- Set your
CEREBRAS_API_KEYandDISCORD_BOT_TOKENin the environment variable field - Set the Start Command field to
python bot.py - Click deploy
To keep the bot awake 24/7, you may use UptimeRobot to monitor and consistently ping your Render web service every interval.
- Go to the bot's web service you deployed on Render, then copy the link of the web service
- Go to https://www.uptimerobot.com and create a new monitor, enter the bot's web service link, and start it