Inspiration

As AI models get more powerful, developers want to use them on-chain — but Solana smart contracts traditionally can’t call external APIs or handle long-running operations. Existing oracle patterns require polling, complex account handling, and fragile workflows. We wanted to fix that by making AI on-chain simple, fast, and fully decentralized.


What it does

CoolRouter is a decentralized oracle network that lets Solana smart contracts call LLMs directly — with automatic callbacks, structured outputs, and no polling ever. It routes requests across 60+ providers and 500+ models, validates responses through consensus voting, and delivers clean, type-safe data back to your contract in under 4 seconds.


How we built it

  • Designed a custom CPI architecture to automatically invoke user-defined callbacks
  • Built a decentralized oracle network with multi-node consensus voting
  • Implemented provider + model routing for OpenAI, Anthropic, Google, Meta, and many more
  • Added on-chain schemas and type-safe structured output validation
  • Created fast serialization layers and performance-tuned Solana programs
  • Integrated privacy controls, prompt caching, deterministic variants, and failover routing
  • Crafted an extremely developer-friendly Rust CPI SDK (coolrouter-cpi)

Challenges we ran into

  • Designing a callback-based architecture without requiring polling
  • Achieving sub-4-second consensus across multiple oracle nodes
  • Normalizing message formats across 60+ providers
  • Ensuring deterministic, reproducible outputs for testing
  • Handling Solana account constraints while keeping the API dead simple
  • Guaranteeing security, decentralization, and data privacy simultaneously

Accomplishments that we're proud of

  • Built the cleanest DevX in the Solana ecosystem for AI requests
  • Created a fully decentralized AI oracle network with consensus validation
  • Achieved <4s end-to-end latency, even across distributed nodes
  • Enabled developers to access 500+ AI models with one unified interface
  • Eliminated hundreds of lines of boilerplate through a single function call

What we learned

  • Developers care deeply about simplicity — removing polling was a game changer
  • Provider diversity and fallback routing dramatically improve reliability
  • Consensus validation is essential for trust in on-chain AI
  • Ensuring privacy (ZDR) is a top priority for serious builders
  • The Solana runtime can support far more advanced workflows than expected with the right architectural patterns

What's next for CoolRouter

  • Expanding multimodal support (images, video, embeddings, audio generation)
  • Adding real-time streaming responses to smart contracts
  • Supporting stateful AI agents running partially on-chain
  • Increasing the number of oracle nodes and decentralization pathways
  • Launching developer tools: dashboards, transaction explorers, cost analytics
  • Integrating new AI providers as they emerge
  • Building example AI-powered dApps: on-chain copilots, games, agents, fraud detection, and more

Built With

Share this project:

Updates