Skip to content

Publish @aspect/flare npm package from flarellm repo #294

Description

@sauravpanda

Summary

Publish the Flare WASM inference engine as @aspect/flare on npm so BrowserAI can consume it as a dependency.

Tasks

  • Build Flare WASM module: wasm-pack build flare-web --target web --out-dir pkg
  • Verify the package includes: WASM binary, JS glue, TypeScript types
  • Set up npm publish workflow in flarellm repo (already scaffolded in .github/workflows/npm-publish.yml)
  • Publish initial version to npm
  • Verify: npm install @aspect/flare works and import init, { FlareEngine } from '@aspect/flare' resolves

API surface to expose

export function init(): Promise<void>;
export function webgpu_available(): boolean;
export function supports_webnn(): boolean;
export function supports_webtransport(): boolean;

export class FlareEngine {
    static load(data: Uint8Array): FlareEngine;
    init_gpu(): Promise<void>;
    begin_stream(tokens: Uint32Array, max_tokens: number): void;
    begin_stream_with_params(tokens: Uint32Array, max_tokens: number, temp: number, top_p: number, top_k: number, repeat_penalty: number): void;
    next_token(): number;
    stream_done(): boolean;
    encode(text: string): Uint32Array;
    decode_token(token: number): string;
    // ... more methods
}

Blocking

This blocks all other Flare integration work in BrowserAI.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    flare-integrationFlare WASM inference engine integration

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions