You can now stand up an AI chat over public data from Colombia, Peru, and Mexico without building it from scratch. Croma Chat Template is an open-source template built with Vercel's AI SDK and AI Elements, connected to the Croma MCP server: the model queries judicial, tax, and registry sources in real time and streams its answers back. Try it live at chat.usecroma.com before deploying your own.
What's inside#
- Live tools: every conversation hands the model Croma's full catalog: Rama Judicial, SUNAT, RUES, SECOP, and 40+ more sources.
- Streaming everything: text, reasoning, and tool calls arrive token by token.
- A finished interface: AI Elements components with markdown responses, collapsible tool cards, dark mode, and a transcript that sticks to the bottom.
- A source picker: a searchable browser in the composer (country, category, source) pins one or more tools per message, and you can change scope mid-conversation.
- Swappable models: runs on
claude-opus-5whenANTHROPIC_API_KEYis set, and onopenai/gpt-oss-120bon Groq otherwise. Switching providers is a one-file edit. - Optional rate limiting: add two Upstash variables and
/api/chatis capped at 10 requests per minute per IP. Without them, the limiter is a no-op.
Deploy in one click#
The Deploy with Vercel button in the repository clones the project and asks for the keys as it creates it. The Croma key is free: grab one at platform.usecroma.com in about a minute.
| Variable | Required | What it does |
|---|---|---|
CROMA_API_KEY | yes | authenticates the live-data tools |
GROQ_API_KEY | one of the two | runs openai/gpt-oss-120b on Groq |
ANTHROPIC_API_KEY | one of the two | runs claude-opus-5, takes precedence when both are set |
Run it locally#
git clone https://github.com/croma-ai/croma-chat-template
cd croma-chat-template
pnpm install
cp .env.example .env.local
pnpm devLine 4 creates your env file: fill in CROMA_API_KEY and one model key, open http://localhost:3000, and try one of the starter suggestions.
Built to be changed#
The template is a starting point, not a sealed box. The model lives in one file and accepts any AI SDK provider; the system prompt, the suggestions, and the source taxonomy live in their own modules; the design is Tailwind tokens you can swap for your brand.
The API behind the chat is the same one you already know: every source is covered in the documentation, and you can try the endpoints without writing code in the tools. And if you would rather not deploy anything, the same MCP server connects straight to Claude, ChatGPT, or Cursor.