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

feat: Threads can override and inherit default params from Assistants, Models, and Engine #754

Closed
3 of 13 tasks
dan-homebrew opened this issue Nov 28, 2023 · 12 comments
Closed
3 of 13 tasks
Assignees
Labels
P1: important Important feature / fix

Comments

@dan-homebrew
Copy link
Contributor

dan-homebrew commented Nov 28, 2023

Tasks

  • Eng Spec @dan-jan
    • Local Models
    • Remote Models (KIV)
  • janhq/internal#66
  • Functionality
    • Each Recommended Model should have default values defined in respective model.json
  • Documentation
    • Architecture section should contain page on relationship between Threads, Assistants, Models, Engines.
    • Docs page on Models Extension,
    • Docs page on Inference Extension
    • Docs page on Engine extensions
  • API Reference (i.e. Swaggerfile)
    • model.json params are well documented in Swaggerfile
    • assistant.json params are well documented in Swaggerfile
    • engine.json params are well documented in Swaggerfile

Spec

image

Overview

  • Threads are a core primitive in Jan, and the main means by which a user will interact with AI
    • A Thread is defined as an exchange between a User and an Assistant
  • A thread uses default params that are specified for that Assistant (and its associated Model(s) and Engine(s))
    • A user may choose to override these default params
    • Assistant params are inherited from assistant.json
    • Model params are inherited from the assistant.model's model.json
    • Engine params are inherited from model.engine's engine.json
  • The Thread UI offers an optional, slide-in "Right Panel" that allows the user to tinker and change params
    • Any user-specified, thread-level params are persisted in an associated thread.json
    • thread.json is usually empty, as it auto-inherits properties from the associated defaults
  • The Thread UI should prompt the user to "Reload" the model + engine if required
    • Model Params and Engine Params will usually require reload
    • We should find way to "automatically" reload it, if user sends new message to Assistant

Wireframes

image image image image

Excalidraw:
https://link.excalidraw.com/l/kFY0dI05mm/3WHim5p2OLu

@dan-homebrew dan-homebrew added the type: epic A major feature or initiative label Nov 28, 2023
@0xSage 0xSage added this to the v0.5.0 milestone Nov 28, 2023
@dan-homebrew dan-homebrew changed the title epic: Models have settable parameters in Right Panel epic: Models and Inference Engine have settable parameters in Right Panel Nov 29, 2023
@hiro-v hiro-v assigned tikikun and unassigned tikikun and hiro-v Nov 29, 2023
@dan-homebrew
Copy link
Contributor Author

dan-homebrew commented Nov 29, 2023

We should ideally capture most if not all of the Model and Inference Engine settings, that Oobabooga, and etc avail.

Image

Image

@dan-homebrew dan-homebrew moved this to Todo in Jan & Cortex Nov 29, 2023
@dan-homebrew
Copy link
Contributor Author

See LiteLLM's approach to prefix, suffix and roles and prompt templates

abetlen/llama-cpp-python#717 (comment)

Image

@dan-homebrew
Copy link
Contributor Author

dan-homebrew commented Nov 29, 2023

One question is also whether there should be a "Hardware Settings", e.g. for Apple Silicon users? Is this also present for other types of Hardware - e.g. Intel, etc.

https://www.reddit.com/r/LocalLLaMA/comments/186phti/m1m2m3_increase_vram_allocation_with_sudo_sysctl/

@tikikun
Copy link
Contributor

tikikun commented Nov 30, 2023

@dan-jan for current release there will be no different in settings for different hardwares, mostly already automatically handled at build time

@tikikun
Copy link
Contributor

tikikun commented Nov 30, 2023

@tikikun
Copy link
Contributor

tikikun commented Nov 30, 2023

Q:Where are these prompt template coming from?
Most of community projects now using TheBloke metadata as referrence, example.

https://huggingface.co/TheBloke/LLaMA2-13B-Psyfighter2-AWQ#prompt-template-alpaca-tiefighter

image

@tikikun
Copy link
Contributor

tikikun commented Nov 30, 2023

We will have 2 main modes: LOCAL and REMOTE

LOCAL
image

REMOTE
image

@tikikun
Copy link
Contributor

tikikun commented Nov 30, 2023

@0xSage
Copy link
Contributor

0xSage commented Nov 30, 2023

Asks:

  1. Can we the settings properties in swagger/json schema (with validation, etc).
  2. A list of prompt templates (so users can have a dropdown selector)

schema fields

id: 
type: 
required: boolean
data_validation: {
  min: 
  max:
}
default:
information: // (i) that tells users what this field actually does

@imtuyethan imtuyethan moved this from Todo to In Progress in Jan & Cortex Dec 1, 2023
@dan-homebrew dan-homebrew changed the title epic: Models and Inference Engine have settable parameters in Right Panel epic: Threads can override and inherit default params from Assistants, Models, and Engine Dec 1, 2023
@dan-homebrew dan-homebrew assigned namchuai and hiro-v and unassigned imtuyethan Dec 1, 2023
@0xSage
Copy link
Contributor

0xSage commented Dec 1, 2023

Discussion updates, mostly as a reminder/reference for @imtuyethan

Based on: https://app.excalidraw.com/s/kFY0dI05mm/3WHim5p2OLu

  1. Assistant Section: Add back the model selector
  • Users should be able to choose a model to chat with when using Jan assistant.
  • Remember: users can only change models at the beginning of a thread, not after thread has started
  • So we need to also show a change-model-disabled-state in designs.
  • Remember: the model determines the variables in the next sections: inference parameters, model params engine params content may change depending on the model chosen.
  1. Users can change Assistant Instructions aka the system message
  • Users can edit assistant instructions after conversation starts.
  • We briefly discussed sending a new “system message updated... etc.” In the MainPanel. Ashley will play around with a potential design for it.
  • The system message may show up in MainPane differently, not as a regular message sent from the user, but as a little box/styled differently?
  • Again, this is a nice to have. It's possible we don't show anything related to it in the MainView at all
  1. We shouldn't auto save when users edit each field. We should make users click a global save button, which saves all sections at once.
  • Reason: reduce fs writes to thread.json
  • See (4)
  1. Users must restart model after editting model_params or engine_parameters
  • If users edit model_parameters & engine_parameters, then they have to save & restart model, a two step process. @imtuyethan will play around with how the designs communicate this.
  • These 2 sections should say “requires model restart” somewhere...
  1. Alan is working on parameter fields, like mins/max/etc.

  2. Model Parameters section UI

  1. Actually play around with having a reset button for each sections, at the section level (not global)

  2. @rex make sure every model has a prompt template filled in

  3. Alan TODO later: low fidelity mock on how “model.json settings is different than thread.model.json settings”

  4. Remote model side panel - we didn't discuss this as much. Punt till later

@0xSage
Copy link
Contributor

0xSage commented Dec 3, 2023

@imtuyethan

A note on the menu items, I saw that we currently open up model.json assistant.json when users click "Reveal in Finder/JSON" in all the sections.

It should be

  • Every section: "Reveal in finder/View as JSON": opens `threads.json
  • "Change Default*** Model/Assistant Settings": opens Model/Assistant settings page

Image

@0xSage 0xSage added the P1: important Important feature / fix label Dec 3, 2023
@0xSage 0xSage modified the milestones: v0.5.0, v0.4.0 Dec 3, 2023
@dan-homebrew dan-homebrew modified the milestones: 0.4.0, 0.4.1, 0.4.2, API Endpoint at localhost:1337, Jan as the default Assistant Dec 11, 2023
@dan-homebrew dan-homebrew removed the type: epic A major feature or initiative label Dec 12, 2023
@dan-homebrew dan-homebrew changed the title epic: Threads can override and inherit default params from Assistants, Models, and Engine feat: Threads can override and inherit default params from Assistants, Models, and Engine Dec 12, 2023
@imtuyethan imtuyethan self-assigned this Dec 13, 2023
@hiro-v hiro-v moved this from In Progress to Todo in Jan & Cortex Dec 18, 2023
@0xSage 0xSage removed this from the Jan as the Default Assistant milestone Dec 27, 2023
@namchuai namchuai moved this from Planned to In Progress in Jan & Cortex Jan 4, 2024
@namchuai
Copy link
Contributor

namchuai commented Jan 5, 2024

@imtuyethan , please help to verify this.
cc @louis-jan

@namchuai namchuai assigned imtuyethan and unassigned namchuai Jan 5, 2024
@imtuyethan imtuyethan moved this from In Progress to Done in Jan & Cortex Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P1: important Important feature / fix
Projects
Archived in project
Development

No branches or pull requests

6 participants