Skip to contents

Which route morie_llm_ask would take now, without sending anything. The routes are rmoriebricklayer's: an endpoint of your own, then each provider whose key is set (OpenAI, Anthropic, Google Gemini, OpenRouter, Groq, Mistral and more: rmoriebricklayer::bricklayer_llm_providers()), then Ollama (on this machine, another one, or ollama.com with your Ollama key). morie_llm_config or rmorie config setup sets them up.

Usage

morie_llm_detect_provider(route = NULL)

Arguments

route

NULL (the saved setting, else the automatic order), "auto", "own", "ollama" or a provider id such as "anthropic".

Value

The route id ("own", "ollama", a provider id), or "local" when no route is set up.

Examples

old <- Sys.getenv(c("OLLAMA_HOST", "XDG_CONFIG_HOME"), unset = NA)
Sys.setenv(OLLAMA_HOST = "off", XDG_CONFIG_HOME = tempfile())
morie_llm_detect_provider()
#> [1] "local"
for (v in names(old)) if (is.na(old[[v]])) Sys.unsetenv(v) else do.call(Sys.setenv, as.list(old[v]))