Technical writing slows down every engineering team. I built a lightweight pipeline that turns rough bullet points into structured documentation using an LLM. It runs entirely on Oxlo.ai, so you pay per request instead of burning tokens on long technical drafts. See https://oxlo.ai/pricing for details.
What you'll need
- Python 3.10 or higher
- The OpenAI SDK:
pip install openai - An Oxlo.ai API key from https://portal.oxlo.ai
Step 1: Initialize the Oxlo.ai client
I import the OpenAI SDK and point it at Oxlo.ai. I use Llama 3.3 70B because it follows long technical instructions without drifting.
from openai import OpenAI
client = OpenAI(
base_url="https://api.oxlo.ai/v1",
api_key="YOUR_OXLO_API_KEY"
)
response = client.chat.completions.create(
model="llama-3.3-70b",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "Say hello"},
],
)
print(response.choices[0].message.content)
Step 2: Define the technical writer system prompt
A strong system prompt is the entire product. This one forces the model to write like a senior technical writer, not a chatbot.
SYSTEM_PROMPT = """You are a senior technical writer on an infrastructure team.
Your job is to convert rough notes into clear, structured documentation.
Rules:
- Write in second person ("you") for instructions.
- Use active voice.
- Include a "Prerequisites" section when setup is required.
- Format all code blocks with language tags.
- Do not use marketing language or exclamation points.
- Expand outlines into full sections with headings.
- Start with a "Summary" heading.
Output valid Markdown only. Do not add meta commentary."""
Step 3: Build the draft generator
This function sends raw notes to the model and returns a full draft. I keep temperature at 0.3 to preserve factual precision.
def draft_document(raw_notes):
response = client.chat.completions.create(
model="llama-3.3-70b",
messages=[
{"role": "system", "content": SYSTEM_PROMPT},
{"role": "user", "content": f"Convert these notes into technical documentation:\n\n{raw_notes}"},
],
temperature=0.3,
)
return response.choices[0].message.content
Step 4: Add a review pass for consistency
First drafts always have inconsistent headings or passive voice. A second call to Qwen 3 32B acts as an editor.
REVIEW_PROMPT = """You are a technical editor. Review the following documentation.
Fix passive voice, inconsistent heading levels, and missing code language tags.
Do not change the meaning. Return only the corrected Markdown."""
def review_draft(draft):
response = client.chat.completions.create(
model="qwen-3-32b",
messages=[
{"role": "system", "content": REVIEW_PROMPT},
{"role": "user", "content": draft},
],
temperature=0.2,
)
return response.choices[0].message.content
Step 5: Assemble the pipeline
Wire the stages into a single function. I print progress so you can see when each Oxlo.ai request fires.
def write_docs(raw_notes):
print("Drafting...")
draft = draft_document(raw_notes)
print("Reviewing...")
final = review_draft(draft)
return final
if __name__ == "__main__":
notes = """
- New deploy script uses docker compose instead of kubectl
- Need env vars: DATABASE_URL, REDIS_URL, API_KEY
- Steps: clone repo, copy .env.example, run ./deploy.sh
- Common issue: permission denied on deploy.sh, fix with chmod +x
"""
doc = write_docs(notes)
print("\n=== Final Document ===\n")
print(doc)
Run it
Save the script as tech_writer.py, swap in your API key, and run.
export OXLO_API_KEY="your-key-here"
python tech_writer.py
Example output:
Drafting...
Reviewing...
=== Final Document ===
Summary
This guide covers deploying the application using the updated Docker Compose workflow.
Prerequisites
Before you begin, ensure you have the following environment variables configured:
- DATABASE_URL
- REDIS_URL
- API_KEY
Deployment Steps
1. Clone the repository.
2. Copy the example environment file:
```bash
cp .env.example .env
```
3. Run the deployment script:
```bash
./deploy.sh
```
Troubleshooting
If you encounter a permission denied error when running deploy.sh, update the file permissions:
```bash
chmod +x deploy.sh
```
Wrap-up
You now have a working technical writing pipeline backed by Oxlo.ai. Two concrete ways to extend it: wire it into a GitHub Action to auto-generate README updates from commit messages, or add a third pass that uses DeepSeek V3.2 to generate OpenAPI spec fragments from endpoint notes.
Top comments (0)