File size: 2,498 Bytes
1722c47
 
 
 
 
 
31fa536
1722c47
31fa536
1722c47
 
31fa536
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
---
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 <https://huggingface.co/settings/tokens/new?ownUserPermissions=inference.serverless.write&tokenType=fineGrained>
(needs *"Make calls to Inference Providers"* permission).

## Configuration (Space owner)

- **Secret `OPR_API_KEY`** — a free OpenPageRank API key
  (<https://www.domcop.com/openpagerank/auth/signup>). 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` |