--- title: BlogWriter emoji: ⚡ colorFrom: yellow colorTo: blue sdk: docker app_port: 7860 pinned: false short_description: Illustrated blog-post generator, exported as .docx --- # Blog Post Generator Turn a **topic + keywords + brief** into a fully-written, illustrated blog post exported as a `.docx` file. The pipeline is *grounded*: instead of writing blind, it runs real web search, ranks the sources by authority, and writes from the most authoritative pages. ## Pipeline 1. **Search-term reasoning** — an LLM turns your topic/keywords/brief into optimized queries. 2. **Web search** — a self-hosted [SearXNG](https://github.com/searxng/searxng) instance (running inside this Space) returns the top ~25 result domains. 3. **Authority ranking** — [OpenPageRank](https://www.domcop.com/openpagerank/documentation) scores those domains; the top 5 pages are selected. 4. **Content extraction** — main article text is extracted from those pages. 5. **Writing** — a strong LLM writes an SEO-aware post from that material, weaving your keywords in and marking where images belong. 6. **Illustration** — image prompts are written by an LLM and rendered with **FLUX.1 [schnell]**. 7. **Captioning** — a vision model captions each generated image. 8. **Export** — everything is assembled into a downloadable `.docx`. ## Billing All *paid* AI calls (reasoning, writing, image generation, captioning) run through **Hugging Face Inference Providers using the HF token you enter in the UI**, so they are billed to **you**. Nothing is stored server-side. Get a token at (needs *"Make calls to Inference Providers"* permission). ## Configuration (Space owner) - **Secret `OPR_API_KEY`** — a free OpenPageRank API key (). Required for authority ranking. - **Persistent storage** *(optional)* — if enabled, `/data` is used to cache search results, scores, images and docx between runs. Without it the app still works; the cache just lives in a local directory and is not persisted. ## Models (fixed defaults) | Step | Model | | --- | --- | | Search terms & image prompts | `openai/gpt-oss-120b` | | Blog writing | `deepseek-ai/DeepSeek-V3-0324` (fallback `Qwen/Qwen2.5-72B-Instruct`) | | Image generation | `black-forest-labs/FLUX.1-schnell` | | Image captioning | `Qwen/Qwen2.5-VL-72B-Instruct` |