docs: verified example — embed via any OpenAI-compatible API - #6
Merged
xerj-team merged 1 commit intoJul 24, 2026
Merged
Conversation
XERJ can embed `semantic_text` through an external OpenAI-compatible
`/v1/embeddings` endpoint (`--embed-mode proxy`), but there was no runnable
proof of it. This adds a key-free, reproducible one.
`docs/examples/external-embeddings/`:
* mock_embed_server.py — a ~40-line dependency-free server implementing the
exact `{input,model} -> {data:[{embedding,index}]}` contract XERJ sends.
* xerj-proxy.toml — the `[embedding] mode=proxy` config wiring XERJ to it.
* run.sh — builds nothing, starts the mock, runs XERJ in proxy mode, indexes
two docs, and shows the external API is called at ingest AND at query time.
* README.md — how it's wired, the wire contract, a table of real endpoints
(OpenAI / Gemini OpenAI-compatible / local), and the ingest=query embedder
symmetry that keeps vectors comparable.
Verified end to end on this branch: XERJ logs `embedding backend: external
proxy`; indexing two docs produces two `/v1/embeddings` calls; a semantic query
for "database outage from too many open connections" is embedded by the same
API (third call) and correctly returns the "connection pool was exhausted"
document by vector similarity.
Honesty note kept in the README: verified against the reproducible mock (which
speaks the exact contract). Real providers using the same OpenAI contract are
drop-in, but endpoints/model names change — the doc points readers to each
provider's current docs rather than freezing a claim.
Docs/example only; no engine code changed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
XERJ can embed
semantic_textthrough an external OpenAI-compatible/v1/embeddingsendpoint (--embed-mode proxy), but there was no runnable proof of it. This adds a key-free, reproducible one.docs/examples/external-embeddings/:{input,model} -> {data:[{embedding,index}]}contract XERJ sends.[embedding] mode=proxyconfig wiring XERJ to it.Verified end to end on this branch: XERJ logs
embedding backend: external proxy; indexing two docs produces two/v1/embeddingscalls; a semantic query for "database outage from too many open connections" is embedded by the same API (third call) and correctly returns the "connection pool was exhausted" document by vector similarity.Honesty note kept in the README: verified against the reproducible mock (which speaks the exact contract). Real providers using the same OpenAI contract are drop-in, but endpoints/model names change — the doc points readers to each provider's current docs rather than freezing a claim.
Docs/example only; no engine code changed.