passageway-embedder-openai
A passageway embedder for services that speak the OpenAI embeddings API: Ollama, LM Studio, vLLM, OpenAI itself, and Voyage (whose API differs in one field). It speaks the embedder protocol, so passageway runs it as kind = "command" and the core does not change.
Where your text goes: every indexed passage and every question is sent to the service at BASE_URL. With a local Ollama or LM Studio that is your own machine; with OpenAI or Voyage it is a third party, under their terms. passageway's default stays local; this embedder is your explicit choice.
Configure
[embedder]
kind = "command"
command = ["/path/to/python", "-m", "passageway_embedder_openai"]
# Ollama: nomic-embed-text wants these prefixes; DIMENSIONS lets passageway start before Ollama does
env = { BASE_URL = "http://localhost:11434/v1", MODEL = "nomic-embed-text", DIMENSIONS = "768",
QUERY_PREFIX = "search_query: ", PASSAGE_PREFIX = "search_document: " }
# min_similarity = ... # measure it for this model: passageway eval --sweep
timeout = 60 # the core's limit per request; keep it above TIMEOUT below
# OpenAI
# env = { MODEL = "text-embedding-3-small" }
# secrets = { API_KEY = "env:OPENAI_API_KEY" }
# Voyage
# env = { PROVIDER = "voyage", MODEL = "voyage-3" }
# secrets = { API_KEY = "env:VOYAGE_API_KEY" }
| Setting | Default | Meaning |
|---|---|---|
MODEL |
required | The embedding model the service serves |
BASE_URL |
https://api.openai.com/v1, or Voyage's for PROVIDER = "voyage" |
The service; POST {BASE_URL}/embeddings is called (a trailing /embeddings is dropped). No credentials in the URL |
API_KEY |
Sent as Authorization: Bearer. Required for api.openai.com and api.voyageai.com, usually not for a local server. Put it in secrets, never in env |
|
PROVIDER |
openai |
openai for every OpenAI-compatible service, voyage for Voyage, which wants input_type (query or document) with each request |
QUERY_PREFIX, PASSAGE_PREFIX |
Text put in front of every question or passage; e5-style models served locally want query: and passage: |
|
DIMENSIONS |
The vector length. Set, it answers info without a probe, so passageway can start while the service is still down; it is also sent as dimensions (output_dimension for Voyage) for models that can shorten their vectors. The first answer is checked against it |
|
TIMEOUT |
50 |
Seconds for one request including its retries. Keep the core's timeout for this embedder above it, or the core kills the process before this program can report what went wrong |
NAME |
<provider>:<model>@<host>[:port][#prefixes] |
The embedder's name as the index records it. A prefix changes every vector, so a short hash of the prefixes is part of it; set your own when the model behind a name changes |
min_similarity belongs to the model: similarity scales differ, so measure it with passageway eval --sweep before relying on it.
Behaviour
- The dimension is learned at start by embedding one word (
passageway), unlessDIMENSIONSis set. WithoutDIMENSIONS, a service that is down when passageway starts keeps passageway in its error state until passageway is restarted; with it, passageway starts and the firstrecallsucceeds once the service is up. - Retries: 429 and 5xx answers and connection errors are retried with a growing wait (1 s, doubling up to 60 s; a longer
Retry-Afteris honoured) for as long asTIMEOUTallows:TIMEOUTalone bounds a request, retries included, so raise it to wait out a longer rate limit. A request that timed out while being answered is not repeated, because a paid service may already have charged for it. Any other HTTP error, and giving up, is an error reply to the core for that request; the process stays up. - The key is never printed: it is masked in every error, also when a gateway quotes the header back.
- Tested against a fake of the API in this repository, not against any live service; Voyage is written from its public API documentation. Recent Ollama versions serve the OpenAI-compatible
/v1/embeddings; older ones only/api/embed, which this embedder does not speak. - Batches: the core sends at most
batch_sizetexts per request (32 by default); the services accept far more, so raise it for a cloud model if you like.
Install
uv tool install \
--with 'passageway-embedder-openai @ git+https://github.com/getpassageway/passageway#subdirectory=embedders/openai' \
git+https://github.com/getpassageway/passageway
and use that environment's interpreter in command ($(uv tool dir)/passageway/bin/python), as for a connector.
Test
uv run pytest embedders/openai # offline, against an in-test embeddings API
Metadata
Release files for passageway-embedder-openai 0.3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| passageway_embedder_openai-0.3.0.tar.gz | 11.2 kB | Without provenance | Details for passageway_embedder_openai-0.3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| passageway_embedder_openai-0.3.0-py3-none-any.whl | Python 3 | none | any | Details for passageway_embedder_openai-0.3.0-py3-none-any.whl |
Total release size: 19.0 kB
Release files / passageway_embedder_openai-0.3.0.tar.gz
| Download URL | passageway_embedder_openai-0.3.0.tar.gz |
|---|---|
| Size | 11.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7cd0f04349379f81ff744788f3c1cee95138189044e50f0d25833dab4a0cf83f
|
|
BLAKE2b-256 checksum How to use checksums |
51962d2143e0f9820ad105a38859ff23e47b963941bc3c1f0276f0228bcbc84d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / passageway_embedder_openai-0.3.0-py3-none-any.whl
| Download URL | passageway_embedder_openai-0.3.0-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bb61114e3b0b2e7680b390411af81f49bef811afb7d837b9dc6f55231f50b995
|
|
BLAKE2b-256 checksum How to use checksums |
52ebcecad94d08707ec097646ef5cad2fba2759a14f7d4016cec5c8b1f09d38a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for passageway-embedder-openai 0.3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.