Skip to content

Commit

Permalink
Minor updates for providerType
Browse files Browse the repository at this point in the history
- Updated package versions in api and browser packages to reflect new version numbers.
- Added providerType property to WllamaProvider class in browser package.
- Updated LmProviderType enum in types package to include "browser" option.

Let me know if you need any further assistance.
  • Loading branch information
synw committed Sep 2, 2024
1 parent 84ec70d commit 2e1b3f8
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions packages/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@locallm/api",
"version": "0.1.1",
"version": "0.1.2",
"description": "An api to query local language models using different backends",
"repository": "https://github.com/synw/locallm",
"scripts": {
Expand All @@ -12,12 +12,12 @@
"restmix": "^0.5.0"
},
"devDependencies": {
"@locallm/types": "^0.1.2",
"@locallm/types": "^0.1.3",
"@rollup/plugin-node-resolve": "^15.2.3",
"@rollup/plugin-terser": "^0.4.4",
"@rollup/plugin-typescript": "^11.1.6",
"@types/js-cookie": "^3.0.6",
"@types/node": "^22.5.1",
"@types/node": "^22.5.2",
"rollup": "^4.21.2",
"ts-node": "^10.9.2",
"tslib": "^2.7.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@locallm/browser",
"version": "0.0.1",
"version": "0.0.3",
"description": "Run language models in the browser",
"repository": "https://github.com/synw/locallm",
"scripts": {
"build": "rm -rf dist/* && tsc",
"docs": "typedoc --entryPointStrategy expand"
},
"devDependencies": {
"@locallm/types": "^0.1.2",
"@locallm/types": "^0.1.3",
"@types/node": "^22.5.2",
"ts-node": "^10.9.2",
"tslib": "^2.7.0",
Expand Down
5 changes: 3 additions & 2 deletions packages/browser/src/wllama.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useApi } from 'restmix';
import { InferenceParams, InferenceResult, IngestionStats, LmProvider, LmProviderParams, ModelConf } from "@locallm/types";
import { InferenceParams, InferenceResult, IngestionStats, LmProvider, LmProviderParams, LmProviderType, ModelConf } from "@locallm/types";
import { parseJson as parseJsonUtil, useStats } from '@locallm/api';
import { ChatCompletionOptions, SamplingConfig, Wllama } from '@wllama/wllama';
import { ChatCompletionOptions, SamplingConfig, Wllama } from '@wllama/wllama/esm/wllama';
import { BasicOnLoadProgress, LmBrowserProviderParams, OnLoadProgress } from './interfaces';

const CONFIG_PATHS = {
Expand All @@ -20,6 +20,7 @@ class WllamaProvider implements LmProvider {
onStartEmit?: (data: IngestionStats) => void;
onEndEmit?: (result: InferenceResult) => void;
onError?: (err: string) => void;
providerType: LmProviderType = "browser";
// state
model: ModelConf = { name: "", ctx: 2048 };
models = new Array<ModelConf>();
Expand Down
2 changes: 1 addition & 1 deletion packages/types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@locallm/types",
"version": "0.1.2",
"version": "0.1.3",
"description": "Shared data types for the LocalLm api",
"repository": "https://github.com/synw/locallm",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions packages/types/src/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -231,9 +231,9 @@ interface ModelState {
* Represents the type of LM provider.
*
* @typedef LmProviderType
* @type {"llamacpp" | "koboldcpp" | "ollama"}
* @type {"llamacpp" | "koboldcpp" | "ollama" | "browser"}
*/
type LmProviderType = "llamacpp" | "koboldcpp" | "ollama";
type LmProviderType = "llamacpp" | "koboldcpp" | "ollama" | "browser";

export {
ModelConf,
Expand Down

0 comments on commit 2e1b3f8

Please sign in to comment.