
Security News
rv Is a New Rust-Powered Ruby Version Manager Inspired by Python's uv
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
@litertjs/core
Advanced tools
Core web runtime for LiteRT (previously TFLite), Google's open-source high performance runtime for on-device AI.
This package provides the core functionality to load and run arbitrary LiteRT
(.tflite
) models directly in the browser, with support for WebGPU and CPU
acceleration.
This is the primary package for LiteRT.js. For integration with TensorFlow.js,
see
@litertjs/tfjs-interop
.
To test and benchmark your models, check out the
@litertjs/model-tester
.
@litertjs/tfjs-interop
package for details.For a complete guide, see our docs at ai.google.dev/edge/litert/web.
The following code snippet loads LiteRT.js, loads a MobileNetV2 model, and runs it on a sample input tensor.
import {loadLiteRt, loadAndCompile, Tensor} from '@litertjs/core';
// Initialize LiteRT.js's Wasm files.
// These files are located in `node_modules/@litertjs/core/wasm/`
// and need to be served by your web server.
await loadLiteRt('/path/to/wasm/directory/');
const model = await loadAndCompile(
'/path/to/your/model/torchvision_mobilenet_v2.tflite',
{accelerator: 'webgpu'},
);
// Create an input tensor.
const inputTypedArray = new Float32Array(1 * 3 * 224 * 224);
const inputTensor = new Tensor(inputTypedArray, [1, 3, 224, 224]);
// Move the tensor to the GPU for a WebGPU-accelerated model.
const gpuTensor = await inputTensor.moveTo('webgpu');
// Run the model.
const results = model.run(gpuTensor);
// All tensors that are not moved to another backend with `moveTo` must
// eventually be freed with `.delete()`.
gpuTensor.delete();
// Move the result back to the CPU to read the data.
const result = results[0].moveTo('wasm');
console.log(result.toTypedArray());
// Clean up the result tensor.
result.delete();
FAQs
LiteRT.js package
We found that @litertjs/core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.
Security News
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.