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

planning: Jan and Cortex's Extension Framework #3773

Open
louis-jan opened this issue Oct 7, 2024 · 4 comments
Open

planning: Jan and Cortex's Extension Framework #3773

louis-jan opened this issue Oct 7, 2024 · 4 comments
Assignees
Labels
category: cortex.cpp Related to cortex.cpp category: mobile Mobile application issues category: providers Local & remote inference providers category: settings Settings, system monitoring components category: tools RAG, web search, files, function calling type: feature request A new feature type: planning Discussions, specs and decisions stage

Comments

@louis-jan
Copy link
Contributor

louis-jan commented Oct 7, 2024

Problem Statement

Objective

To scale Jan and enable the addition of new features without modifying the core app codebase. This roadmap aims to strengthen Jan's core framework, making it more robust for public use by both the community and core developers. New features will not be limited to bundles; users can opt-in to use them through various methods such as installing from GitHub repositories or extension stores.

Some concerns related to the update:

  • How to handle remote provider extensions? Such as:
    • Users can view the latest supported models from the provider.
    • The extension provider can add additional configurations, such as manually entering a model and URL for OpenAI-compatible extensions.
  • Bring Ichigo into Jan
  • Build web-search feature
  • Better RAG
  • Code playground
  • Jan Console (logs, running playground console)
  • Jan Mobile

All of these are great tests for the extension framework update.

More importantly, it should allow Jan to support more platforms, including mobile.

Feature Idea

What are the parts of the update?

Extensions interact with the core API and events to add features, perform tasks, update app data, and enhance app UI components.

We've laid the groundwork for extensible app logic implementation but still need the UI Extension framework. That would be great if an extension can work with the UI API to extend Jan's related features such as:

  • Registering a form on the settings page to define an OpenAI model and its endpoint.
  • Declaring input shortcuts or types, like audio recording indicators.
  • Declaring input settings, such as toggling web search on or off.
  • Registering a tool tab on the right panel. From there, it can register windows/forms/buttons. So that it can provide a code playground, web/code review panels.
  • Streaming console logs to the app's bottom system bar panel to register a console window tab so users can debug their playground/extensions.
  • Adding extension ribbons for users to select and show detail panels.

Core API Update

There are also core APIs/events updates that could improve functionality, such as current app and conversation states:

  • Getting the current code block so when users select a code block message, it streams to the Code Playground or similar.
  • Getting the selected model or running a downloaded model to perform tasks.
  • Intercepting LLM requests to provide extra information like retrieval/web search.

image

@louis-jan louis-jan added the type: feature request A new feature label Oct 7, 2024
@github-project-automation github-project-automation bot moved this to Investigating in Jan & Cortex Oct 7, 2024
@dan-menlo dan-menlo changed the title epic: Enhance Jan's Extension Framework for Scalability and Feature Expansion architecture: Jan's Extension Framework Oct 13, 2024
@freelerobot
Copy link
Contributor

freelerobot commented Oct 14, 2024

@dan-menlo
Copy link
Contributor

What are the key "Core Modules"?

  • Settings (e.g. Settings)
  • Threads (e.g. Parameters)
  • Hub (e.g. Provider would register models in Hub)
  • Extensions Page
  • Providers Page

@freelerobot freelerobot added category: local engines category: cortex.cpp Related to cortex.cpp category: tools RAG, web search, files, function calling category: providers Local & remote inference providers category: settings Settings, system monitoring components category: mobile Mobile application issues labels Oct 14, 2024
@freelerobot freelerobot pinned this issue Oct 14, 2024
@louis-jan
Copy link
Contributor Author

louis-jan commented Oct 14, 2024

Core modules

There are certain core modules that can be extended through an extensible framework.

1. Providers:
There are local and remote providers that can be incorporated, offering models and settings. It can bundle the engine server or route requests to cloud endpoints.

The provider should register supported parameters for each registered model.

2. Parameters & Tools:
Extensions can register tools, which could include embedding, retrieval, function calling, or code interpretation. There could be an extensible user interface on the right panel.

Scenarios:
Users select the "Tools" tab, then they can choose an embedding model for the retrieval tool, or pick a model for the chat with specified parameters. The kind of settings are now quite hard-coded, making it difficult to adapt to new changes. It would be great if the providers can register these settings.

3. Input
Multi-modal input types should be extensible; there should be a universal design where incorporating new input type support wouldn't disrupt the input layout (e.g., iMessage).

Scenarios:
Extensions register a new input type for a specific model, such as audio input. It can construct a React component that interacts with Native APIs, like Microphone, visualizing waveforms, encoding, returning semantic tokens, and building message inputs.

Extension can be replaced to offer a new outlook (visualization) or a new encoder.

4. Settings
Every extension can register settings, allowing users to configure options such as an API Key.

These settings should be removed once the extension is uninstalled.

5. Hub
Each extension can register models, which will be categorized and displayed in the Model Hub. There was no idea on how it can visualize the hub, for now it's just to provide data. Extensions should not impact the shared UI page of them, such as the Extension Store and Model Hub.

6. Conversation
Extensions should be capable of querying conversation data, visualizing some of its functions such as a code playground.
getCurrentCodeBlock, getCurrentMessage, getCurrentFile...

In short:

  • Threads
    • Threads list & messages (Data API)
    • Parameters, Tools (Data API + UI)
    • Input (multi-modal - UI)
  • Settings
    • Settings Form (Data API + UI)
  • Hub
    • Model list (Data API)
  • Extensions Page (Data API)
  • Providers Page

@freelerobot freelerobot moved this from Investigating to Planning in Jan & Cortex Oct 15, 2024
@dan-menlo dan-menlo changed the title architecture: Jan's Extension Framework discussion: Jan's Extension Framework Oct 17, 2024
@freelerobot freelerobot added type: epic A major feature or initiative and removed category: local providers labels Oct 17, 2024
@freelerobot freelerobot changed the title discussion: Jan's Extension Framework planning: Jan's Extension Framework Oct 17, 2024
@freelerobot freelerobot added type: planning Discussions, specs and decisions stage and removed type: epic A major feature or initiative labels Oct 17, 2024
@dan-menlo dan-menlo changed the title planning: Jan's Extension Framework planning: Jan and Cortex's Extension Framework Oct 29, 2024
@dan-menlo dan-menlo moved this from Planning to Investigating in Jan & Cortex Oct 29, 2024
@dan-menlo dan-menlo reopened this Oct 30, 2024
@github-project-automation github-project-automation bot moved this from Investigating to Review + QA in Jan & Cortex Oct 30, 2024
@github-project-automation github-project-automation bot moved this from Review + QA to In Progress in Jan & Cortex Oct 30, 2024
@dan-menlo dan-menlo moved this from In Progress to Planning in Jan & Cortex Oct 30, 2024
@imtuyethan
Copy link
Contributor

@dan-homebrew

@imtuyethan imtuyethan moved this from Planning to In Progress in Jan & Cortex Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: cortex.cpp Related to cortex.cpp category: mobile Mobile application issues category: providers Local & remote inference providers category: settings Settings, system monitoring components category: tools RAG, web search, files, function calling type: feature request A new feature type: planning Discussions, specs and decisions stage
Projects
Status: In Progress
Development

No branches or pull requests

4 participants