Together, Groq, OpenRouter, and Cerebras sell tokens. Perplexity sells search-grounded answers: a consumer AI-search product plus a Sonar-class API that retrieves the live web (or configured sources) and cites. That is Vol. 21 AI search / Vol. 21 research assistants, not an LPU. It is also not Vol. 19 perplexity (the metric)—same English word, different object.
Module 22.5 ends here; Module 22.6 starts with Cursor (AI IDEs). RAG internals remain Vol. 14. Wrap Sonar like any vendor behind Vol. 18 OpenAI SDK / FastAPI. Speech products that “just ask Perplexity out loud” still need Vol. 16/22.4 STT/TTS.
Learning Objectives
By the end of this lesson, students should be able to:
- Separate Perplexity the company/product from perplexity the LM metric (Vol. 19).
- Describe consumer Perplexity vs Sonar API as search-grounded generation with citations.
- Contrast Perplexity vs DIY RAG (Vol. 14) vs OpenRouter chat vs frontier models without search.
- Call Sonar with an OpenAI-compatible client and require citations in product UX.
- Apply Vol. 20: retrieved snippets are untrusted; wrap-as-data; do not treat citations as proof.
- Know when enterprise internal search must be your index, not the public web.
Perplexity (the company) operates an AI-search product: query → retrieve web (and other) sources → generate an answer with citations. Sonar (and successor API SKUs) exposes that loop to developers, typically over an OpenAI-compatible chat API plus search options. Perplexity is not a wafer, not a Hub, and not the scalar \(\mathrm{PPL}=\exp(\mathrm{CE})\) from Vol. 19. Online LLMs still hallucinate; citations reduce—not eliminate—grounding failures.
Search Product vs Token Host
If you only need Llama tokens, buy Together/Groq. If you need “what changed in this regulation this week?” you need retrieval. Perplexity productizes web retrieval + generation. Your internal wiki still wants Vol. 14 RAG on your corpus with ACLs. Mixing them is normal: Sonar for external news, private RAG for employee handbook.
Pricing / Strengths / Weaknesses (Qualitative)
| Dimension | Perplexity (consumer + Sonar API) | DIY RAG (Vol. 14) | OpenRouter / Together chat | Classic search + snippets |
|---|---|---|---|---|
| Pricing posture | Consumer Pro subscriptions; API per-request/token + search usage—confirm live Sonar sheet | Embeddings + vector DB + LLM tokens + your eng | Tokens only (no web unless you add tools) | Search API + your UX |
| Strengths | Live web + citations UX; fast to ship research/chat search; Sonar fits OpenAI clients; good for “what’s public now” | Your corpus, ACLs, eval, residency | Cheap/fast generation without search tax | User sees ranked docs, not only prose |
| Weaknesses | Not your private index; citation ≠ truth; ToS/data handling; search latency + cost on top of tokens; not TTS/music/IDE | You build retrieval quality | Stale parametric knowledge | No fluent answer unless you add gen |
Consumer app
- Researchers, students
- Pro tiers / focus modes
- Not your multi-tenant SLA
Sonar API
- Server-side key
- Return answer + citations
- Wrap-as-data on snippets
Internal search
- Vol. 14 hybrid + rerank
- ACL in code
- Perplexity only if web is in-scope
Do
- Show citations in the UI
- Eval faithfulness (Vol. 19 hallucination tests)
- Separate metric PPL from this vendor
- Keep FastAPI + auth in front
Don’t
- Dump private PII into web search
- Treat a cited URL as legal advice
- Use Perplexity as Groq tok/s host only
- Invent Pro-plan dollar prices here
Python: Sonar via OpenAI-Compatible Client
Base URL and model ids (sonar, sonar-pro, …) change. Confirm current Perplexity API docs. Citations may appear in message annotations or a dedicated field—parse defensively. Wrap retrieved text before any downstream tool call.
Related Lectures
| Lecture | Role |
|---|---|
| Perplexity (metric) | Homonym — exp(cross-entropy) |
| AI search / research assistants | Product category |
| RAG / hybrid search | Your corpus |
| OpenAI SDK / FastAPI | Sonar wrap |
| OpenRouter / Cerebras | Token hosts, not search |
| Cursor | Next module: AI IDEs |
“Perplexity the company is the same as PPL.” False. Second: citations mean the answer is true. Third: Sonar replaces internal ACL search. Fourth: consumer Pro is your production API contract. Fifth: Perplexity is an inference chip like Groq. Sixth: you can skip wrap-as-data because the web is “public.”
Knowledge Check
- Short Answer: What does Perplexity the company sell? Answer: Search-grounded AI answers (consumer app + Sonar-class API with citations).
- True/False: Vol. 19 perplexity (PPL) is this vendor’s stock ticker. Answer: False — PPL is exp(cross-entropy).
- Multiple Choice: Private employee handbook search should use: (a) your RAG + ACLs, (b) only public Sonar, (c) Udio. Answer: (a).
- Short Answer: Name one qualitative strength vs Together-only chat. Answer: Live web retrieval and citations (any valid).
- True/False: A cited URL guarantees factual correctness. Answer: False.
- Multiple Choice: Sonar client pattern is closest to: (a) OpenAI-compatible chat, (b) Cog GPU-seconds, (c) Cartesia TTS. Answer: (a).
- Short Answer: Which Vol. 21 lecture is the product category? Answer: AI search (or research assistants).
- True/False: Invent Perplexity Pro dollar prices from this page. Answer: False.
- Multiple Choice: Next module after Perplexity is: (a) 22.6 Cursor / AI IDEs, (b) 22.3 Veo, (c) Vol. 08 RNN. Answer: (a).
- Short Answer: Name one Vol. 18 lecture used to wrap Sonar. Answer: OpenAI SDK or FastAPI.
Key Takeaways
- Perplexity company ≠ Vol. 19 perplexity metric.
- Sonar = search + generate + citations; still untrusted snippets (Vol. 20).
- Internal corpora stay on your RAG; web questions can use Sonar.
- OpenAI-shaped wrap; no fake prices; eval faithfulness separately.
- 22.5 platforms done. Next: Cursor (AI IDEs & coding tools).
Lab: Same current-events question via (1) Together/Groq with no search, (2) Perplexity Sonar or consumer UI, (3) a Vol. 14 RAG stub over a tiny local FAQ. Students compare freshness, citations, and hallucination. Grade: explicit PPL-vs-company distinction in the write-up, wrap-as-data mention, no committed API keys. Then preview 22.6: where does Cursor sit vs these APIs?
Recap: Perplexity closes AI development platforms with search-grounded APIs. Homonym warning vs Vol. 19 PPL. IDEs next: Cursor.