[GH-ISSUE #713] Using ollama with llm-ls #78004

Closed
opened 2026-05-08 20:51:59 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @noahbald on GitHub (Oct 5, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/713

I've been trying to setup ollama to use codellama with FIM in my editor with nvim.llm and llm-ls.
As suggested in the ollama docs, this is what the locally running API may expect as a FIM request.

curl -X POST http://localhost:11434/api/generate -d '{
  "model": "codellama:7b-code",
  "prompt": "<PRE> def compute_gcd(x, y): <SUF>return result <MID>"
}'

However, when using llm-ls we can't (afaik) tell it how to structure the data it sends. It ends up sending a request that looks more like this

curl -X POST http://localhost:11434/api/generate -d '{
  "inputs": "<PRE> def compute_gcd(x, y): <SUF>return result <MID>",
  "parameters": { ... },
}'

Has anyone found a better way to set this up? Is there an alternative api endpoint we can use? Something like /api/generate/codellama:7b-code?src=llm-ls?

Originally created by @noahbald on GitHub (Oct 5, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/713 I've been trying to setup ollama to use codellama with FIM in my editor with nvim.llm and llm-ls. As suggested in the ollama docs, this is what the locally running API may expect as a FIM request. ```sh curl -X POST http://localhost:11434/api/generate -d '{ "model": "codellama:7b-code", "prompt": "<PRE> def compute_gcd(x, y): <SUF>return result <MID>" }' ``` However, when using llm-ls we can't (afaik) tell it how to structure the data it sends. It ends up sending a request that looks more like this ```sh curl -X POST http://localhost:11434/api/generate -d '{ "inputs": "<PRE> def compute_gcd(x, y): <SUF>return result <MID>", "parameters": { ... }, }' ``` Has anyone found a better way to set this up? Is there an alternative api endpoint we can use? Something like `/api/generate/codellama:7b-code?src=llm-ls`?
Author
Owner

@noahbald commented on GitHub (Oct 6, 2023):

Alternatively, llm-ls could support various backends?
https://github.com/huggingface/llm-ls/issues/17

<!-- gh-comment-id:1750284937 --> @noahbald commented on GitHub (Oct 6, 2023): Alternatively, llm-ls could support various backends? https://github.com/huggingface/llm-ls/issues/17
Author
Owner

@mxyng commented on GitHub (Oct 25, 2023):

Thanks for creating this. I wasn't aware of llm-ls. I personally use copilot and created a proxy for intercepting and rerouting copilot requests to ollama requests. You can find it here.

As for implementing this in ollama, we don't normally integrate with external projects and instead rely on the integration to implement compatibility. There are so many integrations so this approach will be unsustainable.

<!-- gh-comment-id:1780088924 --> @mxyng commented on GitHub (Oct 25, 2023): Thanks for creating this. I wasn't aware of llm-ls. I personally use copilot and created a proxy for intercepting and rerouting copilot requests to ollama requests. You can find it [here](https://github.com/mxyng/proxypilot). As for implementing this in ollama, we don't normally integrate with external projects and instead rely on the integration to implement compatibility. There are so many integrations so this approach will be unsustainable.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#78004