[GH-ISSUE #389] Microsoft/guidance-ai integration with Ollama #177

Closed
opened 2026-04-12 09:42:26 -05:00 by GiteaMirror · 3 comments
Owner

Originally created by @JanMP on GitHub (Aug 20, 2023).
Original GitHub issue: https://github.com/ollama/ollama/issues/389

https://github.com/guidance-ai/guidance seems to be a easy and efficient way to generate tightly controlled output (like e.g json). Is there a way to use it with models provided by ollama?

Originally created by @JanMP on GitHub (Aug 20, 2023). Original GitHub issue: https://github.com/ollama/ollama/issues/389 https://github.com/guidance-ai/guidance seems to be a easy and efficient way to generate tightly controlled output (like e.g json). Is there a way to use it with models provided by ollama?
GiteaMirror added the feature requesthelp wanted labels 2026-04-12 09:42:26 -05:00
Author
Owner

@antonpolishko commented on GitHub (Aug 21, 2023):

I'm interested in guidance support as well.

Skimming through sources looks like guidance supports only OpenAI API endpoint out of the box.

Technically it's possible to wrap either Ollama's API to adhere to OpenAI APIs or create a guidance.llms.ollama. But somebody need to implement that.

Alternatively you can use langchain that already supports ollama server endpoint and has lanchain extraction example

<!-- gh-comment-id:1687053416 --> @antonpolishko commented on GitHub (Aug 21, 2023): I'm interested in guidance support as well. Skimming through sources looks like guidance supports only OpenAI API endpoint out of the box. Technically it's possible to wrap either [Ollama's API](https://github.com/jmorganca/ollama/blob/main/docs/api.md) to adhere to OpenAI APIs or create a guidance.llms.ollama. But somebody need to implement that. Alternatively you can use langchain that already supports ollama server endpoint and has [lanchain extraction example](https://python.langchain.com/docs/use_cases/extraction#option-2-parsing)
Author
Owner

@breadchris commented on GitHub (Sep 7, 2023):

llama.cpp has support for a grammar during inference https://github.com/ggerganov/llama.cpp/pull/1773. Guidance is essentially this, but perhaps implementing this would be in another issue.

<!-- gh-comment-id:1710510165 --> @breadchris commented on GitHub (Sep 7, 2023): llama.cpp has support for a grammar during inference https://github.com/ggerganov/llama.cpp/pull/1773. Guidance is essentially this, but perhaps implementing this would be in another issue.
Author
Owner

@technovangelist commented on GitHub (Dec 4, 2023):

A few weeks ago we added format: json via the api and the cli. This allows for specifying that the output must be well formed json and allows you to specify the schema to be used. It seems to cover all the aspects of the issue, so I will go ahead and close it now. If you think there is anything we left out, reopen and we can address. Thanks for being part of this great community.

<!-- gh-comment-id:1839309291 --> @technovangelist commented on GitHub (Dec 4, 2023): A few weeks ago we added `format: json` via the api and the cli. This allows for specifying that the output must be well formed json and allows you to specify the schema to be used. It seems to cover all the aspects of the issue, so I will go ahead and close it now. If you think there is anything we left out, reopen and we can address. Thanks for being part of this great community.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#177