Any Python Function
Decorator-based notifications for script execution with returned output summaries.
Real-time notifications for your Agentic pipeline
slackker sends real-time notifications to Slack, Telegram, Discord, or Microsoft Teams for your Agentic pipeline, ML training run, or automation workflow — complete with metrics, outputs, and optional plots.
from slackker.core import TelegramClient
from slackker.callbacks.simple import SimpleCallback
client = TelegramClient(
token="123456:ABC-DEF...",
verbose=1
)
notify = SimpleCallback(client)
@notify.notifier
def train_model(epochs: int):
# ... your training code ...
return {"accuracy": 0.94, "loss": 0.12}
train_model(epochs=20)
Why slackker
Decorator-based notifications for script execution with returned output summaries.
Attach to model.fit and receive metric progress during epoch training.
Track train and validation logs with monitor-based best epoch updates.
Export and send history plots so you can check model behavior quickly on mobile.
Quick start
pip install slackkerSlackClient, TelegramClient, DiscordClient or TeamsClient with your credentials.SimpleCallback, KerasCallback, or LightningCallback.Client setup
Pick your platform and follow the one-time steps to obtain the credentials you'll pass to the client constructor.
Only a bot token is needed — slackker auto-discovers your chat ID from the first message you send the bot.
Open Telegram ➤ search for @BotFather — the official bot for creating custom bots.
Send /newbot ➤ follow the prompts to give your bot a display name and a unique username (must end in bot)
BotFather replies with a token ➤ save it, this is your token parameter:
1234567890:AAAA_A111BBBBBCCC2DD3eEe44f5GGGgGG
Open the bot's chat in Telegram ➤ send any message (e.g. "Hello!") ➤ This lets slackker auto-discover your chat ID on first connect(), no manual lookup needed.
TelegramClient(token="1234567890:AAAA_A111...")
Create a Slack App, grant it bot token scopes, install it to your workspace, then grab your token and channel ID.
Go to api.slack.com/apps ➤ Create New App ➤ From scratch. Name the app and select your workspace.
Sidebar ➤ OAuth & Permissions ➤ Bot Token Scopes ➤ add all six:
chat:writechat:write.publicfiles:readfiles:writechannels:hisotrygroups:history
Go to Basic Information ➤ Install to Workspace ➤ authorize. The app appears under Apps in Slack.
Back in OAuth & Permissions, copy the token that begins with xoxb-. This is your token:
xoxb-123234234235-123234234235-adedce74748c3844747aed48499bb
In Slack, open the target channel ➤ click the channel name ➤ Integrations ➤ Add an App. Then copy the Channel ID from the channel description (starts with C):
SlackClient(token="xoxb-...", channel_id="C04AAB77ABC")
Register an Azure AD app (free, no admin consent), add Graph permissions, then sign in once interactively. The token is cached and refreshed silently on all future runs.
Go to Azure App Registrations ➤ New registration. Name it (e.g. slackker), set Supported account types to "Any Entra ID Tenant + Personal Microsoft accounts", click Register.
On the app Overview page ➤ Copy Application (client) ID — this is your app_id ➤ Copy Directory (tenant) ID — this is your tenant_id
Sidebar ➤ API permissions ➤ Add a permission ➤ Microsoft Graph ➤ Delegated permissions. Add all four:
Chat.ReadWriteFiles.ReadWriteoffline_accessUser.Read
No admin consent is required for these delegated scopes.
In Microsoft Teams, open the chat you want to use ➤ right-click any message ➤ Copy link to message ➤ Extract chat ID embedded in the URL — typically starts with 19: and ends with @thread.v2.
On first connect(), slackker prints a short URL and a one-time code ➤ Visit the URL in any browser ➤ enter the code ➤ sign in with your work account ➤ The token is then cached and refreshed silently on all future runs.
TeamsClient(app_id="YOUR_APP_ID", tenant_id="YOUR_TENANT_ID", chat_id="19:...")
Create a Discord bot, invite it to your server, and grab your bot token and channel ID.
Go to the Discord Developer Portal ➤ New Application. Name your bot and create the app.
Sidebar ➤ Bot ➤ Reset Token (or copy existing). This is your token:
MTIzNDU2Nzg5MDEyMzQ1Njc4OToxMjM0NTY3ODkwMTIzNDU2Nzg5MDEy...
Sidebar ➤ OAuth2 ➤ URL Generator ➤ Select bot scope ➤ Set below permissions:
Send MessagesAttach Files
Visit the generated URL to invite the bot.
Go to User Settings ➤ Developer ➤ Toggle Developer Mode to ON.
Right-click your target channel ➤ Copy Channel ID:
DiscordClient(token="MTIz...", channel_id="123456789012345678")
Detailed callback usage
from slackker.core import TelegramClient
from slackker.callbacks.simple import SimpleCallback
client = TelegramClient(
token="123456:ABC-DEF...",
verbose=1
)
notify = SimpleCallback(client)
@notify.notifier
def train_model(epochs: int):
# ... your training code ...
return {"accuracy": 0.94, "loss": 0.12}
# Return value is automatically sent as a notification
train_model(epochs=20)
from slackker.core import TelegramClient
from slackker.callbacks.keras import KerasCallback
client = TelegramClient(
token="123456:ABC-DEF...",
verbose=1
)
slackker_cb = KerasCallback(
client=client,
model_name="ImageClassifierV1",
export="png",
send_plot=True,
)
history = model.fit(
x_train,
y_train,
epochs=20,
batch_size=32,
validation_data=(x_val, y_val),
callbacks=[slackker_cb]
)
from lightning.pytorch import Trainer
from slackker.core import TelegramClient
from slackker.callbacks.lightning import LightningCallback
client = TelegramClient(
token="123456:ABC-DEF...",
verbose=1
)
class LightningModel(LightningModule):
def training_step(self, batch, batch_idx):
x, y = batch
y_hat = self.forward(x)
loss = F.cross_entropy(y_hat, y)
accuracy = (torch.max(y_hat, 1)[1] == y).float().mean()
# log with on_epoch=True so slackker can read them at epoch end
self.log("train_loss", loss, on_epoch=True)
self.log("train_acc", accuracy, on_epoch=True)
return loss
def validation_step(self, batch, batch_idx):
x, y = batch
y_hat = self.forward(x)
loss = F.cross_entropy(y_hat, y)
accuracy = (torch.max(y_hat, 1)[1] == y).float().mean()
# log with on_epoch=True so slackker can read them at epoch end
self.log("val_loss", loss, on_epoch=True)
self.log("val_acc", accuracy, on_epoch=True)
return loss
model = LightningModel()
slackker_cb = LightningCallback(
client=client,
model_name="LightningClassifier",
track_logs=["train_loss", "train_acc", "val_loss", "val_acc"],
monitor="val_loss",
export="png",
send_plot=True,
)
trainer = Trainer(max_epochs=12, callbacks=[slackker_cb])
trainer.fit(model, train_loader, val_loader)
import time
from slackker.core import TelegramClient
from slackker.callbacks.simple import SimpleCallback
client = TelegramClient(
token="123456:ABC-DEF...",
verbose=1
)
notifier = SimpleCallback(client)
def main():
# Step 1
notifier.notify("📥 Step 1: Fetching data...", status="started")
time.sleep(2)
if not notifier.ask("Step 1 done. Continue?"):
notifier.stop()
return
notifier.notify("✅ Step 1: Data fetched", status="completed")
# Step 2
notifier.notify("⚙️ Step 2: Processing data...", status="started")
time.sleep(2)
if not notifier.ask("Step 2 done. Continue?"):
notifier.stop()
return
notifier.notify("✅ Step 2: Processing done", status="completed")
# Done
notifier.notify(
"🏁 Pipeline complete",
message="All steps finished ✅",
attachment="./report.pdf"
)
notifier.stop()
main()
Universal MCP setup
slackker runs as a local stdio MCP server. Pick your client below to get a ready-to-paste config snippet.
pip install "slackker[mcp]"slackker-mcp (or uv run slackker-mcp if it is not on your PATH).SLACKKER_* values in your .env file. See .env.example for reference.notify, ask, get_messages and get_status Know morehere{
"servers": {
"slackker": {
"type": "stdio",
"command": "slackker-mcp",
"env": {
"SLACKKER_PLATFORM": "slack",
"SLACKKER_TOKEN": "xoxb-...",
"SLACKKER_CHANNEL_ID": "C04AAB77ABC"
}
}
}
}
Need complete docs and compatibility notes? See Universal MCP Configuration.
Under the hood
Create a SlackClient, TelegramClient, or TeamsClient with your credentials. slackker verifies connectivity and is ready to post updates.
Pass the client to SimpleCallback, KerasCallback, or LightningCallback. Wrap your function with @notifier or drop the callback into your trainer.
Get real-time updates — execution time, returned outputs, epoch metrics, best model stats, and optional training plots — delivered straight to your phone.
Stop babysitting terminal. Slackker keeps you informed so you can stay heads-down on what actually matters.