DEV Community

shashank ms
shashank ms

Posted on

Leveraging LLMs for Technical Writing

We are building a command-line technical writing assistant that turns rough engineering notes into structured documentation. It uses an LLM to expand bullet points, enforce a consistent style, and format everything as GitHub-flavored markdown. If you are an engineer who writes docs but hates staring at a blank page, this saves real time.

What you'll need

Step 1: Configure the Oxlo.ai Client

First, we initialize the OpenAI-compatible client pointing to Oxlo.ai. I use Llama 3.3 70B here because it handles technical instructions reliably, but Oxlo.ai also offers Qwen 3 32B and Kimi K2.6 if you prefer multilingual or reasoning-heavy output.

from openai import OpenAI

client = OpenAI(base_url="https://api.oxlo.ai/v1", api_key="YOUR_OXLO_API_KEY")

def test_connection():
    response = client.chat.completions.create(
        model="llama-3.3-70b",
        messages=[
            {"role": "system", "content": "You are a helpful assistant."},
            {"role": "user", "content": "Say hello"},
        ],
        max_tokens=10,
    )
    return response.choices[0].message.content

if __name__ == "__main__":
    print(test_connection())

Step 2: Lock in the System Prompt

The system prompt is the entire spec. It tells the model what tone to use, how to structure output, and what to preserve. I keep it in a constant so I can iterate without touching the logic.

from openai import OpenAI

client = OpenAI(base_url="https://api.oxlo.ai/v1", api_key="YOUR_OXLO_API_KEY")

SYSTEM_PROMPT = """You are a senior technical writer on an infrastructure team.
Your task is to convert rough developer notes into publication-ready markdown documentation.

Rules:
1. Output valid GitHub-flavored markdown.
2. Expand terse bullet points into concise, active-voice paragraphs.
3. Preserve all code blocks, commands, and config snippets exactly as written.
4. Add a "Prerequisites" section if setup or installation steps appear.
5. Wrap ambiguous acronyms or undefined terms in [brackets] with a short note.
6. Use second person ("you") for instructions.
7. Keep paragraphs under four sentences.
8. End with a "Next Steps" section suggesting logical follow-up actions."""

if __name__ == "__main__":
    print("System prompt loaded. Length:", len(SYSTEM_PROMPT))

Step 3: Build the Draft Polisher

This function sends the raw notes to Oxlo.ai and returns the polished draft. Because Oxlo.ai uses request-based pricing rather than token-based billing, you can pass long, messy notes without watching the meter run on input length. See the pricing


Top comments (0)