Skip to content

Projects

Case study

CelestialBeing

Serverless Discord study companion: slash-command in, Groq response out, no long-running gateway process.

BuiltOriginal work

LLM

01 / Overview

AI Discord companion that answers /ask prompts with LLM responses, deployed as a serverless Discord HTTP interaction handler.

  • Python
  • Flask
  • Discord Interactions
  • Groq
  • PyNaCl
  • Vercel

02 / Problem

A conventional Discord bot holds a WebSocket gateway connection, which means a process has to stay running. For a study companion that only needs to answer /ask, that operational cost is the wrong shape.

03 / Approach

CelestialBeing handles Discord HTTP interactions on a Vercel serverless endpoint. A slash command hits the endpoint, the request is signature-checked, the prompt is sent to Groq with a short model fallback list, and the reply is returned. The function then idles.

04 / Architecture

  1. 01

    Discord /ask

  2. 02

    HTTP interaction

    Discord → Vercel

  3. 03

    Signature check

    Ed25519 / PyNaCl

  4. 04

    Groq inference

    Model fallback list

  5. 05

    Interaction response

05 / Implementation

  • Flask handler under /api, deployed with vercel.json.
  • Ed25519 signature verification of inbound Discord requests using PyNaCl.
  • Groq inference with a documented fallback rotation across available models when a route is rate-limited.
  • Slash command interface: /ask with a prompt, in channels or DMs where the app is installed.

06 / Engineering decisions

HTTP interactions instead of a gateway bot
The workload is request/response. Serverless matches that better than a persistent socket, at the cost of in-process memory.
Verify before inference
Unauthorized HTTP calls should fail on the Discord signature, not on a missing API key after work has already been done.
Fallback models for availability
A single Groq model can 429. Rotating through a small list is a reliability tactic, not a quality claim about any one model.

07 / Evaluation

Evaluation data has not yet been benchmarked. No published answer-quality scores, latency distributions, or uptime measurements beyond the architecture’s intent.

08 / Limitations

  • Stateless by design: there is no documented long-term memory across turns.
  • Capacity is bounded by Groq and Vercel free-tier limits; “24/7” here means the endpoint can sleep and wake, not a measured SLA.
  • Study/Q&A companion — not a tool-using agent.
  • A Vercel URL is listed on the repository; treat it as a deployment pointer, not as evidence of production usage.