jsgrad is a ML library based on tinygrad, has 0 dependencies and it runs in web, Node, Deno and Bun.
More info and examples: jsgrad.org
With hosted esm script (minimal Llama HTLM example)
<script type="module">
import { Tensor } from 'https://esm.sh/@jsgrad/jsgrad'
console.log(await new Tensor([2, 2, 2]).add(5).tolist())
</script>
Install with:
# with npm
npm install @jsgrad/jsgrad
# with deno
deno install npm:@jsgrad/jsgrad
# with bun
bun install @jsgrad/jsgrad
Use:
import { Tensor } from '@jsgrad/jsgrad'
console.log(await new Tensor([2, 2, 2]).add(5).tolist())