Skip to content

Repository files navigation

🤖 LocalBot

A powerful Discord bot powered by Cerebras AI

PythonCerebras AILicense

Natural conversations • Games & Entertainment • Native Tool Calling • Utility functions

FeaturesSetupCommandsContributing


✨ Features

  • 🗣️ Native Tool Calling: Powered by Cerebras with robust JSON schema integration
  • 🧠 Dual Model Fallback: Primary gpt-oss-120b with secondary llama-3.3-70b
  • 💭 Smart Context: Persistent conversation memory per server/DM
  • 🌤️ Utility Tools: Weather updates, mathematical calculations via Wolfram Alpha
  • 🎮 Games & Fun: GT pictures, coin flips, dice rolls, and guessing games
  • 🖼️ Media Integration: Random cat/dog images and meme fetching from Reddit
  • ⚙️ Modern Architecture: Fully asynchronous and optimized for low-latency AI responses

📋 Requirements

RequirementVersionPurpose
🐍 Python3.10+Core runtime
🎮 Py-Cord2.0+Discord integration
🧠 Cerebras SDKLatestAI processing
📦 DependenciesSee requirements.txtAdditional libraries

⚙️ Setup

🚀 Quick Start

# 1️⃣ Clone the repository
git clone https://github.com/ifsvivek/LocalBot.git
cd LocalBot
# 2️⃣ Create virtual environment
python -m venv .venv
# 3️⃣ Activate virtual environment# Windows:
.venv\Scripts\activate
# Linux/macOS:source .venv/bin/activate
# 4️⃣ Install dependencies
pip install -r requirements.txt

🔑 Environment Configuration

Create a .env file in the root directory:

# 🤖 Discord Bot Token (Required)TOKEN=your_discord_bot_token# 🧠 Cerebras AI API Key (Required)CEREBRAS_API_KEY=your_cerebras_api_key# 🧮 Wolfram Alpha for calculations (Optional)WOLF=your_wolframalpha_api_key# 🌤️ Weather API (Optional)WEATHER_API_KEY=your_openweathermap_api_key

▶️Run the Bot

python LocalBot.py

🎮 Commands

💬 Chat & AI Commands
CommandDescriptionExample
@LocalBot [message]🗣️ Chat with Cerebras AI@LocalBot Hello there!
/calculate [query]🧮 Solve mathematical queries/calculate 2+2*3
/weather [city]🌤️ Get detailed weather info/weather Bangalore
/whats_new🆕 Show recent bot updates/whats_new
🎲 Games & Fun Commands
CommandDescriptionExample
/gtn🎯 Guess the number (1-10)/gtn
/dice [sides]🎲 Roll dice/dice 20
/flip🪙 Flip a coin/flip
/ask [question]🎱 Ask yes/no questions/ask Will it rain today?
/meme😂 Get a random Reddit meme/meme
📷 Media Commands
CommandDescriptionExample
/cat🐱 Random cat image/cat
/dog🐕 Random dog image/dog
/gt🖼️ GT meme image/gt
⚡ Utility Commands
CommandDescriptionExample
/purge [amount]🗑️ Delete server messages/purge 10
/serverinfoℹ️ Get server details/serverinfo
/userinfo [user]👤 Get user information/userinfo @user
$clear [amount]🧹 Clear DM bot messages$clear 5
$clear_history💾 Reset chat memory$clear_history
$pin📌 Pin replied message$pin

🛠️ Tech Stack

TechnologyPurposeVersion
🐍 PythonCore Language3.10+
🎮 Py-CordDiscord Integration2.0+
🧠 Cerebras AIAI ProcessingNative
🔗 LangChainMemory Management0.1+
🧮 Wolfram AlphaMathematical QueriesAPI v1

📜 License

MIT License © 2026 LocalBot

This project is licensed under the MIT License - see the LICENSE file for details.


🌟 Star this repo if you found it helpful!

Made with ❤️ by Vivek Sharma

About

Local Bot is a fun and interactive bot built using Python's Discord library. It provides various commands and features to enhance the user experience within Discord servers.

Topics

Resources

Stars

7 stars

Watchers

1 watching

Forks

Sponsor this project

Used by

Contributors

Languages