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

epic: Better files & links #1494

Closed
7 tasks done
freelerobot opened this issue Jan 10, 2024 · 9 comments
Closed
7 tasks done

epic: Better files & links #1494

freelerobot opened this issue Jan 10, 2024 · 9 comments
Assignees
Labels
P1: important Important feature / fix type: epic A major feature or initiative
Milestone

Comments

@freelerobot
Copy link
Contributor

freelerobot commented Jan 10, 2024

Motivation

Community request

Specs

Users can change default Jan app data location

  • Give users control over how their own fs is used
  • Good UX around error handling, interrupted migrations

Users can restore to a clean build

  • If users mess up the /jan folder structure, it should be recoverable

Users can thoroughly delete Jan & purge data

  • No dangling files.
  • No running various sh scripts to clean up data.

Open Questions

  1. Where, what, and why are we currently storing data?

MacOS

~/jan : janroot
~/Library/Application Support/jan : Cookie, session for electron app (chromium)
~/Library/Caches/jan-updater, ~/Library/Caches/jan.ai.app, ~/Library/Caches/jan.ai.app.ShipIt : Cache

Window

C:\User\%USERPROFILE%\jan : janroot
C:\Users\%USERPROFILE%\AppData\Local\Programs\jan : app installed folder, will be remove if we uninstall app
C:\Users\%USERPROFILE%\AppData\Roaming\jan : cache folder for jan app
C:\Users\%USERPROFILE%\AppData\Local\electron : cache folder generated by electron - chromium related

Linux:

~/jan: janroot
~/.config/jan: Cache
~/.npm/_cacache: Folder cache generated on linux when call a function getTempCache in typescript

  1. Where should this data go?
  • User data & Jan specific assets, e.g. the model/assistant/thread.jsons
  • User data & shared assets, e.g. model binaries, RAG files (which could be shared across other apps)
  • Application assets, e.g. cache, logs, and other app data

3. What should the reset & deletion behavior be for these files?

  • How does it vary across Systems? Mac, Windows, Linux.

Tasklist

Design

Implementation

Not in Scope

  • Letting users change Jan specific subfolder paths for /models, /assistants, rag attachments, that contain the jsons
  • Exclude files, block Jan from accessing certain paths
  • A full Obsidian vault inspired UX: https://help.obsidian.md/Files+and+folders/Manage+vaults
  • Everything else. Let's scope this tightly pls.

Appendix

I'm inspired by Obsidian's philosophy of letting users manage how their filesystem is used.
Sidenote (nonurgent): We should strive to evolve our SDK/fs wrapper towards this level of user ownership and flexibility.

image
@freelerobot freelerobot added the type: epic A major feature or initiative label Jan 10, 2024
@freelerobot freelerobot self-assigned this Jan 10, 2024
@freelerobot freelerobot added the P1: important Important feature / fix label Jan 10, 2024
@freelerobot freelerobot added this to the v0.4.6 milestone Jan 10, 2024
@freelerobot freelerobot removed their assignment Jan 13, 2024
@imtuyethan
Copy link
Contributor

@hiento09 to list down the app structure

@hiento09
Copy link
Collaborator

I have scanned my windows, below are folders which are generated by jan app on windows:
C:\User\%USERPROFILE%\jan : janroot
C:\Users\%USERPROFILE%\AppData\Local\Programs\jan : app installed folder, will be remove if we uninstall app
C:\Users\%USERPROFILE%\AppData\Roaming\jan : cache folder for jan app
C:\Users\%USERPROFILE%\AppData\Local\electron : cache folder generated by electron - chromium related

@hiento09
Copy link
Collaborator

Macos:
~/jan : janroot
~/Library/Application Support/jan : Cookie, session for electron app (chromium)
~/Library/Caches/jan-updater, ~/Library/Caches/jan.ai.app, ~/Library/Caches/jan.ai.app.ShipIt : Cache

@hiento09
Copy link
Collaborator

Linux:
~/jan: janroot
~/.config/jan: Cache
~/.npm/_cacache: Folder cache generated on linux when call a function getTempCache in typescript

@oleole39
Copy link

oleole39 commented Jan 16, 2024

Linux: ~/jan: janroot ~/.config/jan: Cache ~/.npm/_cacache: Folder cache generated on linux when call a function getTempCache in typescript

Note for Linux: (at least in Debian-based distributions), rather than ~/jan apps would usually store their default profile folder (i.e. "janroot") either in ~/.config/jan (in that case it might give ~/.config/jan or ~/.config/jan/profile for profile folder and ~/.config/jan/cache for cache) or for a few of them in a hidden folder at root ~/.jan (note the dot before the folder name that makes it hidden by default on Linux systems). Non-hidden folders in the home folder would mostly be User data folders (Documents, Pictures, Videos, etc.). Finding ~/jan here is thus not conventional, however one could imagine the models folder to be like user data (I guess it would only make sense if those models can be shared among various applications), i.e. split from jan folder as such: ~/IA Models, ~/.jan (or ~/.config/jan), ~/.config/jan/cache and ~/.npm/_cacache.

@imtuyethan
Copy link
Contributor

Pass comments from Nicole.


Consider the scenarios:

A) 1542: Scanning an entire folder for multiple files
User scans /random_path/models, which contains LlamaCorn.gguf (and other models)
LlamaCorn (and other models) show up in the app, yay
Cmiiw: at this point, the corresponding model.json is autogenerated and placed in Jan App Directory
Users can edit this App Dir > model.json to change default Jan configs for LlamaCorn

B) 1382: Configuring 1 specific file (which is actually a subscenario of A)
Rather than scanning an entire folder, user wants to explicitly add only 1 model in /random_path/model to Jan
In this case, user creates a model.json in Jan App Directory, and sets the correct source_url / reference / symlink
LlamaCorn shows up in the app, yay

Note: the modelfile in A.3 is the same as B2.

So the 2 issues likely share implementation detail, but are very different use cases and user flows. We should allow this level of flexibility & freedom when it comes to folder mgmt

@REALERvolker1
Copy link

Jan should never create ~/jan, nor should it ever create ~/.jan, as this defeats the purpose of this discussion. (satisfying user preferences and platform conventions)

Jan could test if the environment variable $JAN_HOME $XDG_DATA_HOME is set, if not, fall back to ~/.local/share. Then, check for janroot, and if it does not exist, create it. It could do the same with other platforms' environment variables. This could go in startup code that could run before anything else. If setting a custom location in the gui is preferred, jan could place a file or symlink in its config directory that points to where to look first. If that target folder does not exist, fall back to the environment variable methods.

@JamesMowery
Copy link

+1 on not using ~/jan or ~/.jan on Linux. Very, very, very bad practice.

@louis-menlo louis-menlo moved this to In Progress in Menlo Jan 24, 2024
@Van-QA Van-QA modified the milestones: v0.4.6, v0.4.7 Jan 29, 2024
@imtuyethan
Copy link
Contributor

Everything is on main now & ready to be released tomorrow yayayay, good work everyone!!

@github-project-automation github-project-automation bot moved this from In Progress to Done in Menlo Jan 31, 2024
@Van-QA Van-QA modified the milestones: v0.4.7, v0.4.6 Jan 31, 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 type: epic A major feature or initiative
Projects
Archived in project
Development

No branches or pull requests

8 participants