Skip to content

Drop Server Side Indexer, Native Offline Chat, Old Migration Scripts #1212

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

Merged
merged 4 commits into from
Aug 1, 2025

Conversation

debanjum
Copy link
Member

@debanjum debanjum commented Jul 26, 2025

Overview

Make server leaner to increase development speed.
Remove old indexing code and the native offline chat which was hard to maintain.

  • The native offline chat module was written when the local ai model api ecosystem wasn't mature. Now it is. Reuse that.
  • Offline chat requires GPU for usable speeds. Decoupling offline chat from Khoj server is the recommended way to go for practical inference speeds (e.g Ollama on machine, Khoj in docker etc.)

Details

  • Drop old code to index files on server filesystem. Clean cli, init paths.
  • Drop native offline chat support with llama-cpp-python.
    Use established local ai APIs like Llama.cpp Server, Ollama, vLLM etc.
  • Drop old pre 1.0 khoj config migration scripts
  • Update test setup to index test data after old indexing code removed.

@debanjum debanjum added this to the Release Khoj 2.0 milestone Jul 26, 2025
@debanjum debanjum added the improve Upgrade or improve an existing feature or capability label Jul 26, 2025
@debanjum debanjum force-pushed the drop-offline-chat-and-old-indexing-code branch 2 times, most recently from 8ff93e2 to e8cac68 Compare August 1, 2025 01:01
debanjum added 4 commits July 31, 2025 18:25
These were used when khoj was configured using khoj.yml file
It is recommended to chat with open-source models by running an
open-source server like Ollama, Llama.cpp on your GPU powered machine
or use a commercial provider of open-source models like DeepInfra or
OpenRouter.

These chat model serving options provide a mature Openai compatible
API that already works with Khoj.

Directly using offline chat models only worked reasonably with pip
install on a machine with GPU. Docker setup of khoj had trouble with
accessing GPU. And without GPU access offline chat is too slow.

Deprecating support for an offline chat provider directly from within
Khoj will reduce code complexity and increase developement velocity.
Offline models are subsumed to use existing Openai ai model provider.
This stale code was originally used to index files on server file
system directly by server. We currently push files to sync via API.

Server side syncing of remote content like Github and Notion is still
supported. But old, unused code for server side sync of files on
server fs is being cleaned out.

New --log-file cli args allows specifying where khoj server should
store logs on fs. This replaces the --config-file cli arg that was
only being used as a proxy for deciding where to store the log file.

- TODO
  - Tests are broken. They were relying on the server side content
    syncing for test setup
- Delete tests testing deprecated server side indexing flows
- Delete `Local(Plaintext|Org|Markdown|Pdf)Config' methods, files and
  references in tests
- Index test data via new helper method, `get_index_files'
  - It is modelled after the old `get_org_files' variants in main app
  - It passes the test data in required format to `configure_content'
    Allows maintaining the more realistic tests from before while
    using new indexing mechanism (rather than the deprecated server
    side indexing mechanism
@debanjum debanjum force-pushed the drop-offline-chat-and-old-indexing-code branch from e8cac68 to 892d573 Compare August 1, 2025 01:25
@debanjum debanjum merged commit c6670e8 into master Aug 1, 2025
10 checks passed
@debanjum debanjum deleted the drop-offline-chat-and-old-indexing-code branch August 1, 2025 01:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improve Upgrade or improve an existing feature or capability
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant