The model is now added to WebAI.js. Try it in your browser with no code required.

#4
by AxolsWebAI - opened

Hi there,

We've packaged this model inside our open-source library WebAI.js, so you can now integrate it into your project with just a few lines of code:

import { WebAI } from '@axols/webai-js';

const webai = await WebAI.create({
   modelId: "smollm3-3b-instruct"
});

await webai.init({
  mode: "webai",
  precision: "q4f16",
  device: "webgpu"
});

const generation = await webai.generate({
  userInput: {
    messages: [
      {
        role: "system",
        content: "You are SmolLM, a language model created by Hugging Face./think"
      },
      {
        role: "user",
        content: "Solve the equation x^2 - 3x + 2 = 0"
      }
    ]
  },
  modelConfig: {
    max_new_tokens: 1024,
    temperature: 0.7
  },
  generateConfig: {
    skip_special_tokens: true
  }
});

// Or Stream generate easily
const generation = await webai.generateStream({
  userInput: {
    messages: [
      {
        role: "system",
        content: "You are SmolLM, a language model created by Hugging Face./think"
      },
      {
        role: "user",
        content: "Generate me a new blog post about the benefits of AI in healthcare."
      }
    ]
  },
  onStream: (chunk) => {
    console.log(chunk);
  }
});

🔬 Try SmolLM3 3B Instruct Instantly (No Code Required)

You can benchmark and test the model directly here:
https://www.webai-js.com/models/llama-3.2-1b-instruct/playground

image


📘 Full API Reference

Detailed parameter explanations can be found here:
https://www.webai-js.com/models/smollm3-3b-instruct/api-reference/v1/get-started/basic-usage

image


🧡 Fully Open Source

WebAI.js is completely open source and free to use.
Star or contribute on GitHub:
https://github.com/axolsai/webai-js

Thanks

Sign up or log in to comment