What do you want to do?
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.
- REPO
mattn/tensai - Software and DevOps
- Intermediate
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.
- REPO
-
Serve local text embeddings for search or RAG
Turn texts into vectors with Tensai embed and answer OpenAI-style /v1/embeddings requests.
- REPO
mattn/tensai - Software and DevOps
- Intermediate
View prompt
Use the mattn/tensai repository to run tensai embed on three sample sentences, then start tensai serve. Report the vector dimension returned by the /v1/embeddings endpoint. Verify that all three vectors have the same length.
- REPO
-
Generate images locally with Tensai image
Render a 256x256 picture from a text prompt using Qwen-Image-2.1 in pure Go.
- REPO
mattn/tensai - Software and DevOps
- Advanced
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.
- REPO
-
Export a trained Sequential model to ONNX
Train a Sequential model in Tensai, then marshal it to ONNX with the encoding/onnx package.
- REPO
mattn/tensai - Software and DevOps
- Advanced
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.
- REPO
Quick start with Tensai
- 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.
- Open mattn/tensai on GitHub and read the README and license.
- Install Go 1.26 or newer. (inferred, check the README)
- Run
git clone https://github.com/mattn/tensai(inferred, check the README) - Run
cd tensai/_example/xor(inferred, check the README) - 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
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeAbout 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.
Markdown
[](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&utm_medium=badge&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.