This repository was archived by the owner on Jun 5, 2025. It is now read-only.
Commit c1c6f13
committed
Workaround for litellm using a strict OpenAI provider for OpenRouter
The problem is that litellm uses the OpenAI provider for talking to
OpenRouter, but OpenRouter uses an OpenAI dialect - for example, the
OpenAI python API no longer allows you to POST payloads that contain
`post`, but those are often used with OpenRouter for FIM. The effect is
that FIM payloads from Continue are rejected by litellm.
To work around that, we add a FIM normalizer for OpenRouter that moves
prompt to messages, like we often do during normalization, but in this
normalizer we don't de-normalize but isntead pass on the payload with
`messages` to the completion.1 parent 7d66062 commit c1c6f13
1 file changed
+17
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
| 5 | + | |
4 | 6 | | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
11 | 27 | | |
12 | 28 | | |
13 | 29 | | |
| 30 | + | |
14 | 31 | | |
15 | 32 | | |
16 | 33 | | |
| |||
0 commit comments