Skip to content

Commit

Permalink
chore(example/llm): minor refactor (#227)
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol authored Jun 14, 2024
1 parent db7ab71 commit 8010b5a
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 8 deletions.
6 changes: 3 additions & 3 deletions example/llm/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 13 additions & 5 deletions example/llm/flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@
# Backend service to perform inference on LLM models
ollama."ollama1" = {
enable = true;
# The models are usually huge, downloading them in every project directory can lead to a lot of duplication
dataDir = "$HOME/.services-flake/ollama1";
models = [ "llama2-uncensored" ];
# The models are usually huge, downloading them in every project
# directory can lead to a lot of duplication. Change here to a
# directory where the Ollama models can be stored and shared across
# projects.
# dataDir = "$HOME/.services-flake/ollama1";
};
# Get ChatGPT like UI, but open-source, with Open WebUI
open-webui."open-webui1" = {
Expand All @@ -33,9 +35,15 @@
inherit (pc.config.services.ollama.ollama1) host port;
in
{
OLLAMA_API_BASE_URL = "http://${host}:${toString port}";
ENABLE_OLLAMA_API = "True";
OLLAMA_BASE_URL = "http://${host}:${toString port}";
OLLAMA_API_BASE_URL = "http://${host}:${toString port}/api";
WEBUI_AUTH = "False";
};
DEVICE_TYPE = "cpu";
RAG_EMBEDDING_ENGINE = "ollama";
RAG_EMBEDDING_MODEL = "mxbai-embed-large:latest";
RAG_EMBEDDING_MODEL_AUTO_UPDATE = "True";
RAG_RERANKING_MODEL_AUTO_UPDATE = "True"; };
};
};

Expand Down

0 comments on commit 8010b5a

Please sign in to comment.