jan/extensions/model-extension
Hoang Ha 84a09ae03f
Chore/update model hub (#1342)
* fix(mistral-ins): clean redundant parameters

* add(yarn-mistral): update new requested model

* fix(trinity-v1): delete trinity v1 from the hub

* add(tulu-2-70b): llama 70b alternative

* fix(lzlv-70b): delete lzlv-70b and changed to tulu-2

* fix(mistral-ins): upgrade model version to v0.2

* fix(model-extention): pump version to 1.0.18

* add(dolphin 8x7b): update the current  best moe finetuned model

* add(openchat): the best 7b model

* fix(tinyllama): pump version of the model to v1

* fix(stealth): upgrade stealth to v1.3

* Revert "fix(stealth): upgrade stealth to v1.3"

This reverts commit da24df3fb5d69f93d92cc4dd45f991d548aff6aa.

* fix(stealth): upgrade version to v1.3
2024-01-05 13:50:35 +07:00
..
2023-12-01 11:30:29 +07:00
2024-01-05 13:50:35 +07:00
2023-12-01 11:30:29 +07:00
2023-12-01 11:30:29 +07:00

Jan Model Management plugin

Created using Jan app example

Create a Jan Plugin using Typescript

Use this template to bootstrap the creation of a TypeScript Jan plugin. 🚀

Create Your Own Plugin

To create your own plugin, you can use this repository as a template! Just follow the below instructions:

  1. Click the Use this template button at the top of the repository
  2. Select Create a new repository
  3. Select an owner and name for your new repository
  4. Click Create repository
  5. Clone your new repository

Initial Setup

After you've cloned the repository to your local machine or codespace, you'll need to perform some initial setup steps before you can develop your plugin.

Note

You'll need to have a reasonably modern version of Node.js handy. If you are using a version manager like nodenv or nvm, you can run nodenv install in the root of your repository to install the version specified in package.json. Otherwise, 20.x or later should work!

  1. 🛠️ Install the dependencies

    npm install
    
  2. 🏗️ Package the TypeScript for distribution

    npm run bundle
    
  3. Check your artifact

    There will be a tgz file in your plugin directory now

Update the Plugin Metadata

The package.json file defines metadata about your plugin, such as plugin name, main entry, description and version.

When you copy this repository, update package.json with the name, description for your plugin.

Update the Plugin Code

The src/ directory is the heart of your plugin! This contains the source code that will be run when your plugin extension functions are invoked. You can replace the contents of this directory with your own code.

There are a few things to keep in mind when writing your plugin code:

  • Most Jan Plugin Extension functions are processed asynchronously. In index.ts, you will see that the extension function will return a Promise<any>.

    import { core } from "@janhq/core";
    
    function onStart(): Promise<any> {
      return core.invokePluginFunc(MODULE_PATH, "run", 0);
    }
    

    For more information about the Jan Plugin Core module, see the documentation.

So, what are you waiting for? Go ahead and start customizing your plugin!