Back to blog
6 min read

How TeleSuite Uses Open Models Today and Plans for Cocoon

  • cocoon
  • telegram-ai
  • tech-stack
  • open-models
# How TeleSuite Uses Open Models Today and Plans for Cocoon > **TL;DR**, Every AI call in TeleSuite goes through one shared adapter (`supabase/functions/_shared/inferenceProvider.ts`). Today it routes to the Lovable AI Gateway. The day Cocoon ships a public inference endpoint, we flip one environment variable. ## What Cocoon actually is, in 2026 Cocoon, the **Confidential Compute Open Network**, is Pavel Durov''s decentralized AI backend on the TON blockchain. It powers Telegram's own AI features (Custom AI Styles, on-platform image generation, the new Bot AI Translation API), and it lets GPU operators rent capacity in exchange for TON. What it is **not**, yet: a public OpenAI-style SDK. There is no `cocoon.chat.completions.create()` you can paste into your edge function today. You access Cocoon by *being inside Telegram*, through a bot, through Custom AI Styles, or through Telegram's own surfaces, and Telegram does the routing for you. ## What that means for an app builder We had two honest options: 1. **Pretend.** Ship a "Powered by Cocoon" badge and quietly call gpt-4o behind the scenes. We won''t. 2. **Build Cocoon-ready.** Use open-weight models today through a thin adapter, so the swap is a flag-flip not a refactor. We picked #2. ## The adapter pattern Every image-generation call in the product, newsletter drop covers, channel drop covers, brand-style previews, goes through one function: ```ts // supabase/functions/_shared/inferenceProvider.ts export const PROVIDER: "lovable" | "cocoon" = "lovable"; // flip when Cocoon API ships export async function generateImage({ prompt }: { prompt: string }) { if (PROVIDER === "lovable") { return callLovableAIGateway("google/gemini-2.5-flash-image", prompt); } // Cocoon branch, stubbed, awaiting public endpoint throw new Error("Cocoon provider not yet wired"); } ``` When Cocoon exposes a public endpoint, we wire the second branch and change one constant. No business logic changes. No prompt rewrites. No data migration. ## What runs on what, right now | Surface | Provider | Model | Why | |---|---|---|---| | Drop cover images | Lovable AI Gateway | `google/gemini-2.5-flash-image` (Nano Banana) | Same model family Cocoon nodes run; swap is straightforward | | Drafting copy & briefs | Lovable AI Gateway | `gemini-2.5-flash` | Cheap, fast, multimodal, no API-key juggling | | Lead enrichment | Perplexity Sonar-pro | `sonar-pro` | Live web grounding, not something Cocoon targets | | Scanner crawl | Firecrawl | n/a | HTML parsing, not AI inference | | Telegram message delivery | **Telegram Bot API** + **Business Connection** | n/a | The Premium Business Connection is the legit replacement for userbot session strings, your bot replies on your DMs with your one-tap approval | ## Worked example: drop covers, by the numbers In the last 30 days our GTM scanner logged **6,818 referral-link drops** and **93,031 paid-reaction (Star tip) events** across the Telegram channels we watch. Each one is a candidate for a Channel Drop or Newsletter Drop in TeleSuite, and every one of those drops gets a cover image generated through the adapter above. If even 10% of those events trigger a drop, that's ~10,000 image generations / month flowing through one swappable file. When Cocoon opens, that traffic moves to TON-backed GPUs without us touching the product code. ## Why the Telegram Business Connection matters more than Cocoon (today) Cocoon is the cool roadmap item. The **Telegram Business Connection** is the boring, shipped, immediately-useful one. It lets a Premium user say "this bot can read and reply to my personal DMs", and it's the only sanctioned way to automate outreach without risking a ban. We just shipped support for it as a third send mode in TeleSuite (`manual_copy` | `userbot` | `business_bot`). Premium creators can connect `@TeleSuiteBot` in Telegram → Settings → Business → Chatbots, and approved drafts go out under their own name, through Telegram's own infrastructure. That's the real "open AI on Telegram" story for 2026: not a magic SDK, but a stack of small, honest primitives, open-weight models for inference, the official Bot API for delivery, Business Connection for personal-DM trust, and a single adapter waiting on the Cocoon endpoint. --- **Try TeleSuite free**, connect your channel, generate your first drop cover, and see the adapter in action. [Start here →](/pricing) *Cannibalization check note for reviewer: confirm no existing post targets the "telegram ai stack" / "cocoon ready" keyword cluster before publishing.*

More articles