Prompt-Engineering the Human Voice: Inside louislva/read

How a minimalist Chrome extension uses multimodal LLMs to turn static web text into a performance with a thick Kiwi accent.

• View on GitHub • More from louislva

An illustration of a telegraph operator using a modern microphone, with wires transforming into Māori patterns.
By hijacking a multimodal chat endpoint, a simple browser extension gives a highly specific voice to the web.

Key Takeaways

Highlight a paragraph of dry technical documentation, press a keyboard shortcut, and listen. Instead of the robotic cadence of standard browser text-to-speech, the text is read back with a specific, rhythmic New Zealand lilt. It breathes, pauses at commas, and inflects at the end of questions.

This is the experience of using louislva/read. While every other reader extension uses standard TTS APIs, this project takes a radically different approach. It hijacks OpenAI's multimodal chat endpoint to prompt-engineer a personality into existence.

The Accent in the Machine

Standard text-to-speech is functional but sterile. Even modern, dedicated speech APIs focus on neutral, polished delivery. The developer behind this extension bypassed those entirely, opting instead for the gpt-4o-audio-preview model. By sending a system prompt demanding a 'thick Kiwi accent', the tool shifts from a mere utility to an opinionated agent.

This represents a fascinating shift in how developers treat voice interfaces. Prosody and dialect are no longer hardcoded into audio models. They are malleable traits that can be summoned with natural language.

const response = await fetch('https://api.openai.com/v1/chat/completions', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${apiKey}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    model: 'gpt-4o-audio-preview',
    modalities: ['text', 'audio'],
    audio: { voice: 'alloy', format: 'wav' },
    messages: [
      {
        role: 'system',
        content: 'Read the following text with a thick Kiwi accent.'
      },
      {
        role: 'user',
        content: selectedText
      }
    ]
  })
});

Architecture of a 4KB Surgical Strike

Under the hood, the extension is a masterclass in minimalism. Totaling roughly 4KB of vanilla JavaScript, it relies entirely on native browser APIs and Manifest V3 architecture. There are no build steps, no React components, and no external dependencies.

The background.js file acts as a dormant listener. It waits for the user to trigger the designated keyboard command. Once fired, it broadcasts a message to content.js, which captures the highlighted text and initiates the audio pipeline.

The binary-to-breath pipeline converts API responses into physical sound waves using native browser APIs.

The LLM-as-a-Parser Landscape

The web scraping and reading landscape is currently dominated by massive infrastructure projects. Tools like Firecrawl manage distributed bot networks to bypass anti-scraping protections. In contrast, local-first extensions execute a surgical strike directly within the user's authenticated session.

Featurelouislva/readFirecrawl (API)Native Browser TTS
ArchitectureLocal ExtensionDistributed CloudOS Level
Voice CustomizationPrompt-EngineeredN/A (Text Only)Fixed System Voices
DependenciesZeroHeavyZero
PrivacyHigh (Local Context)Low (Sends to Cloud)High (On-Device)

The Rise of the Vibe-Utility

This project exemplifies a growing trend of 'vibe-coding' where developers build single-purpose tools to solve personal friction points. By stripping away complex UI frameworks and relying on raw Web APIs, the code remains auditable and perfectly tailored to one specific job.

An illustration of a surgical scalpel lifting a clean paragraph of text from a cluttered page of ads.
Local-first extensions act as surgical tools, extracting exactly what is needed without the overhead of heavy infrastructure.

In an era of framework fatigue, a 100-line vanilla JavaScript file that orchestrates a global AI infrastructure to deliver a New Zealand accent is a refreshing reminder of the web's flexibility.