Skip to content

Wllama-Service#7

Open
itsmanasdash wants to merge 4 commits into
formstr-hq:mainfrom
itsmanasdash:wllama
Open

Wllama-Service#7
itsmanasdash wants to merge 4 commits into
formstr-hq:mainfrom
itsmanasdash:wllama

Conversation

@itsmanasdash

Copy link
Copy Markdown

No description provided.

if (!('caches' in window)) {
return { success: false, error: 'Cache API is not supported in this browser.' };
}
const hasWebGPU = !!(navigator as any).gpu;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we avoid any?

onProgress?.(10);

const configPaths = { default: this.config.wasmPath };
this.wllama = new Wllama(configPaths as any);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same hre?

/** Unload the current model and free memory */
async unload(): Promise<void> {
if (this.wllama) {
try { await (this.wllama as any).exit(); } catch (_) {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any

text,
timeMs: Math.round(performance.now() - t0),
};
} catch (e: any) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any

if (req.system) messages.push({ role: 'system', content: req.system });
messages.push({ role: 'user', content: req.prompt });

const response = await (this.wllama as any).createChatCompletion({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any, why even use typescript :P

onProgress?.(50);

const hasWebGPU = !!(navigator as any).gpu;
await (this.wllama as any).loadModel([file], {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any?


const response = await this.wllama.createChatCompletion({
messages,
max_tokens: req.maxTokens ?? 512,

@geralt-debugs geralt-debugs Jul 4, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use these from a constants/defaults file?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants