DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to serve local embeddings through an OpenAI-compatible endpoint with LiteRT LM

Run litert-lm serve with an embedding model to get a local /v1/embeddings endpoint for search and RAG.

Short answer: Install the CLI with uv tool install litert-lm; then import a model quickly with litert-lm import if you have one locally; start litert-lm serve with a multimodal embedding model such as EmbeddingGemma 2. All steps.

Who it is forA developer building semantic search who wants embeddings without paying a hosted embeddings API.

The problemEmbedding a large document set through a paid API costs money and sends every document to a third party.

The outcomeA local endpoint your existing OpenAI client code can call for text, vision or audio embeddings.

What you need first

  • uv to install the CLI with uv tool install
  • Linux, macOS, Windows or Raspberry Pi for the CLI; Android, iOS or the web through the language APIs
  • A LiteRT-LM model, for example from the litert-community Hugging Face repos

Steps

  1. Install the CLI with uv tool install litert-lm
  2. Import a model quickly with litert-lm import if you have one locally
  3. Start litert-lm serve with a multimodal embedding model such as EmbeddingGemma 2
  4. Point your OpenAI-compatible client at the local /v1/embeddings endpoint
  5. Use Matryoshka dimension truncation to store shorter vectors when space matters

Prompt for your agent

Set up google-ai-edge/LiteRT-LM to serve EmbeddingGemma 2 locally with litert-lm serve, then change my <search code> to call the local /v1/embeddings endpoint instead of the hosted API. Embed <sample docs> and show a test query.

Caveat. The serve endpoint is described in the release notes; check the DevSite docs for the exact model names and flags in your version.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for google-ai-edge/LiteRT-LM and "Serve local embeddings through an OpenAI-compatible endpoint"

Add Deduped to Claude Code once

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

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

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