describegpt: add compatibility for other (local) LLMs (Ollama, Jan, etc.) #1761
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
describegpt
is limited to using the OpenAI API. This PR has several changes to allow for compatibility with other APIs including local LLMs:--base-url
to replacehttps://api.openai.com/v1
with either an Ollama endpoint (by default it'shttp://localhost:11434
) or another API compatible with the OpenAI API specification (for now just requiring the correct implementations of the/models
and/chat/completions
endpoints).--openai-key
to--api-key
.README.md
,docs/Describegpt.md
, andtests/test_describegpt.rs
to reflect changes.--ollama
flag when using Ollama./v1/models
endpoint doesn't exist yet. Once this issue is resolved and the solution works as expected then the code may be refactored and the--ollama
flag maybe removed.