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

📖 Adding demo mode documentation. #667

Merged
merged 2 commits into from
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions docs/demo_mode.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Demo Mode

There may be times when you have to give a demo of KaiKai in a restricted network setting. This could be because you don't have access to LLMs, the network will be too slow to contact them, or you don't want to wait for the LLM while showcasing what Kai can do for you!

If this situation sounds familiar, we will walk through how to set up demo mode, which will allow you to cache the LLM responses and replay them as you go through the workflow to solve issues in a code base.

## Enabling Demo Mode

Demo Mode consists of two parts. The first part is the cache, where we store all the LLM calls. We use a hash of input data to determine when to re-use a particular LLM call. This cache can be stored anywhere on your filesystem for later use.

> [!NOTE]
> This uses the model you have selected to segregate the cached responses. If you change the model configuration, you cannot use the cache generated for a different model.

The second part is the Demo Mode setting you will need to enable. This will tell Kai to look at the cache for a matching LLM call and use what is there.

You will need both configured to use demo mode to use the cache responses from the LLM.

### Configure Cache Directory

To configure the cache directory, you will need to open up the settings panel.

![image](images/open_settings.png)

Once here, search for `kai.cached` and find and click the `Edit in settings.json` link.

![image](images/demo_mode/kai_demo_mode_search.png)

Now, you will need to add the path you would like to use for the cache to the JSON dictionary.

![image](images/demo_mode/cache_dir_json_settings.png)

The key to use is `conveyor.kai.cacheDir`, and the value is an absolute path to a location on your hard drive. In the example, I am putting the cache to `/Users/shurley/repos/kai/cache,` but you can change this to wherever you would like to store it.

### Configure Demo Mode

To configure demo mode, you must open the settings panel again.

![image](images/open_settings.png)

Now, you will search for `kai.demo` and find the setting for demo mode.

![image](images/demo_mode/searched_kai_cache_dir.png)

Select the checkbox if it is not already selected, and you should be all set!

![image](images/demo_mode/select_demo_mode_on.png)

## Seeding Demo Mode

Now that you have configured demo mode, you can use Kai to generate the fixes you want to show in your demo!

> [!WARNING]
> Once you have done this, solve the same incidents and issues in the same file in order. If you fix incidents in the same file in a different order, the hash of the input will be different, and you will not find the call in the cache.
Binary file added docs/images/demo_mode/cache_dir_json_settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/demo_mode/kai_demo_mode_search.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/demo_mode/searched_kai_cache_dir.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/demo_mode/select_demo_mode_on.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading