triobot 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. triobot-0.1.0/LICENSE +21 -0
  2. triobot-0.1.0/PKG-INFO +350 -0
  3. triobot-0.1.0/README.md +244 -0
  4. triobot-0.1.0/pyproject.toml +91 -0
  5. triobot-0.1.0/setup.cfg +4 -0
  6. triobot-0.1.0/trio/__init__.py +4 -0
  7. triobot-0.1.0/trio/__main__.py +262 -0
  8. triobot-0.1.0/trio/channels/__init__.py +1 -0
  9. triobot-0.1.0/trio/channels/base.py +111 -0
  10. triobot-0.1.0/trio/channels/cli_channel.py +118 -0
  11. triobot-0.1.0/trio/channels/discord_channel.py +162 -0
  12. triobot-0.1.0/trio/channels/email_channel.py +308 -0
  13. triobot-0.1.0/trio/channels/google_chat_channel.py +125 -0
  14. triobot-0.1.0/trio/channels/heartbeat_channel.py +47 -0
  15. triobot-0.1.0/trio/channels/imessage_channel.py +139 -0
  16. triobot-0.1.0/trio/channels/instagram_channel.py +182 -0
  17. triobot-0.1.0/trio/channels/line_channel.py +227 -0
  18. triobot-0.1.0/trio/channels/matrix_channel.py +158 -0
  19. triobot-0.1.0/trio/channels/messenger_channel.py +183 -0
  20. triobot-0.1.0/trio/channels/reddit_channel.py +229 -0
  21. triobot-0.1.0/trio/channels/signal_channel.py +212 -0
  22. triobot-0.1.0/trio/channels/slack_channel.py +170 -0
  23. triobot-0.1.0/trio/channels/sms_channel.py +156 -0
  24. triobot-0.1.0/trio/channels/teams_channel.py +115 -0
  25. triobot-0.1.0/trio/channels/telegram_channel.py +186 -0
  26. triobot-0.1.0/trio/channels/whatsapp_channel.py +130 -0
  27. triobot-0.1.0/trio/cli/__init__.py +1 -0
  28. triobot-0.1.0/trio/cli/agent.py +142 -0
  29. triobot-0.1.0/trio/cli/daemon_cmd.py +656 -0
  30. triobot-0.1.0/trio/cli/doctor_cmd.py +402 -0
  31. triobot-0.1.0/trio/cli/gateway.py +236 -0
  32. triobot-0.1.0/trio/cli/heartbeat_cmd.py +57 -0
  33. triobot-0.1.0/trio/cli/hub_cmd.py +70 -0
  34. triobot-0.1.0/trio/cli/onboard.py +1093 -0
  35. triobot-0.1.0/trio/cli/pairing_cmd.py +71 -0
  36. triobot-0.1.0/trio/cli/plugin_cmd.py +72 -0
  37. triobot-0.1.0/trio/cli/provider_cmd.py +94 -0
  38. triobot-0.1.0/trio/cli/skill_cmd.py +73 -0
  39. triobot-0.1.0/trio/cli/status.py +132 -0
  40. triobot-0.1.0/trio/cli/update_cmd.py +136 -0
  41. triobot-0.1.0/trio/core/__init__.py +1 -0
  42. triobot-0.1.0/trio/core/bus.py +92 -0
  43. triobot-0.1.0/trio/core/config.py +156 -0
  44. triobot-0.1.0/trio/core/context.py +125 -0
  45. triobot-0.1.0/trio/core/loop.py +400 -0
  46. triobot-0.1.0/trio/core/memory.py +126 -0
  47. triobot-0.1.0/trio/core/rag.py +278 -0
  48. triobot-0.1.0/trio/core/session.py +142 -0
  49. triobot-0.1.0/trio/core/subagent.py +307 -0
  50. triobot-0.1.0/trio/cron/__init__.py +1 -0
  51. triobot-0.1.0/trio/cron/__main__.py +6 -0
  52. triobot-0.1.0/trio/cron/daemon.py +631 -0
  53. triobot-0.1.0/trio/cron/heartbeat.py +210 -0
  54. triobot-0.1.0/trio/cron/scheduler.py +64 -0
  55. triobot-0.1.0/trio/hub/__init__.py +1 -0
  56. triobot-0.1.0/trio/hub/installer.py +99 -0
  57. triobot-0.1.0/trio/hub/registry.py +136 -0
  58. triobot-0.1.0/trio/plugins/__init__.py +1 -0
  59. triobot-0.1.0/trio/plugins/loader.py +109 -0
  60. triobot-0.1.0/trio/plugins/manager.py +91 -0
  61. triobot-0.1.0/trio/plugins/manifest.py +46 -0
  62. triobot-0.1.0/trio/providers/__init__.py +6 -0
  63. triobot-0.1.0/trio/providers/base.py +138 -0
  64. triobot-0.1.0/trio/providers/local.py +462 -0
  65. triobot-0.1.0/trio/providers/ollama.py +319 -0
  66. triobot-0.1.0/trio/providers/openai_compat.py +232 -0
  67. triobot-0.1.0/trio/providers/trio_local.py +548 -0
  68. triobot-0.1.0/trio/shared/__init__.py +1 -0
  69. triobot-0.1.0/trio/shared/access_store.py +144 -0
  70. triobot-0.1.0/trio/shared/context_analyzer.py +333 -0
  71. triobot-0.1.0/trio/shared/guardrails.py +535 -0
  72. triobot-0.1.0/trio/shared/pairing.py +210 -0
  73. triobot-0.1.0/trio/shared/think_parser.py +99 -0
  74. triobot-0.1.0/trio/skills/__init__.py +1 -0
  75. triobot-0.1.0/trio/skills/loader.py +127 -0
  76. triobot-0.1.0/trio/tools/__init__.py +5 -0
  77. triobot-0.1.0/trio/tools/base.py +164 -0
  78. triobot-0.1.0/trio/tools/browser.py +193 -0
  79. triobot-0.1.0/trio/tools/calendar_tool.py +145 -0
  80. triobot-0.1.0/trio/tools/email_tool.py +184 -0
  81. triobot-0.1.0/trio/tools/file_ops.py +130 -0
  82. triobot-0.1.0/trio/tools/math_solver.py +119 -0
  83. triobot-0.1.0/trio/tools/mcp_client.py +195 -0
  84. triobot-0.1.0/trio/tools/notes_tool.py +148 -0
  85. triobot-0.1.0/trio/tools/rag_tool.py +154 -0
  86. triobot-0.1.0/trio/tools/screenshot_tool.py +86 -0
  87. triobot-0.1.0/trio/tools/shell.py +98 -0
  88. triobot-0.1.0/trio/tools/subagent_tool.py +142 -0
  89. triobot-0.1.0/trio/tools/web_search.py +85 -0
  90. triobot-0.1.0/trio_model/__init__.py +14 -0
  91. triobot-0.1.0/trio_model/config.py +186 -0
  92. triobot-0.1.0/trio_model/data/__init__.py +7 -0
  93. triobot-0.1.0/trio_model/data/dataset.py +236 -0
  94. triobot-0.1.0/trio_model/data/tokenizer.py +163 -0
  95. triobot-0.1.0/trio_model/inference/__init__.py +3 -0
  96. triobot-0.1.0/trio_model/inference/server.py +285 -0
  97. triobot-0.1.0/trio_model/model/__init__.py +4 -0
  98. triobot-0.1.0/trio_model/model/architecture.py +229 -0
  99. triobot-0.1.0/trio_model/model/attention.py +147 -0
  100. triobot-0.1.0/trio_model/training/__init__.py +5 -0
  101. triobot-0.1.0/trio_model/training/cai.py +229 -0
  102. triobot-0.1.0/trio_model/training/pretrain.py +237 -0
  103. triobot-0.1.0/trio_model/training/sft.py +133 -0
  104. triobot-0.1.0/triobot.egg-info/PKG-INFO +350 -0
  105. triobot-0.1.0/triobot.egg-info/SOURCES.txt +107 -0
  106. triobot-0.1.0/triobot.egg-info/dependency_links.txt +1 -0
  107. triobot-0.1.0/triobot.egg-info/entry_points.txt +2 -0
  108. triobot-0.1.0/triobot.egg-info/requires.txt +101 -0
  109. triobot-0.1.0/triobot.egg-info/top_level.txt +3 -0
triobot-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Karan Garg
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
triobot-0.1.0/PKG-INFO ADDED
@@ -0,0 +1,350 @@
1
+ Metadata-Version: 2.4
2
+ Name: triobot
3
+ Version: 0.1.0
4
+ Summary: trio.ai - train your own AI, deploy it everywhere
5
+ Author: Karan Garg
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/iampopye/trio
8
+ Project-URL: Repository, https://github.com/iampopye/trio
9
+ Keywords: ai,agent,chatbot,llm,ollama,discord,telegram,signal,transformer,training
10
+ Classifier: Development Status :: 3 - Alpha
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Programming Language :: Python :: 3
14
+ Classifier: Programming Language :: Python :: 3.10
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Programming Language :: Python :: 3.13
18
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
19
+ Classifier: Operating System :: Microsoft :: Windows
20
+ Classifier: Operating System :: MacOS
21
+ Classifier: Operating System :: POSIX :: Linux
22
+ Classifier: Operating System :: OS Independent
23
+ Requires-Python: >=3.10
24
+ Description-Content-Type: text/markdown
25
+ License-File: LICENSE
26
+ Requires-Dist: aiohttp>=3.9.0
27
+ Requires-Dist: python-dotenv>=1.0.0
28
+ Requires-Dist: rich>=13.0.0
29
+ Requires-Dist: prompt-toolkit>=3.0.0
30
+ Provides-Extra: model
31
+ Requires-Dist: torch>=2.0.0; extra == "model"
32
+ Requires-Dist: tiktoken>=0.5.0; extra == "model"
33
+ Requires-Dist: pyyaml>=6.0; extra == "model"
34
+ Requires-Dist: numpy>=1.24.0; extra == "model"
35
+ Requires-Dist: datasets>=2.14.0; extra == "model"
36
+ Provides-Extra: local
37
+ Requires-Dist: llama-cpp-python>=0.3.0; extra == "local"
38
+ Provides-Extra: serve
39
+ Requires-Dist: fastapi>=0.104.0; extra == "serve"
40
+ Requires-Dist: uvicorn>=0.24.0; extra == "serve"
41
+ Requires-Dist: pydantic>=2.0.0; extra == "serve"
42
+ Provides-Extra: discord
43
+ Requires-Dist: discord.py>=2.3.0; extra == "discord"
44
+ Requires-Dist: yt-dlp>=2024.0.0; extra == "discord"
45
+ Requires-Dist: PyNaCl>=1.5.0; extra == "discord"
46
+ Provides-Extra: telegram
47
+ Requires-Dist: pyTelegramBotAPI>=4.14.0; extra == "telegram"
48
+ Provides-Extra: signal
49
+ Provides-Extra: slack
50
+ Requires-Dist: slack-sdk>=3.25.0; extra == "slack"
51
+ Provides-Extra: teams
52
+ Requires-Dist: botbuilder-core>=4.14.0; extra == "teams"
53
+ Requires-Dist: botbuilder-integration-aiohttp>=4.14.0; extra == "teams"
54
+ Provides-Extra: google-chat
55
+ Requires-Dist: google-auth>=2.20.0; extra == "google-chat"
56
+ Requires-Dist: google-api-python-client>=2.100.0; extra == "google-chat"
57
+ Provides-Extra: matrix
58
+ Requires-Dist: matrix-nio>=0.21.0; extra == "matrix"
59
+ Provides-Extra: sms
60
+ Requires-Dist: twilio>=8.0.0; extra == "sms"
61
+ Provides-Extra: instagram
62
+ Provides-Extra: messenger
63
+ Provides-Extra: line
64
+ Requires-Dist: line-bot-sdk>=3.0.0; extra == "line"
65
+ Provides-Extra: reddit
66
+ Requires-Dist: praw>=7.7.0; extra == "reddit"
67
+ Provides-Extra: email-channel
68
+ Requires-Dist: aiosmtplib>=2.0.0; extra == "email-channel"
69
+ Requires-Dist: aioimaplib>=1.0.0; extra == "email-channel"
70
+ Provides-Extra: screenshot
71
+ Requires-Dist: mss>=9.0.0; extra == "screenshot"
72
+ Requires-Dist: Pillow>=10.0.0; extra == "screenshot"
73
+ Provides-Extra: search
74
+ Requires-Dist: duckduckgo-search>=4.0.0; extra == "search"
75
+ Provides-Extra: math
76
+ Requires-Dist: sympy>=1.12; extra == "math"
77
+ Provides-Extra: web
78
+ Requires-Dist: beautifulsoup4>=4.12.0; extra == "web"
79
+ Requires-Dist: playwright>=1.40.0; extra == "web"
80
+ Requires-Dist: PyPDF2>=3.0.0; extra == "web"
81
+ Provides-Extra: all
82
+ Requires-Dist: triobot[model]; extra == "all"
83
+ Requires-Dist: triobot[local]; extra == "all"
84
+ Requires-Dist: triobot[serve]; extra == "all"
85
+ Requires-Dist: triobot[discord]; extra == "all"
86
+ Requires-Dist: triobot[telegram]; extra == "all"
87
+ Requires-Dist: triobot[signal]; extra == "all"
88
+ Requires-Dist: triobot[slack]; extra == "all"
89
+ Requires-Dist: triobot[teams]; extra == "all"
90
+ Requires-Dist: triobot[google_chat]; extra == "all"
91
+ Requires-Dist: triobot[matrix]; extra == "all"
92
+ Requires-Dist: triobot[sms]; extra == "all"
93
+ Requires-Dist: triobot[instagram]; extra == "all"
94
+ Requires-Dist: triobot[messenger]; extra == "all"
95
+ Requires-Dist: triobot[line]; extra == "all"
96
+ Requires-Dist: triobot[reddit]; extra == "all"
97
+ Requires-Dist: triobot[email_channel]; extra == "all"
98
+ Requires-Dist: triobot[screenshot]; extra == "all"
99
+ Requires-Dist: triobot[search]; extra == "all"
100
+ Requires-Dist: triobot[math]; extra == "all"
101
+ Requires-Dist: triobot[web]; extra == "all"
102
+ Provides-Extra: dev
103
+ Requires-Dist: pytest>=7.0; extra == "dev"
104
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
105
+ Dynamic: license-file
106
+
107
+ # trio.ai
108
+
109
+ > Your AI, everywhere.
110
+
111
+ **trio.ai** is an open-source AI agent framework. Train your own LLM, connect any provider (Ollama, OpenAI, Claude, Gemini), and deploy across CLI, Discord, Telegram, Slack, WhatsApp, Teams, and 16 more channels.
112
+
113
+ ---
114
+
115
+ ## Install
116
+
117
+ ```bash
118
+ pip install trio-ai
119
+ trio onboard
120
+ ```
121
+
122
+ That's it. Two commands. `trio onboard` auto-detects Ollama, lets you browse 1,900+ skills, and sets everything up.
123
+
124
+ Then start chatting:
125
+
126
+ ```bash
127
+ trio agent
128
+ ```
129
+
130
+ ### From source
131
+
132
+ ```bash
133
+ git clone https://github.com/iampopye/trio.git
134
+ cd trio
135
+ python install.py
136
+ trio onboard
137
+ ```
138
+
139
+ > **Need Ollama?** Install from [ollama.com](https://ollama.com), then: `ollama pull llama3.2:1b`
140
+
141
+ ---
142
+
143
+ ## What It Does
144
+
145
+ ```
146
+ You type --> trio agent --> AI responds (streaming, with tools, memory, guardrails)
147
+ ```
148
+
149
+ trio connects to any LLM and adds:
150
+ - **12 built-in tools**: web search, browser, email, calendar, notes, shell, file ops, math, screenshot, RAG, URL reader, sub-agent delegation
151
+ - **1,900+ skills**: coding, marketing, DevOps, security, finance, data science, creative writing, sysadmin, web dev
152
+ - **Sub-agent system**: delegate tasks to specialized agents (researcher, coder, reviewer, planner, summarizer)
153
+ - **Persistent memory**: remembers facts across conversations
154
+ - **5-layer guardrails**: input/output filtering, jailbreak detection
155
+ - **17 chat channels**: CLI, Discord, Telegram, Signal, Slack, WhatsApp, Teams, Google Chat, iMessage, Matrix, SMS, Instagram, Messenger, LINE, Reddit, Email
156
+ - **TrioHub**: community skill/plugin registry with 1,900+ skills across 13 categories
157
+ - **Plugin system**: extend with your own tools and skills
158
+ - **Production daemon**: runs as a system service with auto-restart and health monitoring
159
+ - **Train your own model**: the only open-source agent framework with built-in LLM training
160
+
161
+ ---
162
+
163
+ ## Commands
164
+
165
+ ```bash
166
+ trio onboard # Interactive setup wizard (6 steps)
167
+ trio agent # Interactive chat
168
+ trio agent -m "hello" # Single message
169
+ trio status # System overview
170
+ trio doctor # Diagnose issues
171
+ trio doctor --fix # Auto-repair
172
+
173
+ trio gateway # Start all chat channels
174
+ trio daemon start # Run as background service
175
+ trio daemon install # Auto-start on boot (systemd/launchd/Windows)
176
+ trio daemon status # Health, uptime, channels
177
+
178
+ trio provider add # Add LLM provider
179
+ trio pairing list # Manage DM access
180
+ trio plugin list # Manage plugins
181
+ trio skill list # Browse installed skills
182
+ trio hub search "coding" # Search TrioHub registry
183
+ trio skill install <name> # Install from TrioHub
184
+
185
+ trio update # Self-update
186
+ trio train # Train your own model
187
+ ```
188
+
189
+ ---
190
+
191
+ ## Providers
192
+
193
+ Works with **13+ LLM providers** out of the box:
194
+
195
+ | Provider | Setup |
196
+ |---|---|
197
+ | **Ollama** (local) | `ollama pull llama3.2:1b` -- auto-detected |
198
+ | **OpenAI** | API key |
199
+ | **Anthropic** (Claude) | API key |
200
+ | **Google** (Gemini) | API key |
201
+ | **Groq** | API key |
202
+ | **DeepSeek** | API key |
203
+ | **OpenRouter** | API key |
204
+ | **trio-max** (built-in) | Train your own -- no API needed |
205
+
206
+ ---
207
+
208
+ ## Chat Channels
209
+
210
+ Deploy your AI on any platform:
211
+
212
+ | Channel | Type |
213
+ |---|---|
214
+ | **CLI** | Built-in terminal chat |
215
+ | **Discord** | Bot with live message editing |
216
+ | **Telegram** | Bot with markdown support |
217
+ | **Signal** | Private messenger |
218
+ | **Slack** | Workspace bot (Socket Mode) |
219
+ | **WhatsApp** | Business API webhook |
220
+ | **Teams** | Bot Framework |
221
+ | **Google Chat** | Service account webhook |
222
+ | **iMessage** | macOS only (AppleScript) |
223
+ | **Matrix** | Element/Matrix rooms (matrix-nio) |
224
+ | **SMS** | Twilio API |
225
+ | **Instagram** | DM via Meta Graph API |
226
+ | **Messenger** | Facebook Messenger webhook |
227
+ | **LINE** | LINE Bot SDK |
228
+ | **Reddit** | Bot via PRAW |
229
+ | **Email** | IMAP receive / SMTP send |
230
+
231
+ Enable channels: `trio onboard` or edit `~/.trio/config.json`
232
+
233
+ ---
234
+
235
+ ## Sub-Agents
236
+
237
+ trio can delegate tasks to specialized sub-agents:
238
+
239
+ | Agent | Role | Tools |
240
+ |---|---|---|
241
+ | **researcher** | Web search, gather information | web_search, browser, RAG |
242
+ | **coder** | Write and debug code | shell, file_ops |
243
+ | **reviewer** | Review content for quality | none (LLM-only) |
244
+ | **planner** | Break tasks into steps | none (LLM-only) |
245
+ | **summarizer** | Condense long content | none (LLM-only) |
246
+
247
+ The main agent automatically delegates when a task benefits from specialization.
248
+
249
+ ---
250
+
251
+ ## TrioHub -- Community Registry
252
+
253
+ Browse and install skills from the community:
254
+
255
+ ```bash
256
+ trio hub search "python" # Search skills
257
+ trio hub trending # Popular skills
258
+ trio skill install <name> # Install a skill
259
+ trio skill list # Your installed skills
260
+ ```
261
+
262
+ **13 categories**: Coding (418), Web Dev (159), Marketing (163), Security (80), Finance (47), Data Science (102), Creative (79), SysAdmin (204), Education (25), Productivity (167), Legal (29), Health (21), General (415)
263
+
264
+ ---
265
+
266
+ ## Architecture
267
+
268
+ ```
269
+ User --> Channel --> MessageBus --> AgentLoop
270
+ |
271
+ +--> Build Context (memory + skills + tools)
272
+ +--> Call LLM (Ollama / OpenAI / Claude / local)
273
+ +--> Execute Tools (if needed)
274
+ +--> Delegate to Sub-Agents (if needed)
275
+ +--> Guardrails Filter
276
+ |
277
+ Response --> MessageBus --> Channel --> User
278
+ ```
279
+
280
+ ---
281
+
282
+ ## Project Structure
283
+
284
+ ```
285
+ trio/
286
+ trio/ # Agent framework
287
+ core/ # AgentLoop, MessageBus, Config, Memory, Sessions, SubAgents
288
+ providers/ # Ollama, OpenAI, Claude, Gemini, 10+ more
289
+ channels/ # 17 channels (CLI, Discord, Telegram, Slack, WhatsApp, etc.)
290
+ tools/ # 12 tools (web, browser, email, calendar, notes, shell, etc.)
291
+ skills/ # 1,900+ markdown-based skills
292
+ plugins/ # Plugin system (loader, manager, manifest)
293
+ hub/ # TrioHub community registry client
294
+ cron/ # Daemon, heartbeat, scheduler
295
+ shared/ # Guardrails, pairing security, context analyzer
296
+ cli/ # 13 CLI commands
297
+
298
+ trio_model/ # LLM engine (train your own)
299
+ model/ # Transformer (RoPE, GQA, RMSNorm, SwiGLU)
300
+ training/ # Pre-train, SFT, Constitutional AI
301
+ inference/ # FastAPI server + CLI
302
+
303
+ triohub/ # Community skill/plugin registry
304
+ index.json # 1,909 skills across 13 categories
305
+ ```
306
+
307
+ ---
308
+
309
+ ## Train Your Own Model
310
+
311
+ ```bash
312
+ pip install trio-ai[model]
313
+ trio train # Start training (pause/resume with Ctrl+C)
314
+ ```
315
+
316
+ Or on Kaggle/Colab with GPU:
317
+ ```bash
318
+ # Upload notebooks/kaggle_train_trio.ipynb
319
+ # Uses T4 GPU with Flash Attention + gradient checkpointing
320
+ ```
321
+
322
+ | Config | Params | Hardware |
323
+ |---|---|---|
324
+ | **trio-max** | Auto | Any system -- auto-optimizes |
325
+ | nano | ~1M | CPU (4GB+ RAM) |
326
+ | small | ~125M | T4 GPU (16GB) |
327
+ | medium | ~350M+ | A100 / M2+ |
328
+
329
+ ---
330
+
331
+ ## Platform Support
332
+
333
+ | Platform | Status |
334
+ |---|---|
335
+ | Windows 10/11 | Full support (NVIDIA CUDA) |
336
+ | macOS Intel | Full support |
337
+ | macOS Apple Silicon | Full support (MPS Metal) |
338
+ | Ubuntu / Debian | Full support (CUDA, ROCm) |
339
+ | Fedora / Arch | Full support |
340
+ | WSL2 | Full support (CUDA passthrough) |
341
+
342
+ ---
343
+
344
+ ## License
345
+
346
+ MIT -- Karan Garg
347
+
348
+ ---
349
+
350
+ *Built from scratch. Train it. Deploy it. Own it.*
@@ -0,0 +1,244 @@
1
+ # trio.ai
2
+
3
+ > Your AI, everywhere.
4
+
5
+ **trio.ai** is an open-source AI agent framework. Train your own LLM, connect any provider (Ollama, OpenAI, Claude, Gemini), and deploy across CLI, Discord, Telegram, Slack, WhatsApp, Teams, and 16 more channels.
6
+
7
+ ---
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ pip install trio-ai
13
+ trio onboard
14
+ ```
15
+
16
+ That's it. Two commands. `trio onboard` auto-detects Ollama, lets you browse 1,900+ skills, and sets everything up.
17
+
18
+ Then start chatting:
19
+
20
+ ```bash
21
+ trio agent
22
+ ```
23
+
24
+ ### From source
25
+
26
+ ```bash
27
+ git clone https://github.com/iampopye/trio.git
28
+ cd trio
29
+ python install.py
30
+ trio onboard
31
+ ```
32
+
33
+ > **Need Ollama?** Install from [ollama.com](https://ollama.com), then: `ollama pull llama3.2:1b`
34
+
35
+ ---
36
+
37
+ ## What It Does
38
+
39
+ ```
40
+ You type --> trio agent --> AI responds (streaming, with tools, memory, guardrails)
41
+ ```
42
+
43
+ trio connects to any LLM and adds:
44
+ - **12 built-in tools**: web search, browser, email, calendar, notes, shell, file ops, math, screenshot, RAG, URL reader, sub-agent delegation
45
+ - **1,900+ skills**: coding, marketing, DevOps, security, finance, data science, creative writing, sysadmin, web dev
46
+ - **Sub-agent system**: delegate tasks to specialized agents (researcher, coder, reviewer, planner, summarizer)
47
+ - **Persistent memory**: remembers facts across conversations
48
+ - **5-layer guardrails**: input/output filtering, jailbreak detection
49
+ - **17 chat channels**: CLI, Discord, Telegram, Signal, Slack, WhatsApp, Teams, Google Chat, iMessage, Matrix, SMS, Instagram, Messenger, LINE, Reddit, Email
50
+ - **TrioHub**: community skill/plugin registry with 1,900+ skills across 13 categories
51
+ - **Plugin system**: extend with your own tools and skills
52
+ - **Production daemon**: runs as a system service with auto-restart and health monitoring
53
+ - **Train your own model**: the only open-source agent framework with built-in LLM training
54
+
55
+ ---
56
+
57
+ ## Commands
58
+
59
+ ```bash
60
+ trio onboard # Interactive setup wizard (6 steps)
61
+ trio agent # Interactive chat
62
+ trio agent -m "hello" # Single message
63
+ trio status # System overview
64
+ trio doctor # Diagnose issues
65
+ trio doctor --fix # Auto-repair
66
+
67
+ trio gateway # Start all chat channels
68
+ trio daemon start # Run as background service
69
+ trio daemon install # Auto-start on boot (systemd/launchd/Windows)
70
+ trio daemon status # Health, uptime, channels
71
+
72
+ trio provider add # Add LLM provider
73
+ trio pairing list # Manage DM access
74
+ trio plugin list # Manage plugins
75
+ trio skill list # Browse installed skills
76
+ trio hub search "coding" # Search TrioHub registry
77
+ trio skill install <name> # Install from TrioHub
78
+
79
+ trio update # Self-update
80
+ trio train # Train your own model
81
+ ```
82
+
83
+ ---
84
+
85
+ ## Providers
86
+
87
+ Works with **13+ LLM providers** out of the box:
88
+
89
+ | Provider | Setup |
90
+ |---|---|
91
+ | **Ollama** (local) | `ollama pull llama3.2:1b` -- auto-detected |
92
+ | **OpenAI** | API key |
93
+ | **Anthropic** (Claude) | API key |
94
+ | **Google** (Gemini) | API key |
95
+ | **Groq** | API key |
96
+ | **DeepSeek** | API key |
97
+ | **OpenRouter** | API key |
98
+ | **trio-max** (built-in) | Train your own -- no API needed |
99
+
100
+ ---
101
+
102
+ ## Chat Channels
103
+
104
+ Deploy your AI on any platform:
105
+
106
+ | Channel | Type |
107
+ |---|---|
108
+ | **CLI** | Built-in terminal chat |
109
+ | **Discord** | Bot with live message editing |
110
+ | **Telegram** | Bot with markdown support |
111
+ | **Signal** | Private messenger |
112
+ | **Slack** | Workspace bot (Socket Mode) |
113
+ | **WhatsApp** | Business API webhook |
114
+ | **Teams** | Bot Framework |
115
+ | **Google Chat** | Service account webhook |
116
+ | **iMessage** | macOS only (AppleScript) |
117
+ | **Matrix** | Element/Matrix rooms (matrix-nio) |
118
+ | **SMS** | Twilio API |
119
+ | **Instagram** | DM via Meta Graph API |
120
+ | **Messenger** | Facebook Messenger webhook |
121
+ | **LINE** | LINE Bot SDK |
122
+ | **Reddit** | Bot via PRAW |
123
+ | **Email** | IMAP receive / SMTP send |
124
+
125
+ Enable channels: `trio onboard` or edit `~/.trio/config.json`
126
+
127
+ ---
128
+
129
+ ## Sub-Agents
130
+
131
+ trio can delegate tasks to specialized sub-agents:
132
+
133
+ | Agent | Role | Tools |
134
+ |---|---|---|
135
+ | **researcher** | Web search, gather information | web_search, browser, RAG |
136
+ | **coder** | Write and debug code | shell, file_ops |
137
+ | **reviewer** | Review content for quality | none (LLM-only) |
138
+ | **planner** | Break tasks into steps | none (LLM-only) |
139
+ | **summarizer** | Condense long content | none (LLM-only) |
140
+
141
+ The main agent automatically delegates when a task benefits from specialization.
142
+
143
+ ---
144
+
145
+ ## TrioHub -- Community Registry
146
+
147
+ Browse and install skills from the community:
148
+
149
+ ```bash
150
+ trio hub search "python" # Search skills
151
+ trio hub trending # Popular skills
152
+ trio skill install <name> # Install a skill
153
+ trio skill list # Your installed skills
154
+ ```
155
+
156
+ **13 categories**: Coding (418), Web Dev (159), Marketing (163), Security (80), Finance (47), Data Science (102), Creative (79), SysAdmin (204), Education (25), Productivity (167), Legal (29), Health (21), General (415)
157
+
158
+ ---
159
+
160
+ ## Architecture
161
+
162
+ ```
163
+ User --> Channel --> MessageBus --> AgentLoop
164
+ |
165
+ +--> Build Context (memory + skills + tools)
166
+ +--> Call LLM (Ollama / OpenAI / Claude / local)
167
+ +--> Execute Tools (if needed)
168
+ +--> Delegate to Sub-Agents (if needed)
169
+ +--> Guardrails Filter
170
+ |
171
+ Response --> MessageBus --> Channel --> User
172
+ ```
173
+
174
+ ---
175
+
176
+ ## Project Structure
177
+
178
+ ```
179
+ trio/
180
+ trio/ # Agent framework
181
+ core/ # AgentLoop, MessageBus, Config, Memory, Sessions, SubAgents
182
+ providers/ # Ollama, OpenAI, Claude, Gemini, 10+ more
183
+ channels/ # 17 channels (CLI, Discord, Telegram, Slack, WhatsApp, etc.)
184
+ tools/ # 12 tools (web, browser, email, calendar, notes, shell, etc.)
185
+ skills/ # 1,900+ markdown-based skills
186
+ plugins/ # Plugin system (loader, manager, manifest)
187
+ hub/ # TrioHub community registry client
188
+ cron/ # Daemon, heartbeat, scheduler
189
+ shared/ # Guardrails, pairing security, context analyzer
190
+ cli/ # 13 CLI commands
191
+
192
+ trio_model/ # LLM engine (train your own)
193
+ model/ # Transformer (RoPE, GQA, RMSNorm, SwiGLU)
194
+ training/ # Pre-train, SFT, Constitutional AI
195
+ inference/ # FastAPI server + CLI
196
+
197
+ triohub/ # Community skill/plugin registry
198
+ index.json # 1,909 skills across 13 categories
199
+ ```
200
+
201
+ ---
202
+
203
+ ## Train Your Own Model
204
+
205
+ ```bash
206
+ pip install trio-ai[model]
207
+ trio train # Start training (pause/resume with Ctrl+C)
208
+ ```
209
+
210
+ Or on Kaggle/Colab with GPU:
211
+ ```bash
212
+ # Upload notebooks/kaggle_train_trio.ipynb
213
+ # Uses T4 GPU with Flash Attention + gradient checkpointing
214
+ ```
215
+
216
+ | Config | Params | Hardware |
217
+ |---|---|---|
218
+ | **trio-max** | Auto | Any system -- auto-optimizes |
219
+ | nano | ~1M | CPU (4GB+ RAM) |
220
+ | small | ~125M | T4 GPU (16GB) |
221
+ | medium | ~350M+ | A100 / M2+ |
222
+
223
+ ---
224
+
225
+ ## Platform Support
226
+
227
+ | Platform | Status |
228
+ |---|---|
229
+ | Windows 10/11 | Full support (NVIDIA CUDA) |
230
+ | macOS Intel | Full support |
231
+ | macOS Apple Silicon | Full support (MPS Metal) |
232
+ | Ubuntu / Debian | Full support (CUDA, ROCm) |
233
+ | Fedora / Arch | Full support |
234
+ | WSL2 | Full support (CUDA passthrough) |
235
+
236
+ ---
237
+
238
+ ## License
239
+
240
+ MIT -- Karan Garg
241
+
242
+ ---
243
+
244
+ *Built from scratch. Train it. Deploy it. Own it.*
@@ -0,0 +1,91 @@
1
+ [build-system]
2
+ requires = ["setuptools>=68.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [project]
6
+ name = "triobot"
7
+ version = "0.1.0"
8
+ description = "trio.ai - train your own AI, deploy it everywhere"
9
+ readme = "README.md"
10
+ license = {text = "MIT"}
11
+ requires-python = ">=3.10"
12
+ authors = [
13
+ {name = "Karan Garg"},
14
+ ]
15
+ keywords = ["ai", "agent", "chatbot", "llm", "ollama", "discord", "telegram", "signal", "transformer", "training"]
16
+ classifiers = [
17
+ "Development Status :: 3 - Alpha",
18
+ "Intended Audience :: Developers",
19
+ "License :: OSI Approved :: MIT License",
20
+ "Programming Language :: Python :: 3",
21
+ "Programming Language :: Python :: 3.10",
22
+ "Programming Language :: Python :: 3.11",
23
+ "Programming Language :: Python :: 3.12",
24
+ "Programming Language :: Python :: 3.13",
25
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
26
+ "Operating System :: Microsoft :: Windows",
27
+ "Operating System :: MacOS",
28
+ "Operating System :: POSIX :: Linux",
29
+ "Operating System :: OS Independent",
30
+ ]
31
+ dependencies = [
32
+ "aiohttp>=3.9.0",
33
+ "python-dotenv>=1.0.0",
34
+ "rich>=13.0.0",
35
+ "prompt-toolkit>=3.0.0",
36
+ ]
37
+
38
+ [project.optional-dependencies]
39
+ model = ["torch>=2.0.0", "tiktoken>=0.5.0", "pyyaml>=6.0", "numpy>=1.24.0", "datasets>=2.14.0"]
40
+ local = ["llama-cpp-python>=0.3.0"]
41
+ serve = ["fastapi>=0.104.0", "uvicorn>=0.24.0", "pydantic>=2.0.0"]
42
+ discord = ["discord.py>=2.3.0", "yt-dlp>=2024.0.0", "PyNaCl>=1.5.0"]
43
+ telegram = ["pyTelegramBotAPI>=4.14.0"]
44
+ signal = []
45
+ slack = ["slack-sdk>=3.25.0"]
46
+ teams = ["botbuilder-core>=4.14.0", "botbuilder-integration-aiohttp>=4.14.0"]
47
+ google_chat = ["google-auth>=2.20.0", "google-api-python-client>=2.100.0"]
48
+ matrix = ["matrix-nio>=0.21.0"]
49
+ sms = ["twilio>=8.0.0"]
50
+ instagram = []
51
+ messenger = []
52
+ line = ["line-bot-sdk>=3.0.0"]
53
+ reddit = ["praw>=7.7.0"]
54
+ email_channel = ["aiosmtplib>=2.0.0", "aioimaplib>=1.0.0"]
55
+ screenshot = ["mss>=9.0.0", "Pillow>=10.0.0"]
56
+ search = ["duckduckgo-search>=4.0.0"]
57
+ math = ["sympy>=1.12"]
58
+ web = ["beautifulsoup4>=4.12.0", "playwright>=1.40.0", "PyPDF2>=3.0.0"]
59
+ all = [
60
+ "triobot[model]",
61
+ "triobot[local]",
62
+ "triobot[serve]",
63
+ "triobot[discord]",
64
+ "triobot[telegram]",
65
+ "triobot[signal]",
66
+ "triobot[slack]",
67
+ "triobot[teams]",
68
+ "triobot[google_chat]",
69
+ "triobot[matrix]",
70
+ "triobot[sms]",
71
+ "triobot[instagram]",
72
+ "triobot[messenger]",
73
+ "triobot[line]",
74
+ "triobot[reddit]",
75
+ "triobot[email_channel]",
76
+ "triobot[screenshot]",
77
+ "triobot[search]",
78
+ "triobot[math]",
79
+ "triobot[web]",
80
+ ]
81
+ dev = ["pytest>=7.0", "pytest-asyncio>=0.21.0"]
82
+
83
+ [project.scripts]
84
+ trio = "trio.__main__:main"
85
+
86
+ [project.urls]
87
+ Homepage = "https://github.com/iampopye/trio"
88
+ Repository = "https://github.com/iampopye/trio"
89
+
90
+ [tool.setuptools.packages.find]
91
+ include = ["trio*", "trio_model*"]