pieces-app / pieces-copilot-vanilla-typescript-example

A simple (vanilla) repository of examples for using the PiecesApi in Typescript to build a Local Copilot..
MIT License
16 stars 4 forks source link

Regenerated, added final touches and bug fixes for mistral - New simplified without abstractions #11

Closed jwafu closed 6 months ago

jwafu commented 6 months ago

Updated mistral additions with examples (removing abstraction) as it caused some unnecessary complexities. also a big note on the constructor for our ModelsDownloadsController:

 private constructor() {
    this.models = new Pieces.ModelsApi().modelsSnapshot();

    this.models.then((models) => {
      this.initSockets(
        models.iterable.filter(
          (el) =>
            // this filter is important and defines what possible websockets will be initialized and included in the filtered list.
            (el.foundation === Pieces.ModelFoundationEnum.Llama27B || el.foundation === Pieces.ModelFoundationEnum.Mistral7B ) &&
            el.unique !== 'llama-2-7b-chat.ggmlv3.q4_K_M'
        )
      );
    });
  }

This filter can completely block the visibility of a model as the Web Socket will never initialize.