Local Deep Writer is a powerful article generation tool that creates comprehensive, SEO-optimized content from web research. Built on top of local language models, it produces well-structured articles with proper HTML formatting, detailed table of contents, and organized sections.
This project is inspired by and modified from langchain-ai/local-deep-researcher, but specifically focused on generating high-quality articles rather than just research summaries.
- Generates in-depth articles (1500-2000+ words)
- Creates structured content with table of contents and anchor links
- Organizes content into 5-7 well-defined sections
- Includes proper HTML formatting for web publishing
- Optimizes content with SEO keywords
- Uses local LLMs for content generation
- Leverages web research to ensure accurate, up-to-date content
- Clone the repository:
git clone https://github.com/migkapa/local-deep-writer.git
cd local-deep-writer- Set up your environment:
cp .env.example .envEdit the .env file to configure your:
- Search API preference (duckduckgo, tavily, perplexity, or searxng)
- LLM provider (ollama or lmstudio)
- Model settings and API endpoints
-
Download Ollama for your platform
-
Pull a local LLM (we recommend DeepSeek for best results):
ollama pull deepseek-r1:8b- Configure Ollama in your
.env:
LLM_PROVIDER=ollama
OLLAMA_BASE_URL="http://localhost:11434"
LOCAL_LLM=deepseek-r1:8b- Download LMStudio
- Start your selected model in LMStudio
- Configure LMStudio in your
.env:
LLM_PROVIDER=lmstudio
LMSTUDIO_BASE_URL="http://localhost:1234"
LOCAL_LLM=deepseek-r1-distill-llama-8b- Install dependencies:
pip install -e .- Start the application:
langgraph dev- Visit the LangGraph Studio UI: http://127.0.0.1:2024
The tool generates articles with:
- HTML-formatted content
- Table of contents with anchor links
- 5-7 well-structured sections
- SEO-optimized headers and content
- 1500-2000+ words of detailed content
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see the LICENSE file for details.
This project is built upon and inspired by langchain-ai/local-deep-researcher, modified to focus specifically on article generation with enhanced structure and SEO optimization.
The output of the graph is a markdown file containing the research summary, with citations to the sources used. All sources gathered during research are saved to the graph state. You can visualize them in the graph state, which is visible in LangGraph Studio:
The final summary is saved to the graph state as well:
There are various ways to deploy this graph. See Module 6 of LangChain Academy for a detailed walkthrough of deployment options with LangGraph.
A TypeScript port of this project (without Perplexity search) is available at: https://github.com/PacoVK/ollama-deep-researcher-ts
The included Dockerfile only runs LangChain Studio with local-deep-researcher as a service, but does not include Ollama as a dependant service. You must run Ollama separately and configure the OLLAMA_BASE_URL environment variable. Optionally you can also specify the Ollama model to use by providing the LOCAL_LLM environment variable.
Clone the repo and build an image:
$ docker build -t local-deep-researcher .
Run the container:
$ docker run --rm -it -p 2024:2024 \
-e SEARCH_API="tavily" \
-e TAVILY_API_KEY="tvly-***YOUR_KEY_HERE***" \
-e LLM_PROVIDER=ollama
-e OLLAMA_BASE_URL="http://host.docker.internal:11434/" \
-e LOCAL_LLM="llama3.2" \
local-deep-researcher
NOTE: You will see log message:
2025-02-10T13:45:04.784915Z [info ] 🎨 Opening Studio in your browser... [browser_opener] api_variant=local_dev message=🎨 Opening Studio in your browser...
URL: https://smith.langchain.com/studio/?baseUrl=http://0.0.0.0:2024
...but the browser will not launch from the container.
Instead, visit this link with the correct baseUrl IP address: https://smith.langchain.com/studio/thread?baseUrl=http://127.0.0.1:2024

