Qdrant
A single-node Qdrant container — a vector search engine.
Default image: qdrant/qdrant:latestExposed ports: 6333 (REST, what the helpers here use), 6334 (gRPC) Wait strategy: Wait.forHttp("/readyz").forPort(6333)
| Member | Returns |
|---|---|
QdrantContainer.start(image?) | Promise<QdrantContainer> — boots the container |
.restUrl | The REST API's base URL |
Example
ts
import { QdrantContainer } from "rightsize/modules";
await using qdrant = await QdrantContainer.start();
await fetch(`${qdrant.restUrl}/collections/books`, {
method: "PUT",
headers: { "content-type": "application/json" },
body: JSON.stringify({ vectors: { size: 4, distance: "Dot" } }),
});
await fetch(`${qdrant.restUrl}/collections/books/points?wait=true`, {
method: "PUT",
headers: { "content-type": "application/json" },
body: JSON.stringify({ points: [{ id: 1, vector: [0.3, 0, 0, 0], payload: { title: "The Hobbit" } }] }),
});
const search = await fetch(`${qdrant.restUrl}/collections/books/points/search`, {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ vector: [1, 0, 0, 0], limit: 1 }),
});
console.log(await search.text()); // point id 1, score 0.3Backend notes
- No-arg construction floats to
qdrant/qdrant:latest. Verified againstqdrant/qdrant:v1.18.3(arm64) — note the image's own tags carry a leadingv, unlike most catalog images in this library. - No memory limit is set. A full create-collection/upsert/search round-trip was verified with no
withMemoryLimitoverride, in a guest reporting ~480 MB total. - Readiness is immediate.
/readyzanswered200on the very first poll in the verified boot, so this module leaves the default startup timeout untouched. - Compatibility check: the constructor only accepts images whose repository is
qdrant/qdrant(registry host, tag, and digest stripped). A different repository throwsIncompatibleImageErrorbefore any backend call; override withDockerImageName.parse(image).asCompatibleSubstituteFor("qdrant/qdrant")for a verified compatible fork or mirror.