cerebras_coder

This is an AI code assistant powered by Cerebras, running llama3.3-70b.

Inspired by Hassan's Llama Coder.

Architecture

The application has been converted to use Hono for better performance and caching:

  • Backend: Hono-based API server (/backend/index.ts)
  • Frontend: React SPA served from /public/
  • Database: SQLite with migrations and queries
  • Caching: HTTP caching headers for static assets and generated content

Setup

  1. Sign up for Cerebras
  2. Get a Cerebras API Key
  3. Save it in your project env variable called CEREBRAS_API_KEY

Caching Strategy

  • Static assets (JS, CSS, images): 24 hours cache
  • Versioned content (/p/:project/v/:version): Immutable cache (1 year)
  • Latest project (/p/:project): 5 minutes cache
  • Main page: 5 minutes cache

API Endpoints

  • GET / - Main application page
  • POST /api/generate - Generate code from prompt
  • GET /p/:project - Latest version of project
  • GET /p/:project/v/:version - Specific version of project
  • GET /public/* - Static assets