{
 "schema_version": 1,
 "generated": "2026-10-31",
 "id": "google-ai-edge-litert-lm--serve-local-embeddings-with-an-openai-compatible-api",
 "repo": "google-ai-edge/LiteRT-LM",
 "repo_url": "https://github.com/google-ai-edge/LiteRT-LM",
 "repo_slug": "google-ai-edge-litert-lm",
 "title": "Serve local embeddings through an OpenAI-compatible endpoint",
 "page_title": "How to serve local embeddings through an OpenAI-compatible endpoint with LiteRT LM",
 "summary": "Run litert-lm serve with an embedding model to get a local /v1/embeddings endpoint for search and RAG.",
 "who": "A developer building semantic search who wants embeddings without paying a hosted embeddings API.",
 "problem": "Embedding a large document set through a paid API costs money and sends every document to a third party.",
 "outcome": "A local endpoint your existing OpenAI client code can call for text, vision or audio embeddings.",
 "steps": [
  "Install the CLI with `uv tool install litert-lm`",
  "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",
  "Point your OpenAI-compatible client at the local /v1/embeddings endpoint",
  "Use Matryoshka dimension truncation to store shorter vectors when space matters"
 ],
 "agent_prompt": "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.",
 "agents": [
  "claude-code",
  "codex",
  "cursor"
 ],
 "difficulty": "Intermediate",
 "time": "45 minutes",
 "basis": "readme",
 "caveat": "The serve endpoint is described in the release notes; check the DevSite docs for the exact model names and flags in your version.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "c++",
 "requirements": [
  "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"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.8,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/google-ai-edge-litert-lm/serve-local-embeddings-with-an-openai-compatible-api/",
 "md": "https://dedupedai.com/use-cases/google-ai-edge-litert-lm/serve-local-embeddings-with-an-openai-compatible-api/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/google-ai-edge-litert-lm--serve-local-embeddings-with-an-openai-compatible-api.json",
 "api_version": "v1"
}
