Who it is forA developer building semantic search or retrieval for a private document set who does not want to send text to a hosted API.
The problemRetrieval pipelines need embedding vectors, and calling a cloud service exposes the documents.
The outcomeA local server that accepts OpenAI-compatible embedding requests, backed by a ModernBERT encoder.
What you need first
- 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
Steps
- Clone the repository and build or install the Tensai command from its root. (inferred, check the README)
- Run
tensai embedon a few sample texts to confirm vectors are produced. - Run
tensai serveto start the OpenAI-compatible endpoint. - Send a POST request to the server's /v1/embeddings path with a sample input and check the returned vector length. (inferred, check the README)
Prompt for your agent
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.
Caveat. The README does not say where the default model is downloaded from or how large it is, so plan for the first-run setup time.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for mattn/tensai and "Serve local text embeddings for search or RAG"
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 freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer