pub struct EmbeddingSpaceId {
pub identity_hash: String,
pub model_artifact: String,
pub tokenizer_artifact: String,
pub preprocessing: Value,
pub pooling: Value,
pub normalization: Value,
pub dimension: u32,
}Expand description
Full embedding-space identity. Two providers with the same dimension and different identities produce incomparable vectors, so the identity is more than a width.
The fields below are exactly the ones the embedding_space table records
(DESIGN § Table embedding_space), so a provider’s declaration and the
durable row cannot describe different things.
Fields§
§identity_hash: StringCanonical hash over the artifact/preprocessing identity below. Derived
by EmbeddingSpaceId::new — never assembled by hand, or two
providers describing one space would disagree about its name.
model_artifact: StringExact model artifact: name plus version or content hash.
tokenizer_artifact: StringExact tokenizer artifact, on the same terms.
preprocessing: ValueDeclared preprocessing, pooling and normalization configuration. A different pooling rule over identical weights still yields vectors that must not be compared, so these are part of the identity rather than documentation of it.
pooling: Value§normalization: Value§dimension: u32Implementations§
Source§impl EmbeddingSpaceId
impl EmbeddingSpaceId
Sourcepub fn new(
model_artifact: impl Into<String>,
tokenizer_artifact: impl Into<String>,
preprocessing: Value,
pooling: Value,
normalization: Value,
dimension: u32,
) -> Self
pub fn new( model_artifact: impl Into<String>, tokenizer_artifact: impl Into<String>, preprocessing: Value, pooling: Value, normalization: Value, dimension: u32, ) -> Self
Build an identity and derive its canonical hash.
The hash lives here rather than in each provider because it is the name readiness compares against: the ONNX plugin, a remote plugin and the deterministic fake must all arrive at the same string for the same space, and at different strings for different ones.
A provider’s preprocessing, pooling and normalization blobs are
frozen once it is released. Their shape is written in the provider’s
code, and the hash is over the blob as built (after key order and
integral numbers are normalized), not over what it means: adding a
key, renaming one or changing how a value is spelled gives every
deployment of the new version a different identity, and the gear
blocks vector search over what the old version stored until it is
re-embedded. Values taken from configuration belong in a blob, since a
different setting there is a different space; a change of shape needs
the same deliberation as a change of model.
Trait Implementations§
Source§impl Clone for EmbeddingSpaceId
impl Clone for EmbeddingSpaceId
Source§impl Debug for EmbeddingSpaceId
impl Debug for EmbeddingSpaceId
impl Eq for EmbeddingSpaceId
Source§impl PartialEq for EmbeddingSpaceId
impl PartialEq for EmbeddingSpaceId
impl StructuralPartialEq for EmbeddingSpaceId
Auto Trait Implementations§
impl Freeze for EmbeddingSpaceId
impl RefUnwindSafe for EmbeddingSpaceId
impl Send for EmbeddingSpaceId
impl Sync for EmbeddingSpaceId
impl Unpin for EmbeddingSpaceId
impl UnsafeUnpin for EmbeddingSpaceId
impl UnwindSafe for EmbeddingSpaceId
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.