Skip to content

feat(core): configure custom OpenAI embedding endpoints - #1365

Closed
mikemikimike wants to merge 2 commits into
basicmachines-co:mainfrom
mikemikimike:feat/openai-embedding-api-config-1336
Closed

feat(core): configure custom OpenAI embedding endpoints#1365
mikemikimike wants to merge 2 commits into
basicmachines-co:mainfrom
mikemikimike:feat/openai-embedding-api-config-1336

Conversation

@mikemikimike

Copy link
Copy Markdown
Contributor

Summary

Allow the OpenAI embedding provider to use the configured semantic_embedding_api_base and semantic_embedding_api_key.

The provider factory now forwards both values and includes safe digests in the process cache key, preventing stale provider reuse when an endpoint or credential changes. LiteLLM cache behavior remains covered while sharing the same configuration identity rule.

Testing

  • uv run --frozen pytest -q -p pytest_mock tests/repository/test_openai_provider.py -k 'forwards_openai_api_configuration or separates_openai_api_cache_keys' --no-cov (2 passed)
  • uv run --frozen ruff check src/basic_memory/repository/embedding_provider_factory.py tests/repository/test_openai_provider.py
  • git diff --check

Fixes #1336

@phernandez

Copy link
Copy Markdown
Member

Thank you — this is exactly the fix #1336 needed: forwarding api_key/base_url to the OpenAI provider and digesting both in the cache key for openai and litellm alike. Verified locally on top of your commit: static checks clean, your two new tests plus the full provider file (32) and the whole tests/repository suite (774) pass, and there's no keyword collision with extra_kwargs.

Fork PRs don't get our full test matrix (only DCO/CLA/CodeQL run), so I've cherry-picked your commit unchanged — authorship and sign-off preserved — onto an in-repo branch as #$PR to run the matrix; it'll be rebase-merged so your commit lands on main as-is. Closing this one in favour of #$PR; nothing further needed from you. Nicely scoped change.

@phernandez phernandez closed this Aug 29, 2026
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.

[FEATURE] Let the openai embedding provider use semantic_embedding_api_base / api_key

2 participants