Integrating JetBrains Rider Air Plugin with local LLMs
I run llama-swap on my server as the proxy and runner for my local models. I host it behind a SWAG instance, which is an opinionated nginx with some extensions.
Llama-swap exposes a perfectly ordinary OpenAI-compatible API under /v1/. I already
figured out how to connect to Rider before they migrated their AI Assistant plugin to
Air. It was working, but I stopped using it because I started using a terminal on a
headless machine. About two weeks ago I tried Air, just out of curiosity, but before I
could actually tell how well it works I ran out of JetBrains credits. I decided to give
it another try, this time with my local Qwen 3.8 27B.
First I looked for Air’s settings.
There is no setting for a custom provider. That makes sense for a company like JetBrains - they want to act as the proxy and integrator of ‘AI’ and agents into the development process.
But I guessed that since OpenRouter has a URL setting, it should be possible to use it. After all, OpenRouter is just a very, very big model proxy.
When I pointed JetBrains Rider’s new Air plugin at my llama-swap proxy, it did not work.
But I got logs in llama-swap saying that something tried to access an incorrect URL,
/api/v1/models:
[INFO] Request 172.18.0.1 "GET /api/v1/key HTTP/1.1" 404 19 "ktor-client" 35.067µs
[INFO] Request 172.18.0.1 "GET /api/v1/models/user HTTP/1.1" 404 19 "ktor-client" 27.261µs
[INFO] Request 172.18.0.1 "GET /api/v1/models HTTP/1.1" 404 19 "ktor-client" 33.985µs
That is good, I thought. I can just redirect /api to / and it should work.
The mapping
Three things needed to be redirected:
GET /api/v1/models(and its sibling/api/v1/models/user) - supposedly the model catalog available for my API key, at least according to Air, because my API key was justxxx; llama-swap serves its own at/v1/models.GET /api/v1/key- Air was asking whether my API key is fine. llama-swap has API keys, but I do not use them because it is a service internal to my LAN. Responding with just204from nginx should work.- the model calls (
chat/completions,responses- the ACP agents in Rider post to/api/v1/responses) - so just a prefix rewrite/api/v1/* -> /v1/*, with buffering off and a long timeout for streaming.
The resulting nginx section in the SWAG vhost:
location = /api/v1/key {
return 204;
}
location = /api/v1/models {
include /config/nginx/proxy.conf;
proxy_pass http://172.17.0.1:8081/v1/models;
}
location = /api/v1/models/user {
include /config/nginx/proxy.conf;
proxy_pass http://172.17.0.1:8081/v1/models;
}
location /api/v1/ {
proxy_http_version 1.1;
proxy_set_header Connection "";
proxy_set_header Host $host;
proxy_pass http://172.17.0.1:8081/v1/;
proxy_buffering off;
proxy_read_timeout 3600s;
}
A static proxy_pass with a URI does the prefix rewrite for free: a request for
/api/v1/chat/completions arrives upstream as /v1/chat/completions. That is pretty
much it.
One gotcha I hit was:
invalid URL prefix in "://:"
It was caused by me trying to do the rewrite SWAG-style, with variables
(set $upstream_app ...; proxy_pass $proto://$app:$port;) so the same template works
for every app.
proxy_pass $upstream_proto://$upstream_app:$upstream_port/v1/models; # it did not work
nginx -t even passes like that. But it fails during the request with the error above.
Those variables are just not available there. And defining them in every block does not make much sense. I could probably define them in each block separately… but what is the point? It could also be possible to define them in a separate file and import it inside every block. But… meh.
Another problem I hit was a duplicated proxy_read_timeout. I tried to set
proxy_read_timeout 3600s for long streamed inference responses, and I also used the
SWAG style of setting proxy options with include /config/nginx/proxy.conf; - but that
file already sets proxy_read_timeout 240;. Two identical directives in one location
is not “last one wins”, it is:
nginx: [emerg] "proxy_read_timeout" directive is duplicate in .../llamaswap-serwer.subdomain.conf:39
nginx: configuration file /etc/nginx/nginx.conf test failed
Fixing both gave me the config above, and a working llama-swap and Rider Air integration.
In the end
Rider’s Air lists the models and chats against my llama-swap proxy, which does the
/api/v1 -> /v1 translation, and Rider shows the list of my models.
I tested it a bit and my first impression is not great. I need to look at their prompts, because they look very complicated. I asked the model to fix a nuget config that was breaking my build in Rider, but instead of doing that it went on for about 15 minutes working on my CI pipeline and writing some Python file instead, for some reason. It may also be the Junie agent - I have to check. Maybe I will install the Pi Agent into Rider and try with that one.



