Skip to content

Commit

Permalink
Add LLM_BASE_URL env
Browse files Browse the repository at this point in the history
  • Loading branch information
darmenliu committed Nov 7, 2024
1 parent 28043c6 commit 3f078f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,9 +141,14 @@ func GetLLMBackend(ctx context.Context) (lcllms.Model, error) {
openai.WithToken(apiKey),
)
case "deepseek":
baseurl := os.Getenv("LLM_BASE_URL")
if baseurl == "" {
logger.Error("LLM_BASE_URL is not set")
return nil, errors.New("LLM_BASE_URL is not set")
}
model, err = openai.New(
openai.WithModel(modelName),
openai.WithBaseURL("https://api.deepseek.com/beta"),
openai.WithBaseURL(baseurl),
openai.WithToken(apiKey),
)
case "claude":
Expand Down
1 change: 1 addition & 0 deletions envs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ export LLM_BACKEND=deepseek
export LLM_MODEL_NAME=deepseek-coder
export LLM_API_KEY=apikey
export LLM_TEMPERATURE=0.8
export LLM_BASE_URL=http://localhost:8000
export OLLAMA_SERVER_URL=http://localhost:8000

0 comments on commit 3f078f8

Please sign in to comment.