Rider cannot connect to LiteLLM AI provider

I've set-up LiteLLM on my development machine and cannot connect to it if I dont explicitly remove the virtual api key from the LiteLLM server. Here is when I try connecting to the server:

 

The server logs the following error when the user clicks on “Test Connection”:

16:19:03 - LiteLLM Proxy:ERROR: auth_exception_handler.py:79 - litellm.proxy.proxy_server.user_api_key_auth(): Exception occured - LiteLLM Virtual Key expected. Received=raspberry, expected to start with 'sk-'.

First,  a virtual key is a key generated on the server, so clients are able to make identifiable requests to that server.

Second, that error message means whoever developed and tested this functionality on Rider probably used a Raspberry Pi to do so, and they used the key “raspberry” for the connections. Now, the server requires the virtual key to start with the industry (or OpenAI) standard key prefix “sk-”. Also, that key can be generated in 2 ways:

  1. Via environment variable when running the server. In this case the user can choose how the key looks like, as long as it starts with “sk-”.
  2. Generating a new key on the UI web app of the server. In this case, the server generates a key that has prefix “sk-”.

So I would suggest you add a text box to the setting window where the user is able to input a virtual key (or not, if his server supports it without using a virtual key)

Update: I've created a ticket “RIDER-130926 Rider cannot connect to LiteLLM AI provider”

0
2 comments

Hello,

We appreciate your feedback — the team is actively working on expanding BYOK (Bring Your Own Key) support.

Using your own API key from an external cloud provider (e.g., AnthropicChatGPT) isn’t supported yet with individual subscriptions. 
For updates, please follow and vote for the related request: LLM-11585 Bring your own LLM API key for individual/personal license of AI Pro

OpenAI compatibility (see LLM-15339 Third party providers: use OpenAI API for all ) is currently intended only for local LLMs — for example, those running via OllamaLM Studio, or other self-hosted environments.

0

I got this working. 
I'll just leave the HOW here for others to find.

Clone the litellm repo. 

Create a config.yaml as per the instructions (I placed mine in the root of the project).

Configure the models you want here. You could copy the config below:

config.yaml:

general_settings:
allow_user_auth: false

model_list:
- model_name: grok 4 fast ### RECEIVED MODEL NAME ###
litellm_params: # all params accepted by litellm.completion() - https://docs.litellm.ai/docs/completion/input
model: openrouter/x-ai/grok-4-fast ### MODEL NAME sent to `litellm.completion()` ###
api_key: "os.environ/OPENROUTER_API_KEY" # does os.getenv("OPENROUTER_API_KEY")

- model_name: grok code fast 1
litellm_params:
model: openrouter/x-ai/grok-code-fast-1
api_key: "os.environ/OPENROUTER_API_KEY"

- model_name: kimi k2 thinking
litellm_params:
model: openrouter/moonshotai/kimi-k2-thinking
api_key: "os.environ/OPENROUTER_API_KEY"


In the docker compose file uncomment the part which injects this config.yaml file into the image. 

volumes:
- ./config.yaml:/app/config.yaml
command:
- "--config=/app/config.yaml"

in the .env configure your salt key and openrouter api key:

LITELLM_SALT_KEY="[some key]"
OPENROUTER_API_KEY=[openrouter api key]

Now just build and run the docker compose. 
Now configure your jetbrains ai assisstant models page like this:



 

1

Please sign in to leave a comment.