Skip to content

feat(embeddings): support OpenAI-compatible embeddings providers - #193

Closed
yordis wants to merge 2 commits into
petabridge:devfrom
TrogonAi:yordis/openapi-embeddings-api
Closed

feat(embeddings): support OpenAI-compatible embeddings providers#193
yordis wants to merge 2 commits into
petabridge:devfrom
TrogonAi:yordis/openapi-embeddings-api

Conversation

@yordis

@yordis yordis commented Jun 24, 2026

Copy link
Copy Markdown
Contributor
  • Operators want to point Memorizer at hosted OpenAI or any OpenAI-compatible gateway (LiteLLM, vLLM, Azure OpenAI, LocalAI) without standing up Ollama, so embedding generation matches the rest of the LLM ecosystem they already operate.
  • The bifurcated provider model already exists for the Memorizer Agent side; aligning the embeddings side keeps configuration shape consistent and unblocks credential-bearing providers via an optional ApiKey.
  • Drop-in for existing Ollama deployments: Provider defaults to ollama, no schema migration, no required new settings, no change to the Ollama wire format.

Operators want to point Memorizer at hosted OpenAI or any OpenAI-compatible gateway (LiteLLM, vLLM, Azure OpenAI, LocalAI) without standing up Ollama.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis

yordis commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author
Screenshot 2026-06-24 at 3 04 48 PM

@yordis

yordis commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author
Screenshot 2026-06-24 at 3 13 17 PM

@yordis

yordis commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author
docker exec memorizer-postgres-dev psql -U postgres -d postgmem -c \
  "SELECT id, title,
          vector_dims(embedding) AS dims,
          substring(embedding::text from 1 for 120) || '...' AS preview
     FROM memories
    WHERE id = '3ede201f-4a1f-4c6a-bc29-de3ae1b752ef';"

Result
                  id                  |         title         | dims |                                                           preview
--------------------------------------+-----------------------+------+-----------------------------------------------------------------------------------------------------------------------------
 3ede201f-4a1f-4c6a-bc29-de3ae1b752ef | OpenAI MCP smoke test | 1536 | [0.0435791,-0.02798462,0.05859375,-0.024337769,-0.05697632,-0.025756836,0.0446167,0.01134491,0.0065956116,-0.01576233,0....
(1 row)

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@Aaronontheweb

Copy link
Copy Markdown
Member

Opened replacement PR #194 on top of this work: https://github.com/petabridge/memorizer/pull/194\n\nAdditional changes included there:\n- Preserve the OpenAI-compatible embedding provider implementation from this PR.\n- Apply active embedding provider settings before dimension validation on save/activation so migration checks use the selected provider shape.\n- Keep embedding API keys sourced from runtime configuration only; provider_settings JSON no longer stores API keys.\n- Redact provider config responses and recursively strip sensitive keys before provider config is stored.\n- Add a migration to remove any previously persisted provider API keys from provider_settings.config.\n- Scope bearer auth to individual OpenAI-compatible embedding requests so keys are not sent to Ollama endpoints.\n- Make fallback embedding dimensions schema-safe during dimension migrations.\n- Add focused tests for request auth behavior and provider config sanitization.\n\n#194 includes Closes #193 so this PR should close automatically when the replacement merges.

Aaronontheweb added a commit that referenced this pull request Jun 26, 2026
Builds on #193 and preserves the contributor's OpenAI-compatible embeddings support while hardening provider migration and credential handling.\n\nCloses #193.
@Aaronontheweb

Copy link
Copy Markdown
Member

Closing in favor of the merged replacement PR #194, which preserves this contribution and adds the provider migration / credential handling hardening needed before landing.\n\nMerged replacement: #194

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants