Skip to content

feat(embeddings): add Perplexity embeddings provider - #10142

Open
andrewmadson-pplx wants to merge 1 commit into
simstudioai:stagingfrom
andrewmadson-pplx:pplx/embeddings-provider
Open

andrewmadson-pplx wants to merge 1 commit into
simstudioai:stagingfrom
andrewmadson-pplx:pplx/embeddings-provider

Conversation

@andrewmadson-pplx

@andrewmadson-pplx andrewmadson-pplx commented Nov 18, 2026 •

Copy link
Copy Markdown

Summary

Adds Perplexity as an Embeddings block provider, backed by the Perplexity Embeddings API (POST https://api.perplexity.ai/v1/embeddings) with pplx-embed-v1-0.6b (up to 1024 dimensions) and pplx-embed-v1-4b (up to 2560). It follows the Mistral provider: adapter, catalog entries, key resolution (BYOK, PERPLEXITY_API_KEY), the embeddings_perplexity tool, block routing, the internal tool registry, pricing, generated metadata and docs.

The API returns vectors as base64_int8 and has no float encoding (encoding_format: "float" returns 400), so the adapter decodes the signed int8 values and L2-normalizes them. Normalization keeps cosine similarity unchanged and returns a unit vector for each nonzero vector. Knowledge-base indexing stays off (kbEligible: false), the same as Mistral and Cohere.

I work at Perplexity, which operates this API.

Product update (if relevant)

Embeddings block users can pick Perplexity and choose pplx-embed-v1-4b or pplx-embed-v1-0.6b, with Matryoshka dimension reduction down to 128. Docs: integrations/embeddings.

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation
  • Other: ___________

Testing

  • cd apps/sim && bun run test -- lib/embeddings tools/embeddings blocks/blocks/embeddings.test.ts lib/internal/embeddings lib/internal/tool-operations (with the CI env vars NEXT_PUBLIC_APP_URL, DATABASE_URL, ENCRYPTION_KEY): Test Files 20 passed (20), Tests 140 passed (140). The new adapter tests cover the request body (base64_int8, reduced dimensions), the request headers, int8 decoding to unit vectors in input order, and rejection of a non-string embedding, a base64 string that does not round-trip, or a repeated index. The tool projection test now includes the new tool.
  • bun run --cwd apps/sim type-check and bun run type-check:scripts:esm: exit 0, no diagnostics.
  • bun run lint:check: all 31 tasks pass. The run reports warnings only in files that this PR does not change.
  • bun run check:tool-metadata, check:docs, check:integration-catalog, check:deployment-config, check:mapper-operation, check:canvas-sentences and check:explicit-any, plus apps/sim/scripts/check-block-registry.ts: all exit 0.
  • Live calls through the adapter's buildRequest and parse: both models at native width (1024 and 2560), and pplx-embed-v1-4b at 1024 and 128, each returned one unit vector per input at the requested width, with related inputs scoring higher than unrelated ones.

To try it: run bun run dev, add an Embeddings block, set Provider to Perplexity and enter a Perplexity API key. With pplx-embed-v1-4b and default dimensions, embed two or three strings and check you get one 2560-length vector per input, in input order. Set Dimensions to 1024 and check the vectors are 1024 long. Pick pplx-embed-v1-0.6b and check the Dimensions dropdown tops out at 1024.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Screenshots/Videos

@vercel

vercel Bot commented Nov 18, 2026

Copy link
Copy Markdown

@andrewmadson-pplx is attempting to deploy a commit to the Sim Team on Vercel.

A member of the Team first needs to authorize it.

@andrewmadson-pplx
andrewmadson-pplx marked this pull request as ready for review December 2, 2026 20:56
@greptile-apps

greptile-apps Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 5/5RetriggerView in Greptile

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Adds Perplexity to the Embeddings block with two models and selectable output widths.

  • Perplexity returns ordered vectors for embedding requests.
  • Users can choose Perplexity in the Embeddings block and tool.

No actionable issues were found. Review checks were based on source inspection; no tests or live calls were run.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Embeddings block] --> B[embeddings_perplexity]
  B --> C[Shared key selection and input checks]
  C --> D[Perplexity embeddings API]
  D --> E[Decode signed bytes and normalize]
  E --> F[Check vector count and width]
  F --> G[Return vectors and usage]
Loading

Reviews (1) · Last reviewed commit: "feat(embeddings): add Perplexity embeddi..." · Reviewed by Greptile

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant