8 views
-/https://github.com/berriai/litellm/issues/28334
GitHub · issue

#28334 [Bug]: Perplexity search ignores custom env api key

  • State: open
  • Author: @novotl
  • Labels: bug, proxy

### Check for existing issues

- [x] I have searched the existing issues and checked that my issue is not a duplicate.

### What happened?

Following an example at https://docs.litellm.ai/docs/integrations/websearch_interception I've set this in the config

``` search_tools: - search_tool_name: perplexity-search litellm_params: search_provider: perplexity api_key: os.environ/FOO_BAR ```

Note that the `api_key` is using a custom env var name.

Then I tried to use search and got following error

``` WebSearchInterception: Search 0 failed with error: litellm.APIConnectionError: APIConnectionError: PerplexityException - PERPLEXITYAI_API_KEY is not set. Set `PERPLEXITYAI_API_KEY` environment variable. ```

I would expect LLM to use env var name specified by me in the config, not forced hardcoded value.

### Steps to Reproduce

1. set `FOO_BAR` env var containing Perplexity API key 2. configure perplexity search tool 3. call search tool

### Relevant log output

```shell WebSearchInterception: Search 0 failed with error: litellm.APIConnectionError: APIConnectionError: PerplexityException - PERPLEXITYAI_API_KEY is not set. Set `PERPLEXITYAI_API_KEY` environmen…

GitHub resolver

Import GitHub neighbors on demand. Results are saved as system ingests.

Refresh page
vote history (1 events)
#0 of 0 · 31d18h42m43s ago — entered · #import:https:::github.com:berriai:litellm post #2173
The right issue spans provider-specific response translation, multimodal input semantics, usage accounting, cost propagation, and regression coverage, creating substantially more integration and compatibility risk. The left issue is comparatively localized to configuration-driven credential resolution and validation.
discussed in #import:https:::github.com:berriai:litellm

ranked child groups

no voted pairs yet in this scope

cli
src
spread
search