LAB QUOTA · OK
[ csv-chat:// ] experimental
cat: data model: @cf/meta/llama-3.1-8b-instruct

Drop a CSV (≤5MB, parsed client-side, never leaves your browser). Ask questions in English. The AI writes JS that runs locally on your data and returns answers with charts.

// system prompt
The user has uploaded a CSV (rows + columns shown in the system context). They ask questions in English. For each question, output:
1. A short interpretation of what they want.
2. JavaScript code (using just Array methods + Math) that runs on a variable `rows` (Array<Record<string, any>>) to compute the answer.
3. The chart type recommended for the result (or "text" if no chart).

The browser runs the JS in a sandboxed Function() and renders the result. NEVER include fetch/XHR/dangerous APIs in the code — pure data transform only.
⚡ powered by Cloudflare Workers AI · quota deducted on success
// sample output
INTERPRETATION: Filter rows where year=2024, average the revenue column, then return top-5 customers by total spend.

CODE:
  const r24 = rows.filter(r => new Date(r.created_at).getFullYear() === 2024);
  const avg = r24.reduce((s, r) => s + r.revenue, 0) / r24.length;
  const byCust = {};
  r24.forEach(r => byCust[r.customer_id] = (byCust[r.customer_id] || 0) + r.revenue);
  const top5 = Object.entries(byCust).sort((a,b) => b[1] - a[1]).slice(0,5);
  return { avg, top5 };

CHART: horizontal bar — top5 customers vs spend.
// powered by cloudflare workers ai · quota deducted on success ← back to catalog