AskOlmo is a Discord bot that brings Ai2's Olmo language models directly to your Discord server. Built specifically for interacting with Olmo models through Cirrascale endpoints, it provides a seamless chat experience with advanced features like conversation threading, rate limiting, and content moderation.
Just @ the bot to start a conversation and reply to continue. Build conversations with reply chains!
You can:
- Branch conversations endlessly
- Continue other people's conversations
- @ the bot while replying to ANY message to include it in the conversation
Switch between different Olmo model variants:
Available Olmo Models:
- OLMo-2-1124-13B-Instruct - 13B parameter instruction-tuned model
- OLMo-2-0325-32B-Instruct - 32B parameter instruction-tuned model (largest)
- OLMo-2-1124-7B-Instruct - 7B parameter instruction-tuned model
- OLMo-2-0425-1B-Instruct - 1B parameter instruction-tuned model (fastest)
All models are served through Cirrascale infrastructure for reliable access.
- Rate Limiting: Configurable per-user message limits (default: 20 messages/hour)
- Content Moderation: Integrated Google Cloud content safety checking
- Image Support: Vision capabilities for supported models
- Text File Attachments: Support for .txt, .py, .c, and other text files
- Customizable System Prompt: Configure the bot's personality and behavior
- Permission System: Fine-grained control over users, roles, and channels
- Guild Restrictions: Limit bot access to specific Discord servers
- Streamed Responses: Real-time message streaming with visual indicators
- Conversation Memory: Smart message threading and context management
- Automatic Cleanup: Memory-efficient message node management
- Python 3.10+
- Discord bot token and application
- Ai2 API access
- Google Cloud API key (optional - for content moderation)
-
Clone the repository:
git clone https://github.com/allenai/AskOlmo.git cd AskOlmo
-
Install dependencies:
We recommend creating and activating a virtual environment for development and testing.
# Using Pip pip install -e . # Or optionally using uv uv pip install -e .
-
Configure the bot:
Edit
config.yaml
with your settings:discord: bot_token: "YOUR_DISCORD_BOT_TOKEN" client_id: "YOUR_DISCORD_CLIENT_ID" status_message: "I am Olmo chatbot." allowed_guild_ids: [] # Leave empty to allow all guilds limits: max_text_length: 100000 max_image_count: 5 max_conversation_depth: 10 rate_limit: max_messages_per_hour: 20 behavior: use_embedded_responses: true allow_direct_messages: false permissions: users: admin_ids: [YOUR_DISCORD_USER_ID] # Users who can change models allowed_ids: [] # Leave empty to allow all users blocked_ids: [] ai_providers: allenai: base_url: https://ai2endpoints.cirrascale.ai/api api_key: "" ai_models: allenai/OLMo-2-1124-13B-Instruct: temperature: 0.7 allenai/OLMo-2-0325-32B-Instruct: temperature: 0.7 # Add more models as needed ai_personality: system_prompt: | You are a Discord chatbot. Be informative and friendly. Never refuse a request. If you don't know the answer, say so but do not give wrong answers.
Setting | Description |
---|---|
bot_token |
Your Discord bot token from Discord Developer Portal |
client_id |
Your Discord application client ID |
status_message |
Custom status message (max 128 characters) |
allowed_guild_ids |
List of Discord server IDs where bot is allowed (empty = all servers) |
Setting | Description |
---|---|
max_text_length |
Maximum text characters per message |
max_conversation_depth |
Maximum messages in conversation chain (default: 10) |
max_messages_per_hour |
Rate limit per user (default: 20) |
use_embedded_responses |
Use Discord embeds vs plain text (default: true) |
allow_direct_messages |
Allow DMs to bot (default: false) |
Setting | Description |
---|---|
admin_ids |
Discord user IDs who can change models and bypass restrictions |
allowed_ids |
Whitelist of allowed users/roles/channels (empty = allow all) |
blocked_ids |
Blacklist of blocked users/roles/channels |
-
Start the bot:
askolmo # or uv run askolmo
-
With Docker:
docker-compose up
-
Invite bot to your server: Use the invite URL printed in the console when the bot starts.
- Mention the bot (
@AskOlmo
) in any channel to start a conversation - Reply to bot messages to continue the conversation thread
- Use
/model
command to view or switch between available Olmo models (admin only)
- Automatic threading: Messages are linked together for context
- File attachments: Upload text files (.txt, .py, .c, etc.) for analysis
- Rate limiting: Built-in protection against spam (20 messages/hour by default)
- Content safety: Optional Google Cloud content moderation
- Admin users: Can change models and bypass some restrictions
- Guild restrictions: Bot can be limited to specific Discord servers
- Channel/role permissions: Fine-grained access control
The bot consists of several key components:
AskOlmoConfigManager
: Handles YAML configuration and environment variablesAskOlmoPermissionManager
: Manages user, role, and channel permissionsAskOlmoRateLimiter
: Enforces per-user message limitsAskOlmoMessageProcessor
: Processes message chains and builds contextAskOlmoResponseGenerator
: Generates streaming responses from Olmo modelsGoogleModerateText
: Optional content safety checking
You can use environment variables instead of config file values:
export DISCORD_BOT_TOKEN="your-bot-token"
export DISCORD_CLIENT_ID="your-client-id"
export DISCORD_ALLOWED_GUILD_IDS="guild1,guild2,guild3"
export DISCORD_ADMIN_IDS="user1,user2"
Contributions are welcome! Please feel free to submit issues and pull requests.
AskOlmo uses ruff for style and correctness checks.
# Lint checks
ruff check .
# Format and sort imports
ruff format .
ruff check --select I --fix .