Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Ollama Ollama OpenAI Embeddings And Listing

From Leeroopedia
Revision as of 17:22, 16 February 2026 by Admin (talk | contribs) (Auto-imported from principles/Ollama_Ollama_OpenAI_Embeddings_And_Listing.md)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Knowledge Sources
Domains API_Design, NLP
Last Updated 2026-02-14 00:00 GMT

Overview

Translation mechanisms for OpenAI-compatible embedding generation and model listing endpoints that convert between Ollama and OpenAI response formats.

Description

This principle covers two auxiliary OpenAI-compatible endpoints:

Embeddings (/v1/embeddings): Translates OpenAI embedding requests to Ollama's embed API and formats the response as an OpenAI EmbeddingList. Supports both float and base64 encoding formats.

Model Listing (/v1/models): Translates Ollama's model list into the OpenAI models list format, mapping model names to OpenAI model objects with IDs and ownership information.

Usage

Use these translation patterns when implementing auxiliary API endpoints that provide embedding and model discovery capabilities in an OpenAI-compatible format.

Theoretical Basis

Embedding Translation:

  1. Receive OpenAI embedding request (model, input text, encoding_format)
  2. Translate to Ollama EmbedRequest
  3. Get embedding vectors from Ollama
  4. Format as OpenAI EmbeddingList with index, embedding, and usage

Model Listing Translation:

  1. Receive request at /v1/models
  2. Get model list from Ollama (/api/tags)
  3. Map each model to OpenAI Model object (id, object, owned_by)

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment