Skip to content

thaaaru/kadiya

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🐜 kadiya

A lightweight, cost-first AI assistant for Sri Lanka

Telegram Cost License Python


What is kadiya?

kadiya is a fork of NanoBot optimized for Sri Lanka.

NanoBot is an ultra-lightweight AI assistant (~4,000 lines of core code). kadiya adds a cost-first routing layer, Sinhala/English support, and Sri Lanka-specific skills on top of it β€” so you get a personal AI assistant that runs on Telegram for under $2/month.

What we added

Feature kadiya upstream NanoBot
Smart model routing Routes to cheapest model that fits the task Single model
Token optimization Prompt compression, conversation summarization Full context
Sri Lanka locale Sinhala/English, LKR, Asia/Colombo, Singlish input Global/CN focus
Sri Lanka skills Translation, PII redaction, Telegram formatting General skills
Office skills Excel, Word, PowerPoint generation --
Cost target $10+/mo LLM + $0-5/mo server Varies
Primary channel Telegram Feishu, DingTalk, QQ, WeChat, etc.
Update checker Checks GitHub releases on gateway startup --
Windows installer One-click install.bat (native, no WSL) Manual

Everything else -- the agent loop, tools, memory, cron, and all upstream channels -- is inherited from NanoBot.

Install

Windows (recommended)

Download and double-click install.bat. It installs Python (if needed), sets up kadiya, runs guided setup, and adds kadiya to your PATH.

After install, open any terminal:

kadiya agent -m "Hello!"

From source (macOS/Linux)

git clone https://github.com/thaaaru/kadiya.git
cd kadiya
pip install -e .
kadiya onboard

Quick start

1. Initialize

kadiya onboard

The guided setup will ask you to:

  • Choose a provider (DeepSeek, OpenAI, or OpenRouter)
  • Enter your API key
  • Optionally configure Telegram

2. Chat

kadiya agent -m "What is 2+2?"

3. Interactive mode

kadiya agent

Exit with exit, quit, Ctrl+C, or :q.

4. Diagnostics

kadiya doctor

Telegram setup

1. Create a bot

  • Open Telegram, search @BotFather
  • Send /newbot, follow the prompts
  • Copy the bot token

2. Run onboard (or edit ~/.nanobot/config.json manually)

kadiya onboard

Select your provider, enter your API key, then answer y to "Enable Telegram bot?" and paste your token.

3. Start the gateway

kadiya gateway

Message your bot on Telegram -- kadiya replies.

Other channels (Discord, Slack, Email, Feishu, DingTalk, QQ) are available via upstream NanoBot -- see the NanoBot README for setup.

Skills

Sri Lanka skills

Skill What it does
sl-translate Sinhala/English translation with formal/informal tone
sl-telegram Telegram-friendly formatting
sl-summarize Concise summaries optimized for mobile
sl-pii-redact Redact personal information from text

Office skills

Skill What it does
office-excel Generate Excel spreadsheets
office-word Generate Word documents
office-pptx Generate PowerPoint presentations

Web

Skill What it does
web-search Search the web (DuckDuckGo default, Brave optional)

Inherited from NanoBot

GitHub integration, weather, cron/scheduling, memory, and the skill creator. See nanobot/skills/ for the full list.

Cost

kadiya is designed to cost $10-15/month for typical personal use, depending on your setup.

Cost breakdown

Component Local setup Cloud setup
LLM API calls $10+/mo $10+/mo
Cloud server $0 (runs on your PC) $3-5/mo (cheap VPS)
Total $10+/mo $13-15/mo

Local setup β€” run kadiya on your own PC or laptop (no server cost). Cloud setup β€” run 24/7 on a VPS so Telegram works while your PC is off (e.g., Oracle Cloud free tier, Hetzner $3.29/mo, DigitalOcean $4/mo).

What keeps LLM costs low

