RafayGen for Developers

RafayGen is an independently built AI platform. This page describes the architecture for the technically curious and for developers interested in API access.

Architecture at a glance

  • Engine — a Python service exposing an OpenAI-compatible chat surface, routing each of the six agents to a distinct provider/model lane (Groq, Gemini, Qwen, Hugging Face, Ollama Cloud and others) with per-lane fallbacks.
  • Orchestration — agentic multi-step work (the Frontier lane, document authoring) runs through an agent framework layered on the engine.
  • Execution truth — a ledger records which provider and model actually served each request, and responses are validated against their claims (no fabricated download links).
  • Image studio — FLUX on RafayGen’s own GPU via a ComfyUI pipeline: text-to-image, img2img, edit, upscale, describe.
  • Frontend — a Next.js App Router app; the voice orb is a real-time STT → chat → streaming-TTS loop.
  • Urdu OCR — a multi-pass pipeline producing searchable text and rebuilt PDFs from scanned Urdu material.

API access

The engine speaks the OpenAI chat-completions dialect internally. Public API access is not self-serve yet — if you want to build on RafayGen, get in touch and tell us what you’re building.

Why multiple providers?

Single-provider assistants inherit that provider’s outages, rate limits and pricing. Routing per-task across providers means a fast lane stays fast, a reasoning lane stays deep, and one upstream failure doesn’t take the product down. The introduction article covers the product side of this design.