DEV Community

Cover image for We built a browser-like inspect tool for prompts ๐Ÿ› ๏ธ๐ŸŽ›๐Ÿ“„
Narsagna
Narsagna

Posted on

We built a browser-like inspect tool for prompts ๐Ÿ› ๏ธ๐ŸŽ›๐Ÿ“„

Hey everyone! ๐Ÿ‘‹

Iโ€™m excited to share something weโ€™ve been working on for a while: Prompt Inspector ๐Ÿ•ต๏ธโ€โ™‚๏ธ โ€“ a browser-like inspect tool for debugging and understanding your prompts for large language models (LLMs). ๐Ÿง‘โ€๐Ÿ’ป

๐Ÿง  Why we Built This

A few months ago, we were deep into a project that analyzed GitHub repos using LLMs. Our prompts were getting longer and more complex, and we kept running into the same problem:

๐Ÿค” Which part of my prompt was actually influencing the output?

It felt like we were flying blind, tweaking random lines and hoping for the best. It reminded me of the early days of web development-before browser devtools made debugging HTML and CSS so much easier. ๐Ÿ•ธ๏ธ

Thatโ€™s when it hit us:

๐Ÿ’ก Why isnโ€™t there an โ€œInspect Elementโ€ for prompts?

modern problems gif

๐Ÿ› ๏ธ What Is Prompt Inspector?

Prompt Inspector is our answer to that question. Think of it as the โ€œbrowser inspect tabโ€ for AI prompts:

  • Paste your prompt on one side. โœ๏ธ
  • See the LLMโ€™s output on the other. ๐Ÿ‘€
  • Click on any part of the output to instantly highlight the section of your prompt that influenced it. ๐ŸŽฏ
  • Visualize and debug your prompts with clarity. ๐Ÿ–ผ๏ธ

Itโ€™s a simple idea, but itโ€™s already saved us hours of guesswork. โณ

mind = blown gif

โš™๏ธ How Does It Work?

This version is a quick and dirty prototype that runs another LLM check on top of the output (we are currently experimenting with attention maps and looking into more rigorous methods like Integrated Gradients to improve accuracy) to map output tokens back to their prompt origins.

You get a visual, interactive way to see how your instructions shape the modelโ€™s response. ๐Ÿ”„

Prompt inspector in action

  • Open Source: We are planning to open source Prompt Inspector soon. I want the communityโ€™s help to make it even better! ๐ŸŒ
  • Selective Output Editing: I often wish I could tweak just one part of the output while keeping the rest unchanged. This feature is on my roadmap. โœ‚๏ธ
  • Better Attribution: We are exploring advanced attribution methods for more accurate mappings. ๐Ÿงฌ
  • Your Ideas: Iโ€™d love to hear how youโ€™d use this tool, what features youโ€™d want, and any feedback or naming ideas you have. ๐Ÿ’ฌ

๐Ÿงช Try It Out

Here's the live demo and I'll share the repo link soon (lemme know in the comments if you'd like a sneak peek into the current repo). ๐Ÿ‘‡

PROMPT INSPECTOR V0.1

Prompt engineering is becoming a core skill for anyone working with AI. But right now, itโ€™s a lot of trial and error. I hope Prompt Inspector makes it a little less mysterious-and a lot more fun. ๐ŸŽ‰

If youโ€™ve ever wished you could โ€œinspectโ€ your prompts like you inspect web pages, this one's for you and it's free to use. ๐Ÿ†“


Stay tuned for the open source release!

Iโ€™d love your feedback, feature requests, and thoughts in the comments. ๐Ÿ’ก

Thanks for reading, and happy proompting! ๐Ÿš€

Top comments (0)