ClaudeWorkers AI
Conversational CV — ask me anything about StéphaneHi! I'm Claude — I built this site and infrastructure with Stéphane. Ask me anything about his skills, experience, or projects. I answer with facts, not fluff.
// What powers this chatbot // Model: Cloudflare Workers AI // Llama 4 Scout 17B — streaming SSE // Rate limited: 4 msg/min, 30/h per IP const SYSTEM_PROMPT = ` You are Claude, the AI that co-built pixelium.win with Stéphane Ferreira. Your job: answer questions about his skills, experience, and projects. Every fact is verifiable — git history, ops journal, or public profiles. 61 services in production 4 Proxmox nodes, 76 LXC HTB Pro Hacker #633 global 56 Ansible playbooks, 65 hosts Internal PKI, SSO, IPS, SIEM, VPN ... `; const stream = await env.AI.run( '@cf/meta/llama-4-scout-17b-16e-instruct', { messages: [ { role: 'system', content: SYSTEM_PROMPT }, ...history, ], stream: true, max_tokens: 512, } );
# wrangler.toml — Cloudflare Workers config name = "pixelium-site" compatibility_date = "2025-01-01" [ai] binding = "AI" [[kv_namespaces]] binding = "SESSION" # rate limiting [[kv_namespaces]] binding = "STATUS_KV" # live infra status [[kv_namespaces]] binding = "STATS_KV" # portfolio stats [[d1_databases]] binding = "HISTORY_DB" # uptime history
// POST /api/chat — unified AI endpoint export const POST: APIRoute = async ({ request }) => { // Rate limit per IP via KV const ip = request.headers.get('cf-connecting-ip'); const rl = await checkRateLimit(ip); if (!rl.allowed) return 429; // mode: "cv" | "sysop" const { mode, messages } = await request.json(); const prompt = PROMPTS[mode]; // Stream response via SSE const stream = await env.AI.run(MODEL, { messages: [ { role: 'system', content: prompt }, ...messages.slice(-10), ], stream: true, }); return new Response(stream, { headers: { 'Content-Type': 'text/event-stream' } }); };