What makes it cheap How
Smart routing Routes most messages to DeepSeek Chat (~$0.14/M input tokens)
Token compression Strips unnecessary tokens from prompts
Conversation summarization Summarizes after 5 turns instead of sending full history
Lower defaults max_tokens: 2048, max_tool_iterations: 10, memory_window: 30
Escalation only when needed Falls back to GPT-4o-mini only for structured/complex tasks

Comparison

Service Monthly cost Includes
ChatGPT Plus $20 LLM only
Claude Pro $20 LLM only
Typical API usage (GPT-4o) $10-50+ LLM only
kadiya (local) $10+ LLM API
kadiya (cloud) $13-15 LLM API + VPS

Configuration

Providers

Provider Purpose Get API key
deepseek LLM (cheapest, recommended) platform.deepseek.com
openai LLM (GPT-3.5-turbo / GPT-4o-mini) platform.openai.com
openrouter LLM (multi-provider gateway) openrouter.ai
anthropic LLM (Claude direct) console.anthropic.com
groq LLM + voice transcription (Whisper, free) console.groq.com
gemini LLM (Gemini direct) aistudio.google.com
vllm LLM (local, any OpenAI-compatible server) --

All providers from upstream NanoBot are supported. See the full provider list.

Security

Option Default Description
tools.restrictToWorkspace false Sandbox agent to workspace directory
channels.*.allowFrom [] Whitelist user IDs (empty = allow all)

CLI reference

Command Description
kadiya onboard Guided setup (provider, API key, Telegram)
kadiya agent -m "..." Send a message
kadiya agent Interactive chat
kadiya gateway Start the gateway (Telegram, etc.)
kadiya channels status Show channel status
kadiya status Show system status
kadiya doctor Run diagnostics
kadiya cron add Add a scheduled task
kadiya cron list List scheduled tasks

Project structure

kadiya/
β”œβ”€β”€ kadiya/              # kadiya additions
β”‚   β”œβ”€β”€ config.py        #   Configuration loader
β”‚   β”œβ”€β”€ router.py        #   Smart model routing
β”‚   β”œβ”€β”€ optimizer.py     #   Token optimization
β”‚   └── provider.py      #   Cost-first provider wrapper
β”œβ”€β”€ skills/              # kadiya skills
β”‚   β”œβ”€β”€ sl/              #   Sri Lanka (translate, telegram, summarize, pii-redact)
β”‚   β”œβ”€β”€ office/          #   Office (excel, word, pptx)
β”‚   └── web/             #   Web (search)
β”œβ”€β”€ configs/
β”‚   └── kadiya-sl.yaml   #   Sri Lanka configuration
β”œβ”€β”€ install.bat          # Windows installer launcher
β”œβ”€β”€ install.ps1          # Windows installer (native, no WSL)
β”œβ”€β”€ kadiya.bat           # Windows launcher
└── nanobot/             # Upstream NanoBot engine
    β”œβ”€β”€ agent/           #   Core agent logic + skills loader
    β”œβ”€β”€ skills/          #   Built-in skills (memory, cron, weather, etc.)
    β”œβ”€β”€ channels/        #   Chat integrations (Telegram, Discord, Slack, etc.)
    β”œβ”€β”€ providers/       #   LLM providers
    β”œβ”€β”€ bus/             #   Message routing
    β”œβ”€β”€ cron/            #   Scheduled tasks
    β”œβ”€β”€ config/          #   Configuration
    └── cli/             #   CLI commands

Upstream

kadiya is built on NanoBot by HKUDS. All credit for the core agent, tools, channels, and architecture goes to the NanoBot team.

If you need channels beyond Telegram (Feishu, DingTalk, QQ, Discord, Slack, Email, Mochat), or want the full documentation, see the NanoBot repository.

License

MIT

About

"🐜 Kadiya:: The customized nanobot specially for Sri Lanka"

Resources

License

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Python 88.8%
  • Shell 5.7%
  • PowerShell 2.4%
  • TypeScript 2.0%
  • Batchfile 0.5%
  • JavaScript 0.3%
  • Dockerfile 0.3%