Models

Text generation

HuggingFaceTB/SmolLM2-360M-Instruct

Model ID
HuggingFaceTB/SmolLM2-360M-Instruct
Type
Text generation

Use this model

Generate text in a web app

Install the browser SDK:

npm install @wfloat/wfloat-web

Load the model and generate text locally in the browser:

import { loadLlmModel } from "@wfloat/wfloat-web";
const llm = await loadLlmModel("HuggingFaceTB/SmolLM2-360M-Instruct", {
onProgress(event) {
console.log(event.status, event.progress ?? "");
},
});
const result = await llm.generate(
"Write one calm sentence about local inference.",
{
maxTokens: 64,
temperature: 0.7,
seed: 0,
},
);
console.log(result.text);

Use the onToken generation option when the interface should display tokens as they are produced.