Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make config optional #449

Open
pmeier opened this issue Jul 12, 2024 · 0 comments
Open

Make config optional #449

pmeier opened this issue Jul 12, 2024 · 0 comments

Comments

@pmeier
Copy link
Member

pmeier commented Jul 12, 2024

Currently one needs to have a config file, e.g. ragna.toml, to serve Ragna (ragna ui and ragna api). Meaning, users will have to either run the interactive wizard to create one (ragna init) or copy and paste an example from our documentation. That is sub-optimal user experience, because extra steps are required (see #180).

However, this is only an issue for serving locally. When using docker, we have solved this by providing a default configuration. We do this, because it involves even more steps to be able to use a user created configuration inside a docker container.

We could bring the same UX from the docker image to local deployment as well. Meaning

  1. We do provide a default config if -c / --config is not supplied.
  2. We use all builtin source storages and assistants by default.
  3. Since in most cases users will not have satisfied the requirements of all components, we change the default to --ignore-unavailable-components.

Point 2. and 3. is exactly what we already do for docker:

ragna/ragna-docker.toml

Lines 4 to 28 in 55f7fc5

source_storages = [
"ragna.source_storages.Chroma",
"ragna.source_storages.LanceDB"
]
assistants = [
"ragna.assistants.ClaudeHaiku",
"ragna.assistants.ClaudeOpus",
"ragna.assistants.ClaudeSonnet",
"ragna.assistants.Command",
"ragna.assistants.CommandLight",
"ragna.assistants.GeminiPro",
"ragna.assistants.GeminiUltra",
"ragna.assistants.OllamaGemma2B",
"ragna.assistants.OllamaPhi2",
"ragna.assistants.OllamaLlama2",
"ragna.assistants.OllamaLlava",
"ragna.assistants.OllamaMistral",
"ragna.assistants.OllamaMixtral",
"ragna.assistants.OllamaOrcaMini",
"ragna.assistants.Gpt35Turbo16k",
"ragna.assistants.Gpt4",
"ragna.assistants.Jurassic2Ultra",
"ragna.assistants.LlamafileAssistant",
"ragna.assistants.RagnaDemoAssistant",
]

ragna/Dockerfile

Lines 32 to 33 in 55f7fc5

ENTRYPOINT ["ragna"]
CMD ["ui", "--start-api", "--ignore-unavailable-components", "--no-open-browser"]

One valid question here is what has changed between now and #180, which asked for roughly the same but was closed. The reasoning was that it is hard to explain how to satisfy the extra requirements, e.g. setting environment variables. With the introduction of --ignore-unavailable-components we are slightly better now by printing some minimal information during startup:

if loaded_component is None:
print(
f"Ignoring {component.display_name()}, because it is not available."
)

One solution here would be to just preface every startup with the equivalent of ragna check before the API or UI is started. With that the user should have enough information even when they haven't explicitly created the configuration themselves.

Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant