Expand description
One vocabulary and one set of checks for both sides of an embedding exchange.
Structs§
- Embed
- Error
- Failed
- Input
- Limits
- Model
- Ready
- Start
- Vectors
- Window
- EMB-E2: one window of a text: its bytes
[start, end), on char and token boundaries, and their vector. - Windows
- EMB-E2: how a text longer than the model reads is embedded whole.
Enums§
Constants§
- FAILED_
MESSAGE_ CHARS - MEMORY_
LIMIT_ EXIT - MINIMUM_
FRAME_ BYTES - PROTOCOL
- PROTOCOL_
WINDOWS - EMB-E2: the protocol a Start names when it asks for windows. A worker answers Ready with the protocol its Start named.
Functions§
- check_
embed - Check a batch has a bounded item count and distinct valid identifiers.
- check_
model_ limits - Check that token and frame limits fit the model and its largest answer.
- check_
model_ limits_ windowed check_model_limits, and withwindows(EMB-E2) a frame that carries the largest windowed answer and an overlap below the model’s content tokens, so every window moves forward through its text.- check_
ready - Ready names protocol 1 or, for a Start that asked for windows, 2; the service checks it names the protocol its Start did.
- check_
start - Validate the protocol, model path and positive exchange limits.
- check_
vectors - Check answer count, order, vectors and refusal outcomes against the request.
- check_
vectors_ windowed check_vectorsfor a worker started withwindows(EMB-E2): an item of a document Embed may also answer its windows, orwindows_over_cap; a question is never windowed.- decode_
message - Decode a tagged JSON object and validate its exchange envelope.
- decode_
vector - Decode lowercase little-endian hexadecimal into finite float members.
- encode_
vector - Encode finite float members as lowercase little-endian hexadecimal.
- input_
refusal - read_
message - Read and decode one bounded frame; clean EOF returns no message.
- read_
start - Read the first exchange with its fixed bound before allocating the payload.
- vectors_
message_ size - Upper bound for tag plus compact JSON, not the usual message size. Includes maximally escaped ids and the widest whole-number token counts.
- windows_
message_ size - EMB-E2:
vectors_message_sizewhen each item may answer up tomax_windowswindows, each its bounds, its vector and its token count. - write_
message - Validate an envelope and write its tagged JSON in one flushed frame.