Features · How It Works · Quick Start · Structure
Enter a topic, get a researched blog post. BlogWriter searches the live web for current context, then drafts a short, high-impact post with Mistral AI.
- Live Web Research — DuckDuckGo (via
ddgs) fetches real current context on any topic - Mistral AI — Drafts engaging posts with temperature 0.9 for creative output
- Word & Token Counter — Exact word count plus a real token count from Mistral's tokenizer (
mistral-common) - Copy, Download, Regenerate — Copy to clipboard, download as
.md, or regenerate (capped at 3 per topic) - Cited Sources — Every post comes with an expandable list of the sources it was built from
- Clean Split — Streamlit UI (
frontend.py) separate from logic (backend.py)
- You enter a topic in the Streamlit UI.
backend.search_web()queries DuckDuckGo for live results.- The results are injected into a Mistral prompt (
backend.generate_blog()). - The post is rendered with its sources, word/token stats, and export actions.
git clone https://github.com/kairav7220/BlogWriter.git
cd BlogWriter
pip install -r requirements.txtSet your Mistral API key in .streamlit/secrets.toml:
MISTRAL_API_KEY="..."Never commit this file — it is already in
.gitignore.
Run the app:
streamlit run frontend.pyBlogWriter/
├── frontend.py # Streamlit UI (theme, actions, session state)
├── backend.py # Web search, Mistral generation, tokenizer
├── requirements.txt # Python dependencies
├── CONTRIBUTING.md # Contribution guide
├── .gitignore
├── .streamlit/
│ ├── config.toml # App theme
│ └── secrets.toml # Your API key (gitignored)
└── LICENSE
MIT © kairav7220