Evaluation
Lists a collection's golden-set entries.#
/lmkit/v1/search/golden-setParameters
| Name | In | Type | Description |
|---|---|---|---|
tenant_id | query | string (uuid) | |
collection_id | query | string (uuid) | |
cluster_id | query | string |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 404 | Not Found | |
| 503 | application/json | Service Unavailable |
curl -X GET "$LMKIT_ONE_URL/lmkit/v1/search/golden-set" \
-H "Authorization: Bearer $LMKIT_API_KEY"Adds golden-set entries to a collection.#
/lmkit/v1/search/golden-setA golden set is a collection's retrieval-quality reference data: (question, expected documents) pairs, optionally with a reference answer for future answer-quality metrics. The evaluation endpoint scores retrieval configurations against it with recall@k, MRR, and nDCG@k.
Request body
application/json ·
| Property | Type | Description |
|---|---|---|
cluster_id | string | The search cluster that holds the tenant and collection. If not provided, the default cluster is used. |
tenant_idrequired | string (uuid) | The tenant that owns the collection. |
collection_idrequired | string (uuid) | The collection the golden entries belong to. |
entriesrequired | [] | The golden entries to add. |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
| 400 | Bad Request | |
| 404 | Not Found | |
| 503 | application/json | Service Unavailable |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/search/golden-set" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"cluster_id": "string",
"tenant_id": "string",
"collection_id": "string",
"entries": [
{
"question": "string",
"expected_document_ids": [
"string"
],
"reference_answer": "string"
}
]
}'Generates a golden set from a collection's own content.#
/lmkit/v1/search/golden-set/generateBootstraps evaluation data for a corpus that has none: pages are sampled from the collection (at most one per document, ordered by a seeded hash so a run is reproducible from its reported seed), a local chat model writes one self-contained question and reference answer per page, and what passes the quality gate is stored as golden entries whose expected document is the page's document. The gate rejects questions that only make sense beside their passage ('what does this document say about...') and near-duplicates, and the per-reason discard counts are returned: a low acceptance rate is a fact about the corpus or the model, not a silent failure. It deliberately does NOT check whether retrieval currently finds the source document, since keeping only the questions the engine already answers would make every later measurement self-fulfilling. Questions already in the set take part in duplicate detection, so repeated calls grow a set. Generation runs one page at a time and can download the model, so a slow call returns a job.
Request body
application/json ·
| Property | Type | Description |
|---|---|---|
cluster_id | string | The search cluster that holds the tenant and collection. If not provided, the default cluster is used. |
tenant_idrequired | string (uuid) | The tenant that owns the collection. |
collection_idrequired | string (uuid) | The collection to generate questions from, and to store them into. |
count | object (int32) | How many questions to attempt (1..200, default 20). One page is sampled per attempt, at most one page per document. |
model | string | The chat model that writes the questions. Defaults to the server's default chat model. |
seed | string | Sampling seed. The same seed over an unchanged corpus samples the same pages, so a run can be repeated. Generated and reported back when omitted. |
temperature | object (double) | Generation temperature (0..2, default 0.7). At 0 the questions are reproducible for a given seed and corpus. |
max_page_characters | object (int32) | How much of a sampled page the model is shown (500..20000, default 4000). |
min_page_characters | object (int32) | Shortest page worth sampling (0..5000, default 200): a near-empty page yields no answerable question. |
max_completion_tokens | object (int32) | Token ceiling for one question and answer pair (32..2048, default 256). |
difficulty | How hard the questions are for retrieval. 'Paraphrased' (default) requires the question to ask in different words from the passage, the way a real user does, which is what leaves headroom in the resulting metric. 'Standard' allows the passage's own wording: cheap, and useful as a smoke test that indexing works, but it saturates near a perfect score and cannot tell retrieval configurations apart. |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 202 | application/json | Accepted |
| 400 | Bad Request | |
| 404 | Not Found | |
| 503 | application/json | Service Unavailable |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/search/golden-set/generate" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"cluster_id": "string",
"tenant_id": "string",
"collection_id": "string",
"count": "string",
"model": "string",
"seed": "string"
}'Deletes one golden-set entry.#
/lmkit/v1/search/golden-set/{entryId}Parameters
| Name | In | Type | Description |
|---|---|---|---|
entryIdrequired | path | integer (int64) | |
tenant_id | query | string (uuid) | |
collection_id | query | string (uuid) | |
cluster_id | query | string |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | application/json | OK |
| 404 | Not Found | |
| 503 | application/json | Service Unavailable |
curl -X DELETE "$LMKIT_ONE_URL/lmkit/v1/search/golden-set/$ENTRYID" \
-H "Authorization: Bearer $LMKIT_API_KEY"Evaluates the grounded-answer pipeline against a golden set.#
/lmkit/v1/search/evaluate/answersRuns every golden question through the real answer path once per configuration and has a local judge model score the result: faithfulness (the fraction of the answer's atomic statements the retrieved context supports, so the hallucination measure), context recall (the fraction of the reference answer found in that context, which separates a retrieval bottleneck from a generation one), answer relevancy, and citation precision (whether the sources the answer cited actually support it). Supply 'unanswerable_questions' to measure refusal in both directions: refusal recall alone is gamed by a pipeline that declines everything, which is why the false-refusal rate is reported beside it. A metric whose judgement could not be read excludes that question rather than scoring it zero, and says so in 'warnings'. Runs persist beside retrieval runs, so this is the headless CI hook for answer quality. Cost: several judging passes per question per configuration, bounded by 'max_questions', so a call can take minutes and returns a job when it does.
Request body
application/json ·
| Property | Type | Description |
|---|---|---|
cluster_id | string | The search cluster that holds the tenant and collections. If not provided, the default cluster is used. |
tenant_idrequired | string (uuid) | The tenant that owns the collections. |
collection_id | string (uuid) | A single collection to evaluate against. Ignored when 'collection_ids' is provided. |
collection_ids | string (uuid)[] | The collections whose golden sets are evaluated together. Takes precedence over 'collection_id'. |
judge_model | string | The model that judges the answers. Defaults to the server's default chat model. One judge across configurations is what keeps them comparable. |
max_questions | object (int32) | Caps how many golden questions each configuration is evaluated on (1..500, default 50). Answer evaluation runs several judging passes per question, so this is the main cost control. |
unanswerable_questions | string[] | Questions whose answer is NOT in the corpus. Each one is expected to be declined: they measure refusal recall, and together with the golden questions they measure the false-refusal rate. |
configsrequired | [] | The answer configurations to evaluate (at most 10 per call). Configurations evaluated together share a batch id. |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 202 | application/json | Accepted |
| 400 | Bad Request | |
| 404 | Not Found | |
| 503 | application/json | Service Unavailable |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/search/evaluate/answers" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"cluster_id": "string",
"tenant_id": "string",
"collection_id": "string",
"collection_ids": [
"string"
],
"judge_model": "string",
"configs": [
{
"label": "string",
"model": "string",
"search_type": "Hybrid",
"groundedness": "Off"
}
]
}'Evaluates retrieval configurations against a golden set.#
/lmkit/v1/search/evaluateRuns every golden question of the selected collections through the real search read path once per configuration, scores the ranked documents against each entry's expected documents, and returns mean recall@k, MRR, and mean nDCG@k per configuration. Each configuration is persisted as one run (grouped by a shared batch id), so quality can be compared across configurations and over time via the runs endpoint. Several configurations in one call is the A/B shape: for example 'fulltext baseline' versus 'hybrid + rerank'. This endpoint is the headless hook for eval-driven development: call it from CI with plain HTTP and assert on the returned metrics. Retrieval work per call is bounded: questions times configurations searches, each at depth max(ks).
Request body
application/json ·
| Property | Type | Description |
|---|---|---|
cluster_id | string | The search cluster that holds the tenant and collections. If not provided, the default cluster is used. |
tenant_idrequired | string (uuid) | The tenant that owns the collections. |
collection_id | string (uuid) | A single collection to evaluate against. Ignored when 'collection_ids' is provided. |
collection_ids | string (uuid)[] | The collections whose golden sets are evaluated together. Takes precedence over 'collection_id'. |
ks | object (int32)[] | The cutoffs to measure recall@k and nDCG@k at. Defaults to [1, 5, 10]; retrieval depth is the largest k. |
configsrequired | [] | The retrieval configurations to evaluate (at most 10 per call). Configurations evaluated together share a batch id, which is how an A/B comparison is grouped. |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 400 | Bad Request | |
| 404 | Not Found | |
| 503 | application/json | Service Unavailable |
curl -X POST "$LMKIT_ONE_URL/lmkit/v1/search/evaluate" \
-H "Authorization: Bearer $LMKIT_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"cluster_id": "string",
"tenant_id": "string",
"collection_id": "string",
"collection_ids": [
"string"
],
"ks": [
"string"
],
"configs": [
{
"label": "string",
"search_type": "FullText",
"fusion": "Rrf",
"rerank": false
}
]
}'Lists the tenant's persisted evaluation runs, newest first.#
/lmkit/v1/search/evaluate/runsParameters
| Name | In | Type | Description |
|---|---|---|---|
tenant_id | query | string (uuid) | |
cluster_id | query | string | |
limit | query | object (int32) |
Responses
| Status | Type | Description |
|---|---|---|
| 200 | OK | |
| 404 | Not Found | |
| 503 | application/json | Service Unavailable |
curl -X GET "$LMKIT_ONE_URL/lmkit/v1/search/evaluate/runs" \
-H "Authorization: Bearer $LMKIT_API_KEY"