langchain-ai/langchain

Add Perplexity cost tracking

Open

#31.647 aperta il 14 apr 2025

Vedi su GitHub
 (6 commenti) (1 reazione) (1 assegnatario)Python (22.617 fork)batch import
externalhelp wantedintegrationinvestigateperplexity

Metriche repository

Star
 (136.758 star)
Metriche merge PR
 (Merge medio 10g 2h) (288 PR mergiate in 30 g)

Descrizione

Issue you'd like to raise.

costs shown on langsmith for perplexity API calls are inaccurate (even upto an order of magnitude). refer to their docs for how to calculate costs: https://docs.perplexity.ai/guides/models/sonar-reasoning-pro#detailed-pricing-breakdown-for-sonar-reasoning-pro

The problem is that pplx cost depends not only on input and output tokens but also on search queries and

Suggestion:

either add support for calculating this within langsmith platform or let users update the true cost while tracing an LLM call.

Guida contributor