mirror of
https://github.com/icereed/paperless-gpt.git
synced 2025-03-13 13:18:02 -05:00
Refactor LLM provider configuration to support custom server URL
This commit is contained in:
parent
26a160209f
commit
12e6acd5a9
1 changed files with 5 additions and 0 deletions
5
main.go
5
main.go
|
@ -123,8 +123,13 @@ func createLLM() (llms.Model, error) {
|
||||||
openai.WithToken(openaiAPIKey),
|
openai.WithToken(openaiAPIKey),
|
||||||
)
|
)
|
||||||
case "ollama":
|
case "ollama":
|
||||||
|
host := os.Getenv("OLLAMA_HOST")
|
||||||
|
if host == "" {
|
||||||
|
host = "http://127.0.0.1:11434"
|
||||||
|
}
|
||||||
return ollama.New(
|
return ollama.New(
|
||||||
ollama.WithModel(llmModel),
|
ollama.WithModel(llmModel),
|
||||||
|
ollama.WithServerURL(host),
|
||||||
)
|
)
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("unsupported LLM provider: %s", llmProvider)
|
return nil, fmt.Errorf("unsupported LLM provider: %s", llmProvider)
|
||||||
|
|
Loading…
Reference in a new issue