Prompt research at scale with an open model
To know whether AI assistants recommend you, you need the questions your customers actually ask them, per page, per intent and per language. Writing hundreds of those by hand does not work, and sending your page content and internal notes to a public AI API is not always allowed. Here is the workflow I use: an open model such as Qwen running on your own machine turns your sitemap into a realistic prompt set, which a tracker like Semrush or Peec AI then runs every day.
10 min read
1. Why you need prompts, not keywords
A keyword like 'italian restaurant berlin' is a fragment. A prompt is a situation: 'where can I take my parents for a quiet Italian dinner in Berlin on Sunday, one of them uses a wheelchair'. AI assistants answer the second kind, and whether you are recommended depends on details your pages may or may not cover: opening days, accessibility, price level, reservations. That is why AI visibility tools such as the Semrush AI Visibility Toolkit and Peec AI track prompts, not keywords: they run your prompt set against the assistants every day and record whether, where and how you are mentioned. The quality of what they tell you depends entirely on the prompts you give them. Ten generic prompts give you a vanity number. A few hundred prompts that mirror your real pages, intents and languages give you a map of where you win, where competitors win, and which third-party sources the assistants trust in your market.
2. Start from your sitemap
Your sitemap is the most honest list of what you want to be found for. Pull every URL, group them by template (location pages, product pages, category pages, guides) and pick the pages that carry revenue or leads. Each of those pages stands for an intent, and the intent is what the prompts should express. For each page, extract the few facts that make it distinct: title, the main heading, the city or segment, the price level, two or three features. That small context is all the model needs; you do not have to send whole pages. On a European hospitality platform I used exactly this approach for around 150 landing pages: deep links from the sitemap, a short fact sheet per page, then prompts generated per page. If you have thousands of similar pages, sample per template first and expand once the prompts prove useful.
# All URLs from a sitemap (for a sitemap index, run it again on each listed sitemap)
curl -s https://www.example.com/sitemap.xml \
| grep -o '<loc>[^<]*</loc>' | sed 's/<\/\?loc>//g' > urls.txt
# Count URLs per template (first path segment)
cut -d/ -f4 urls.txt | sort | uniq -c | sort -rn | head3. Run an open model on your own machine
Prompt generation is a perfect job for an open-weight model: the task is narrow, the output is short, and quality is easy to review. Alibaba's Qwen family is a good default. The Qwen3.5 and Qwen3.6 models are published on Hugging Face under the Apache 2.0 license, in sizes from under one billion parameters to several hundred billion, and they handle German, Spanish and many other languages well. For a laptop, a 9B model through Ollama is enough to start; for better quality and many pages, a 27B model served with vLLM on one GPU. Both expose an OpenAI-compatible API, so the same script works against either. The reason to run it locally is not only cost. Legal and data protection teams want to know where page content, internal notes and customer context go and which provider processes them. With a local model the answer is simple: nowhere, it stays on your hardware.
# Laptop: Ollama with a 9B Qwen model (OpenAI-compatible API on :11434/v1)
ollama pull qwen3.5:9b
# One GPU server: vLLM with a 27B Qwen model (OpenAI-compatible API on :8000/v1)
vllm serve Qwen/Qwen3.6-27B --max-model-len 16384Interactive
What do your customers ask an AI?
Pick an industry and the intents you care about. These examples come from templates in your browser; real prompt research generates hundreds per page with an open model on your sitemap.
Industry
Intent
- What is the best restaurant in Munich?
- Which restaurant in Munich do locals recommend?
- Compare the top three restaurant options in Munich by price and reviews
- Your brand or another restaurant in Munich: which is better for a small team?
- Where can I book a restaurant in Munich for this weekend?
- Find a restaurant in Munich with availability tomorrow
4. Generate prompts with a strict brief
The model will happily produce marketing sentences unless you stop it. Give it a strict brief: write as a real customer talking to an AI assistant, include a situation and at least one constraint, never mention the brand, vary the intent (discover, compare, decide, practical questions), and return JSON only. Ask for five to eight prompts per page and per language, generated natively in that language rather than translated, because people phrase things differently in German, Spanish and English. Keep the temperature moderate so the set has variety without nonsense. Then deduplicate across pages: near-identical prompts waste tracker budget, because AI visibility tools price by the number of prompts and models. Store page URL, intent, language and prompt in one table; that table is your audit trail and the import file for the tracker. Branded prompts ('is Example Bistro good for groups?') go into a separate set to check whether what assistants say about you is correct.
# pip install openai
# Generates customer-style prompts per page with a local model; nothing leaves your machine.
import csv, json
from openai import OpenAI
client = OpenAI(base_url="http://localhost:11434/v1", api_key="ollama") # vLLM: http://localhost:8000/v1
MODEL = "qwen3.5:9b"
BRIEF = """You write questions that real customers ask an AI assistant.
Page facts: {facts}
Write {n} prompts in {lang}. Each prompt: a real situation plus at least one constraint
(budget, date, group size, accessibility, location...). Never mention the brand.
Vary intent: discover, compare, decide, practical.
Return JSON only: [{{"intent": "...", "prompt": "..."}}]"""
pages = [ # in practice: built from your sitemap and page titles
{"url": "https://www.example.com/berlin/italian", "facts": "Italian restaurant, Berlin Mitte, mid-price, terrace, step-free access, groups up to 12"},
]
seen, rows = set(), []
for page in pages:
for lang in ["English", "German", "Spanish"]:
out = client.chat.completions.create(
model=MODEL, temperature=0.7,
messages=[{"role": "user", "content": BRIEF.format(facts=page["facts"], n=6, lang=lang)}],
).choices[0].message.content
start, end = out.find("["), out.rfind("]") + 1
for item in json.loads(out[start:end]):
key = item["prompt"].lower().strip()
if key not in seen: # drop exact duplicates across pages
seen.add(key)
rows.append([page["url"], lang, item["intent"], item["prompt"]])
with open("prompts.csv", "w", newline="") as f:
csv.writer(f).writerows([["url", "language", "intent", "prompt"], *rows])
print(len(rows), "prompts written to prompts.csv")Tip from practice
Ask the model for the intent label together with each prompt. It makes deduplication and tagging in the tracker trivial, and you can see at a glance if one intent dominates.
5. Review a sample by hand
Generated prompts are a draft, not a result. Read at least one in ten, and all of them for your top pages. Delete prompts that nobody would type, that leak the brand, that are too broad ('best restaurant') or that the page cannot possibly answer. Check each language with a native speaker for ten minutes; it is the cheapest quality gain in the whole process. Watch for a model bias toward one intent, usually 'compare', and rebalance. Then decide how many prompts you can afford to track: trackers charge per prompt and per AI model, so put the budget where the revenue is and keep a longer list for quarterly spot checks. Document the brief and the model version you used. When you regenerate in three months, you want to know whether a change in visibility comes from your work or from a different prompt set.
6. Load the set into a tracker
Now the prompts go where they are run every day. In the Semrush AI Visibility Toolkit, prompt tracking monitors specific high-value prompts on platforms such as ChatGPT and Google AI Mode and updates daily, while prompt research and competitor research show which questions mention you and your competitors. Peec AI lets you add your own prompts, organize them with tags, choose countries and models, and runs each prompt once every 24 hours on every model you select, reporting visibility, position and sentiment. Use the intent and page from your table as tags, so you can later filter 'decide' prompts for one template, or compare languages. Add three to five named competitors from the start; share of voice only means something against real alternatives. Which tool fits depends on your market and budget: if your team already lives in Semrush for SEO, its toolkit keeps everything in one place; Peec AI is strong when you need many models and countries side by side.
7. Read the trend and the cited sources
AI answers are not deterministic. The same prompt can mention you today and not tomorrow, so single days mean nothing. Look at two- to four-week trends per intent and template, and at share of voice against your named competitors. The most actionable data is often not your own visibility but the sources the assistants cite when they recommend someone: review platforms, booking and comparison portals, directories, media. Those are the places where your facts need to be complete and consistent, and sometimes where a partnership or a listing pays off faster than any change on your own site. Also read what the assistants say about you on the branded prompts: wrong opening hours, outdated prices or a closed location are fixable, but only once you see them. Turn each pattern into an experiment with a hypothesis, an owner and a date.
8. Close the loop and automate the boring part
The workflow pays off when it runs without you. Regenerate prompts when the sitemap changes, for new pages only, with the same brief and model version, and review the new ones. Export the tracker data monthly into a short report: visibility and share of voice per intent, the top cited sources, the experiments started and their effect. Pair it with the AI-referred visits from your analytics and Google's generative AI performance report in Search Console, so you can see whether visibility turns into traffic and leads. All of this can run as a scheduled job or an agent routine that opens a pull request or a ticket with the new prompts and the report, while a person approves what goes live. That is how the hospitality engagement was set up: baseline first, prompt research for around 150 landing pages with a language model, loaded up to the tracker's limit, then a monthly trend review feeding ten prioritized experiments.
Takeaway
A local open model turns your sitemap into the questions customers really ask, privately and cheaply; the tracker turns those questions into a trend you can act on.
Real projects behind this
Try it yourself
Sources and official guides
- Qwen on Hugging Face (Qwen3.6-27B model card, Apache 2.0)
- Qwen on Hugging Face (Qwen3.5-9B model card, Apache 2.0)
- Ollama: qwen3.5 models
- Ollama: OpenAI compatibility
- vLLM: OpenAI-compatible server
- sitemaps.org: Sitemaps XML format
- Semrush Knowledge Base: AI Visibility Toolkit
- Peec AI: AI search analytics
- Google Search Central: Optimizing your website for generative AI features on Google Search
More articles
- 3,025 pull requests in ten months: an AI-assisted delivery process, from the inside
- The EU AI Act for mid-sized companies: what applies to you, and when
- FinOps for AI spend: tokens, caching, routing and budgets that hold
- Making a restaurant network visible in AI answers: a GEO project, step by step
- How this site is built: static where it can be, streaming where it must
- Kubernetes cost on EKS and GKE: the same playbook, different levers
- A landing zone for mid-sized companies, in Terraform or Bicep: the parts that matter
- The legacy migration playbook: waves, parallel runs, and identical row counts and checksums
- MCP security in depth: how to let AI assistants into your product without opening the doors
- Monitoring on business outcomes: green dashboards, empty checkout
- Phone AI agents: the architecture, and the pitfalls nobody shows in the demo
- Restore tests: a backup you have never restored is only a hope
- Streaming AI answers on Azure Static Web Apps: the one header that buffered everything
- Building an AI assistant for WhatsApp, end to end: what it takes beyond the demo
- Air-gapped systems: running critical software with no internet
- Production AI on AWS: Amazon Bedrock and AgentCore in a private setup
- Production AI on Microsoft Foundry: a private reference setup for agents
- /goal, /loop or routines: stop babysitting your coding agent
- Claude's new plans: Max, Ultra and what they mean for teams
- OpenAI Codex at the end of 2026: goal mode, dots and how to lock it down
- GitHub Copilot, Claude Code or Codex? How I'd choose for a company
- GEO basics: how to show up in AI answers
- Production AI on Google Cloud: from Vertex AI to Gemini Enterprise Agent Platform
- Local LLMs in an air-gapped network: AI for your most sensitive data
- I want to run a local LLM: which server should I buy?
- MiniMax M3: an open frontier model you can run yourself?
- SEO and GEO together: a practical audit in 6 steps
- Right-size Kubernetes: the playbook that took a cluster from 7 to 4 nodes
- Private AI for sensitive data: a local LLM setup that passes the security review
- From AI prototype to production: the eight layers I add, in order
