arctic-embed-l-v2.0 의 폴백 백엔드(측정에 쓴 경로 그대로). reqwest::blocking
POST {endpoint}/api/embed {model,input:[...]} → embeddings. batch 48 +
fail-soft 재시도 3, 결과 L2 정규화(Ollama raw 반환 → 일관성), dim 검증.
query/doc prefix 는 모델 태그로 추론(arctic-embed→query:/무접두어, e5→query:/passage:).
model_version=ollama:{model}. endpoint=models.embedding.endpoint ?? models.llm.endpoint.
wiremock 테스트 3종(L2 정규화/dim mismatch/empty no-op) + 단위 5.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
31 lines
1.3 KiB
TOML
31 lines
1.3 KiB
TOML
[package]
|
|
name = "kebab-embed-ollama"
|
|
version = { workspace = true }
|
|
edition = { workspace = true }
|
|
rust-version = { workspace = true }
|
|
license = { workspace = true }
|
|
repository = { workspace = true }
|
|
description = "Ollama HTTP adapter implementing kebab_core::Embedder (POST /api/embed, L2-normalized, batched + fail-soft)"
|
|
|
|
[dependencies]
|
|
kebab-core = { path = "../kebab-core" }
|
|
kebab-config = { path = "../kebab-config" }
|
|
# `default-features = false` drops native-tls (system OpenSSL); we pin rustls.
|
|
# reqwest 0.12's `blocking` feature wraps a private current-thread tokio
|
|
# runtime — this crate exposes NO async surface (no `async`/`await`/`tokio::*`
|
|
# symbols), matching the kebab-llm-local invariant.
|
|
reqwest = { version = "0.12", default-features = false, features = ["blocking", "json", "rustls-tls"] }
|
|
serde = { workspace = true, features = ["derive"] }
|
|
serde_json = { workspace = true }
|
|
tracing = { workspace = true }
|
|
anyhow = { workspace = true }
|
|
|
|
[dev-dependencies]
|
|
# wiremock hosts the mock /api/embed server (needs a tokio runtime); tokio is
|
|
# also pulled transitively at runtime by reqwest's `blocking` feature.
|
|
wiremock = { workspace = true }
|
|
tokio = { workspace = true, features = ["macros", "rt"] }
|
|
|
|
[lints]
|
|
workspace = true
|