DEV Community

seller-mind
seller-mind

Posted on

How I Architect Edge AI Prompts for Podcast Tools

When I first launched my indie dev podcast, I thought the hard part was hitting "record." I was wrong. The real bottleneck wasn't the audio engineering or the guest coordination; it was the administrative hangover. After a 45-minute recording session, I would spend another two hours staring at a blank screen, trying to write a compelling title, summarizing my rambling thoughts into structured show notes, and pulling out timestamps. My momentum would completely stall. I was spending more time writing about the podcast than actually making it. So I decided to build something.

The Cost of Context Switching

The problem with podcast admin isn't just that it takes time; it's the severe context switching. You go from a creative, conversational flow to a rigid, analytical formatting task. The cost of ignoring this friction is high: creator burnout and inconsistent publishing schedules.

Many creators try to solve this by slapping a raw transcript into a basic AI wrapper and calling it a day. But the output is usually a dense wall of text with a generic title like "Episode 12: A Chat About Code." That doesn't help with SEO, and it certainly doesn't make a potential listener want to click play. We needed a way to bridge the gap between raw audio and polished, structured metadata without losing the unique voice of the episode.

Architecting the Edge AI Pipeline

To solve this, I started building PodCrisp. I wanted the processing to be fast and close to the user, so I built the backend on Cloudflare Workers, leveraging their AI inference at the edge. This avoids the latency of routing heavy transcript payloads back to a centralized server.

The core of the system relies on strict prompt engineering. When generating titles, the AI needs to be creative but constrained. If you just ask an LLM for "podcast titles," it will give you clickbait.

Here is how I structure the prompt engineering for the title generator:

// Prompt engineering for podcast title generation
function buildTitlePrompt(topic, tone, count) {
  return {
    system: `You are an expert podcast producer. Generate compelling titles.
Rules:
- 5-10 words each
- Use curiosity gaps, numbers, or strong hooks
- Match the tone: ${tone}
- No clickbait that overpromises
- Format as numbered list`,
    user: `Episode topic: ${topic}

Generate ${count} title options that make someone want to click play.`
  };
}

// Example: generate 5 titles for a bootstrapping episode
const prompt = buildTitlePrompt(
  "How to start a podcast with zero budget",
  "inspirational",
  5
);
Enter fullscreen mode Exit fullscreen mode

By explicitly defining the rules in the system prompt—like enforcing a 5-10 word limit and banning overpromising clickbait—the output remains usable.

For the show notes, the challenge is taking a messy, unstructured transcript and forcing it into a clean Markdown format. I use a Cloudflare Worker to handle the inference directly. Here is a simplified version of the show notes generation pipeline:

// Show notes generation pipeline (Cloudflare Workers + AI)
export default {
  async fetch(request, env) {
    const { transcript } = await request.json();

    // Call AI model for structured show notes
    const response = await env.AI.run('@cf/meta/llama-3-8b-instruct', {
      messages: [
        {
          role: 'system',
          content: `Convert podcast transcripts to show notes:
## Episode Summary (2-3 sentences)
## Key Takeaways (5-7 bullet points)
## Timestamps (estimate from content flow)
## Resources Mentioned`
        },
        { role: 'user', content: transcript }
      ],
      max_tokens: 800,
    });

    return new Response(JSON.stringify(response), {
      headers: { 'Content-Type': 'application/json' },
    });
  },
};
Enter fullscreen mode Exit fullscreen mode

Running this at the edge means the transcript doesn't have to travel across the country to be processed. The trade-off is that you have to be very mindful of the max_tokens limit and context window sizes on edge models, but for standard 45-minute episodes, it handles the payload beautifully.

Beyond titles and show notes, the pipeline also handles SEO keyword suggestions and episode script outlines. For the script outlines, I use a similar edge worker but adjust the temperature and system prompt to focus on narrative structure rather than summarization. The SEO keyword tool parses the generated show notes to extract high-value terms that can be used in the episode's web page metadata.

Practical Results and Lessons Learned

Moving the AI inference to the edge significantly improved latency. Processing a 5,000-word transcript at the edge takes seconds instead of the 10-15 seconds I was seeing with traditional centralized APIs.

What surprised me most was how much time I spent just tuning the system prompts. Getting the AI to output clean Markdown without hallucinating timestamps took several iterations. I initially tried to let the AI guess exact timestamps, but it would often invent times that didn't match the audio. I changed the prompt to "estimate from content flow" and focused on the logical progression of topics instead, which yielded much more reliable results.

If I were starting over, I’d spend the first week purely on prompt engineering before writing a single line of UI code. The structured show notes have been the biggest win, turning my messy transcripts into readable, scannable articles that I can actually publish.

Try It Yourself

If you're struggling with the post-recording admin and want to see how different prompt styles affect the output, I've made the core logic accessible. You can try the free Podcast Title Generator at podcrisp.com/free-tools/title-generator to experiment with different tones and topics.


Full disclosure: I'm the developer of PodCrisp. I built this because I needed it myself.

Top comments (0)