IM Integration
Turn your local LLM into a powerful personal assistant on Discord, Slack, and Telegram. On Device AI can automatically reply to messages, use tools, and provide remote access to your local models.
Overview
The IM connection feature allows On Device AI to log in as a bot on supported platforms. When enabled:
- Autopilot: The app reads incoming DMs and mentions, processes them with your local model, and replies automatically.
- Privacy: All processing happens on your device. No data is sent to the IM platform's servers other than the reply you generate.
- Remote Access: Chat with your powerful Mac-hosted LLM from your phone via Telegram or Discord while on the go.
Discord Setup
- Create Application
Go to the Discord Developer Portal, click "New Application", and give it a name.
- Enable Bot
Go to the Bot tab, click "Add Bot", and confirm. Click "Reset Token" to get your Bot Token.
- Set Permissions
In the OAuth2 > URL Generator tab, select the
botscope. Under Bot Permissions, selectSend MessagesandRead Message History. - Invite & Connect
Copy the generated URL to invite the bot to your server. Paste the Bot Token into On Device AI settings.
Slack Setup
- Create App
Go to Slack API, create a new app "From scratch", and select your workspace.
- Enable Socket Mode
Go to Socket Mode, enable it, and generate an App-Level Token (
xapp-...) withconnections:writescope. - Subscribe to Events
Go to Event Subscriptions, enable events, and add
message.imandapp_mentionto "Subscribe to bot events". - Add Scopes
Go to OAuth & Permissions and add these Bot Token Scopes:
chat:write,im:history,im:read,app_mentions:read. - Install
Go to Install App, install to workspace, and copy the Bot User OAuth Token (
xoxb-...).
Telegram Setup
- Talk to BotFather
Open Telegram and search for @BotFather.
- Create Bot
Send the command
/newbot. Follow the prompts to set a name and username (ending in 'bot'). - Get Token
BotFather will send you an HTTP API token. Copy this token into On Device AI settings.
Autopilot & Tools
Once connected, you can configure how the AI behaves:
- System Prompt: Define a custom persona for your bot (e.g., "You are a helpful coding assistant").
- Tools: Enable tools like Web Search or Calculator. The bot can use these tools to answer questions in chat (e.g., "What's the weather in Tokyo?").
- Commands: Use commands like
!resetto clear context or!toolsto manage tool access directly from the chat.