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

Pre-loaded configurations #882

Closed
sm18lr88 opened this issue Aug 5, 2024 · 4 comments · Fixed by #919
Closed

Pre-loaded configurations #882

sm18lr88 opened this issue Aug 5, 2024 · 4 comments · Fixed by #919
Labels
upgrade New feature or request

Comments

@sm18lr88
Copy link

sm18lr88 commented Aug 5, 2024

The setup for the locally hosted Docker version is still complicated (it used to be way simpler in the earlier version of Khoj), and the instructions are not very clear on how to load various models, embedding engines, etc.

Consider offering pre-loaded choices for LLMs and Embedding choices from a drop-down menu.

For example, a drop-down menu in the chat models where users can simply select the LLM provider, model, and input their API key.
For embeddings likewise: a list of all the various models users can use, from a simple drop-down menu rather than having to type it in.

I keep trying this app here and there but I only ever managed to get the initial version to ever work.

Thanks.

@sm18lr88 sm18lr88 added the upgrade New feature or request label Aug 5, 2024
@sm18lr88 sm18lr88 changed the title [IDEA] pre-loaded configurations Pre-loaded configurations Aug 5, 2024
debanjum added a commit that referenced this issue Sep 19, 2024
Given the LLM landscape is rapidly changing, providing a good default
set of options should help reduce decision fatigue to get started

Improve initialization flow during first run
- Set Google, Anthropic Chat models too
  Previously only Offline, Openai chat models could be set during init

- Add multiple chat models for each LLM provider
  Interactively set a comma separated list of models for each provider

- Auto add default chat models for each provider in non-interactive
  model if the {OPENAI,GEMINI,ANTHROPIC}_API_KEY env var is set

- Do not ask for max_tokens, tokenizer for offline models during
  initialization. Use better defaults inferred in code instead

- Explicitly set default chat model to use
  If unset, it implicitly defaults to using the first chat model.
  Make it explicit to reduce this confusion

Resolves #882
debanjum added a commit that referenced this issue Sep 20, 2024
Given the LLM landscape is rapidly changing, providing a good default
set of options should help reduce decision fatigue to get started

Improve initialization flow during first run
- Set Google, Anthropic Chat models too
  Previously only Offline, Openai chat models could be set during init

- Add multiple chat models for each LLM provider
  Interactively set a comma separated list of models for each provider

- Auto add default chat models for each provider in non-interactive
  model if the {OPENAI,GEMINI,ANTHROPIC}_API_KEY env var is set

- Do not ask for max_tokens, tokenizer for offline models during
  initialization. Use better defaults inferred in code instead

- Explicitly set default chat model to use
  If unset, it implicitly defaults to using the first chat model.
  Make it explicit to reduce this confusion

Resolves #882
debanjum added a commit that referenced this issue Sep 20, 2024
Given the LLM landscape is rapidly changing, providing a good default
set of options should help reduce decision fatigue to get started

Improve initialization flow during first run
- Set Google, Anthropic Chat models too
  Previously only Offline, Openai chat models could be set during init

- Add multiple chat models for each LLM provider
  Interactively set a comma separated list of models for each provider

- Auto add default chat models for each provider in non-interactive
  model if the {OPENAI,GEMINI,ANTHROPIC}_API_KEY env var is set

- Do not ask for max_tokens, tokenizer for offline models during
  initialization. Use better defaults inferred in code instead

- Explicitly set default chat model to use
  If unset, it implicitly defaults to using the first chat model.
  Make it explicit to reduce this confusion

Resolves #882
debanjum added a commit that referenced this issue Sep 21, 2024
## Improve
- Intelligently initialize a decent default set of chat model options
- Create non-interactive mode. Auto set default server configuration on first run via Docker

## Fix
- Make RapidOCR dependency optional as flaky requirements causing docker build failures
- Set default openai text to image model correctly during initialization

## Details
Improve initialization flow during first run to remove need to configure Khoj:

- Set Google, Anthropic Chat models too
  Previously only Offline, Openai chat models could be set during init

- Add multiple chat models for each LLM provider
  Interactively set a comma separated list of models for each provider

- Auto add default chat models for each provider in non-interactive
  model if the `{OPENAI,GEMINI,ANTHROPIC}_API_KEY' env var is set
  - Used when server run via Docker as user input cannot be processed to configure server during first run

- Do not ask for `max_tokens', `tokenizer' for offline models during
  initialization. Use better defaults inferred in code instead

- Explicitly set default chat model to use
  If unset, it implicitly defaults to using the first chat model.
  Make it explicit to reduce this confusion

Resolves #882
@debanjum
Copy link
Member

Hey @sm18lr88, thanks for opening this issue and pointing out a good area for improvement! I made some changes to address this:

  1. Khoj now sets up a decent set of default chat models on first run.
    Folks using Docker to setup Khoj can set their provider specific API keys in the docker-compose.yml before first run to enable provider specific default chat models. See the updated Self Hosting Docs for details
  2. I've also simplified the Docker setup in Improve Khoj First Run, Docker Setup and Documentation #919, so configuring Khoj via the admin panel isn't necessary to get started with using self hosted Khoj.

We should add a decent set of default embedding models as well for folks to get started (e.g include a decent default multi-lingual embedding model). This can be done as a follow-up.

Do try out the newer Khoj docker setup. Hopefully it goes better this time 🤞🏽

@JOduMonT
Copy link

JOduMonT commented Nov 2, 2024

not sure if it is easier now
but when I try to run the docker-compose.yml
I receive an unauthorized error:

[+] Running 3/3
✘ sandbox Error Head "https://ghcr.io/v2/khoj-ai/terrarium/manifests/latest": unauthorized 0.4s ✘ server Error context canceled 0.4s ✘ database Error context canceled 0.4s Error response from daemon: Head "https://ghcr.io/v2/khoj-ai/terrarium/manifests/latest": unauthorized

@h4rsh-k
Copy link

h4rsh-k commented Nov 2, 2024

not sure if it is easier now but when I try to run the docker-compose.yml I receive an unauthorized error:

[+] Running 3/3
✘ sandbox Error Head "https://ghcr.io/v2/khoj-ai/terrarium/manifests/latest": unauthorized 0.4s ✘ server Error context canceled 0.4s ✘ database Error context canceled 0.4s Error response from daemon: Head "https://ghcr.io/v2/khoj-ai/terrarium/manifests/latest": unauthorized

+1 Getting the same error

@debanjum
Copy link
Member

debanjum commented Nov 2, 2024

Woops, thanks for the notice! Just made the newly released code sandbox docker image at ghcr.io/khoj-ai/terrarium public. So docker-compose up should work now.

Background:
The newly released code tool allows Khoj to do data analysis and create charts for you by running python code in a sandbox using cohere's terrarium+pyodide. This tool is still experimental, so feel free to share any feedback on setup or usage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upgrade New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants