[GH-ISSUE #7450] Run LLM directly in Golang App without Ollama Server #4738

Open
opened 2026-04-12 15:41:02 -05:00 by GiteaMirror · 2 comments
Owner

Originally created by @faelp22 on GitHub (Oct 31, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/7450

Hello everyone, I would like to know if it is possible to run an all-minilm LLM model directly in my Golang App without having to make calls to the Ollama Server http://localhost:11434/api

I would like to take a small "all-minilm" model and use the //go:embed model/* to already have the tool embedded in the Golang binary.

The idea would be to simplify the use and infrastructure so as not to need to set up an extra Docker Container or VM, not to mention avoiding network latency.

I would like to use Ollama as a library and import the necessary parts in my Golang App.

I couldn't find any examples, if there is someone more experienced and can help me, I would appreciate it.

Originally created by @faelp22 on GitHub (Oct 31, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/7450 Hello everyone, I would like to know if it is possible to run an all-minilm LLM model directly in my Golang App without having to make calls to the Ollama Server http://localhost:11434/api I would like to take a small "all-minilm" model and use the //go:embed model/* to already have the tool embedded in the Golang binary. The idea would be to simplify the use and infrastructure so as not to need to set up an extra Docker Container or VM, not to mention avoiding network latency. I would like to use Ollama as a library and import the necessary parts in my Golang App. I couldn't find any examples, if there is someone more experienced and can help me, I would appreciate it.
GiteaMirror added the feature request label 2026-04-12 15:41:02 -05:00
Author
Owner

@brightpuddle commented on GitHub (Nov 29, 2024):

Found your issue because I had the same question.

The Cobra CLI function cmd.RunServer is exposed here and doesn't use any parameters, i.e. cmd.RunServer(nil, nil) is fine.

I tried this and got "unable to initialize llm runners unable to locate runners in any search path," so I suspect there's some other environment initialization that the CLI is doing before this. Probably nothing particularly complicated, but I need to take a deeper look into it.

Did you ever get this working? If not, I can report back once I sort it out.

<!-- gh-comment-id:2508167264 --> @brightpuddle commented on GitHub (Nov 29, 2024): Found your issue because I had the same question. The Cobra CLI function `cmd.RunServer` is exposed [here](https://github.com/ollama/ollama/blob/39e29ae5ddb9ff710c0e28652b61850f458e1205/cmd/cmd.go#L1165) and doesn't use any parameters, i.e. `cmd.RunServer(nil, nil)` is fine. I tried this and got "unable to initialize llm runners unable to locate runners in any search path," so I suspect there's some other environment initialization that the CLI is doing before this. Probably nothing particularly complicated, but I need to take a deeper look into it. Did you ever get this working? If not, I can report back once I sort it out.
Author
Owner

@youngk123 commented on GitHub (Feb 13, 2025):

I have same problem, I build v0.5.0,Error: unable to initialize llm runners unable to locate runners in any search path

<!-- gh-comment-id:2657110260 --> @youngk123 commented on GitHub (Feb 13, 2025): I have same problem, I build v0.5.0,Error: unable to initialize llm runners unable to locate runners in any search path
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#4738