Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Fix FIM for OpenRouter#1097

Merged
aponcedeleonch merged 2 commits into
mainstacklok/codegate:mainfrom
fix-fim-openrouterstacklok/codegate:fix-fim-openrouterCopy head branch name to clipboard
Feb 19, 2025
Merged

Fix FIM for OpenRouter#1097
aponcedeleonch merged 2 commits into
mainstacklok/codegate:mainfrom
fix-fim-openrouterstacklok/codegate:fix-fim-openrouterCopy head branch name to clipboard

Conversation

@aponcedeleonch

@aponcedeleonch aponcedeleonch commented Feb 19, 2025

Copy link
Copy Markdown
Member

FIM was not working with OpenRouter in Continue. The reason was that we get FIM requests in /completions. LiteLLM when using acompletion is forcing /chat/completions and the return format {..., "choices":[{"delta":{"content":"some text"}}]}. However, Continue was expecting the format: {..., "choices":[{"text":"some text"}]} becuase of the endpoint it called.

With this PR we force the return format to be the latter using atext_completion from LiteLLM

@aponcedeleonch aponcedeleonch changed the title Fix fim openrouter Fix FIM for OpenRouter Feb 19, 2025
jhrozek
jhrozek previously approved these changes Feb 19, 2025

@jhrozek jhrozek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, litellm. The gift that keeps on giving.

FIM was not working with OpenRouter in Continue. The reason
was that we get FIM requests in `/completions`. LiteLLM when
using `acompletion` is forcing `/chat/completions` and the return
format `{..., "choices":[{"delta":{"content":"some text"}}]}`.
However, Continue was expecting the format:
`{..., "choices":[{"text":"some text"}]}` becuase of the endpoint
it called.

With this PR we force the return format to be the latter using
`atext_completion` from LiteLLM
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.