DEDUPED Hot AI repos, turned into use cases Get the Monday 5

How to use Tensai: what you can do with it

What is Tensai? tensai is a small machine-learning framework written in pure Go that covers training, inference, and several local model runtimes.

How do I use it? Install Go 1.26 or newer; then run git clone https://github.com/mattn/tensai; run cd tensai/_example/xor. Full steps below.

Trended earlier

View repo on GitHub

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer

4 use cases

  • Train a small neural network in pure Go

    Run the bundled XOR example to see forward passes and backprop work with no dependencies.

    View prompt
    Clone the mattn/tensai repository and run the program in _example/xor with go run. Report the trained predictions for the four XOR inputs. Verify that the outputs are close to 0, 1, 1, 0.
  • Generate images locally with Tensai image

    Render a 256x256 picture from a text prompt using Qwen-Image-2.1 in pure Go.

    View prompt
    In the mattn/tensai repository, run tensai image with the prompt "a calico cat asleep on a stack of books". Report the output file path and the elapsed time. Verify that the image file exists and that the run took under four minutes on a laptop-class machine, as the README claims.
  • Export a trained Sequential model to ONNX

    Train a Sequential model in Tensai, then marshal it to ONNX with the encoding/onnx package.

    View prompt
    In the mattn/tensai repository, train a small Sequential model, export it with encoding/onnx, and run the file in onnxruntime. Report the maximum relative error between Predict and onnxruntime outputs. Verify that the error is about 1e-7 or below.

Quick start with Tensai

  1. Check you have what it needs: Go toolchain (Go 1.26 or 1.27 is needed only for the GOEXPERIMENT=simd build); git to clone the repository; Disk space for model checkpoints when using the image, audio, or embedding commands.
  2. Open mattn/tensai on GitHub and read the README and license.
  3. Install Go 1.26 or newer. (inferred, check the README)
  4. Run git clone https://github.com/mattn/tensai (inferred, check the README)
  5. Run cd tensai/_example/xor (inferred, check the README)
  6. Run go run . (inferred, check the README)

These steps come from our top use case, Train a small neural network in pure Go, which also has a copy-paste agent prompt.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for mattn/tensai

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Tensai alternatives · Best AI repos for Software and DevOps

About this repo

  • Who it is forGo developers who want to learn, train, or run neural networks locally without Python or cgo.
  • Why it is hot117 stars, launched 68 days ago
  • LanguageGo
  • Sourcegithub.com/mattn/tensai · Back to Hot repos

Requirements

  • Go toolchain (Go 1.26 or 1.27 is needed only for the GOEXPERIMENT=simd build)
  • git to clone the repository
  • Disk space for model checkpoints when using the image, audio, or embedding commands

Add this badge to your README

Maintain Tensai? Show readers where to find these use cases. Use cases on Deduped

Markdown

[![Use cases on Deduped](https://dedupedai.com/badge/mattn/tensai.svg)](https://dedupedai.com/use-cases/mattn-tensai/?utm_source=github&utm_medium=badge&utm_campaign=mattn-tensai)

HTML

<a href="https://dedupedai.com/use-cases/mattn-tensai/?utm_source=github&amp;utm_medium=badge&amp;utm_campaign=mattn-tensai"><img src="https://dedupedai.com/badge/mattn/tensai.svg" alt="Use cases on Deduped" height="20"></a>

A static image, no tracking script. About the badge

Questions about Tensai

What is Tensai?

tensai is a small machine-learning framework written in pure Go that covers training, inference, and several local model runtimes. It is an open-source project on GitHub: https://github.com/mattn/tensai.

How do I use Tensai?

Install Go 1.26 or newer; then run git clone https://github.com/mattn/tensai; run cd tensai/_example/xor. The use cases on this page give the full steps and a copy-paste agent prompt for each job.

Who is Tensai for?

Go developers who want to learn, train, or run neural networks locally without Python or cgo.

What can I do with Tensai?

4 use cases so far, for example: Train a small neural network in pure Go; Serve local text embeddings for search or RAG; Generate images locally with Tensai image. Each has steps and a copy-paste agent prompt.

What do I need to run Tensai?

Go toolchain (Go 1.26 or 1.27 is needed only for the GOEXPERIMENT=simd build); git to clone the repository; Disk space for model checkpoints when using the image, audio, or embedding commands.

What are alternatives to Tensai?

Other hot AI repos in Software and DevOps: Deep Infer, Harness2, Orca, Opencode, Graphify.

Is Tensai safe to run?

Deduped does not own, audit or vouch for it. Read the README and license, run it on your own systems first and review every command before you run it.