litellm/tests/test_litellm/llms/perplexity
Cursor Agent 2d1f1696c8 fix: decode Perplexity base64_int8 embeddings to OpenAI-format float arrays
Perplexity returns embeddings as base64-encoded signed int8 values by default,
not float arrays like OpenAI. This commit adds decoding in
transform_embedding_response so the proxy returns standard OpenAI-compatible
float arrays (normalized to [-1, 1]).

- Added _decode_base64_embedding() static method
- Handles both base64 strings (decoded) and float lists (passthrough)
- Added 3 new tests for base64 decoding + passthrough

Co-authored-by: Ishaan Jaff <ishaan-jaff@users.noreply.github.com>
2026-03-02 18:30:21 +00:00
..
chat Revert "Update perplexity cost tracking (#15743)" (#16345) 2025-11-06 19:00:45 -08:00
embedding fix: decode Perplexity base64_int8 embeddings to OpenAI-format float arrays 2026-03-02 18:30:21 +00:00
responses format 2026-02-23 18:05:07 +00:00
__init__.py feat: add Perplexity embedding support (pplx-embed-v1) 2026-03-02 17:00:45 +00:00
test_perplexity.py [Bug Fix] Perplexity - LiteLLM doesn't support 'web_search_options' for Perplexity' Sonar Pro model (#11983) 2025-06-23 10:21:50 -07:00
test_perplexity_cost_calculator.py fix(perplexity): use API-provided cost instead of manual calculation (#17887) 2025-12-14 08:24:44 +05:30
test_perplexity_integration.py Revert "Update perplexity cost tracking (#15743)" (#16345) 2025-11-06 19:00:45 -08:00