Repository navigation
Expand file tree
/
Copy pathai.json
More file actions
1 lines (1 loc) · 2.64 KB
/
Copy pathai.json
File metadata and controls
1 lines (1 loc) · 2.64 KB
1
{"slug":"ai","content":"---\ntitle: AI writing & images\ndescription: Generate docs and images in the editor — running on your own Cloudflare account, no API keys required.\n---\n\nThe editor can draft documentation and generate images for you. Both run on [Workers AI](https://developers.cloudflare.com/workers-ai/) — meaning they execute on **your** Cloudflare account, are billed to you (the free tier goes a long way for docs), and require no API keys from anyone. It works the moment your site deploys.\n\n## Writing with AI\n\nIn the editor, **Generate with AI** drafts content from a prompt, aware of\nthe page you're on (title and surrounding context), and returns Markdown that\ndrops straight into your blocks — headings, code fences, lists intact. You\nreview and edit before anything is published; AI output is a draft like any\nother.\n\n### Grounding with web search (optional)\n\nFor topics that benefit from current sources, generation can ground itself\nwith a web search first and cite what it found. Enable it by setting one\nsecret — either provider works:\n\n```bash\nwrangler secret put TAVILY_API_KEY # tavily.com\n# or\nwrangler secret put BRAVE_API_KEY # brave.com/search/api\n```\n\nWithout a key, generation still works — it just skips the search step.\n\n## Image generation\n\n<Spread image=\"/uploads/pebble-paperweight.webp\" alt=\"AI-generated illustration of a terracotta pebble with dashed lines flowing around it\" side=\"left\" width=\"32%\" caption=\"Generated from a prompt, placed as a figure — the prose flows around it.\">\n\n**Generate image** turns a prompt into an illustration you can place like any\nuploaded image — including as a figure that prose flows around, exactly like\nthis one. Generated images ride the same pipeline as uploads: they save into\nyour draft, publish as a git commit to `public/uploads/`, and are served as\nstatic assets by your own site.\n\n</Spread>\n\n## Choosing models\n\nSensible defaults ship out of the box, overridable with two variables in\n`wrangler.jsonc`:\n\n| Variable | Default |\n| --- | --- |\n| `AI_TEXT_MODEL` | `@cf/meta/llama-3.3-70b-instruct-fp8-fast` |\n| `AI_IMAGE_MODEL` | `@cf/black-forest-labs/flux-1-schnell` |\n\nAny text or image model in the\n[Workers AI catalog](https://developers.cloudflare.com/workers-ai/models/)\nworks.\n\n<Callout title=\"Why on-your-account AI matters\">\nYour prompts and your docs never route through a third party's metering\n proxy, there's no per-seat AI fee, and rate limits are yours alone. It's\n the same principle as the rest of docs.dev: the tool is ours, the\n infrastructure is yours.\n</Callout>\n","updatedAt":1783893260470,"author":"andrew"}