keemloSDK

Python API

Add an evaluation review to your code.

Call Keemlo's SDK from a script, developer tool or build job. It discovers task context from your repository by default.

A complete first review

from evaluation_sdk import (
    inspect_repository,
    build_evaluation_report,
    write_report,
)

discovery = inspect_repository("/path/to/your/repo")
report = build_evaluation_report(discovery, project_name="My application")
write_report(
    report,
    "evaluation-report.html",
    submission_endpoint="https://keemlo.com/api/report-clicks",
)

Choose a new output path outside the inspected checkout. Writing or opening the report does not submit it. The endpoint enables the two disclosed sharing actions.

Automatic task context

Our SDK reads README files and supported overview, purpose and output-contract documents, project descriptions, Python docstrings and literal prompt instructions. It retains short declarations with source locations and uses observed code names as a fallback. Component-level context is kept separate. Heuristics filter setup material, examples, tests and evaluator prompts from task-context inference, but unrelated material can remain.

Extraction is local and bounded, using English declaration patterns. Dynamic prompts, conflicting documentation and undocumented business goals can remain unresolved. Repository declarations describe intent; they do not verify runtime behaviour.

What the evaluation actually measures

Reports lead with the quality dimensions that a recognised measurement does not establish and what a favourable score could overstate. Examples include response similarity versus explanation faithfulness, input classification versus generated-response behaviour, reference-label agreement versus explanation completeness, and safety versus useful fulfilment. Source-backed implementation failures follow these conceptual findings.

The structured quality_assessments records retain the measured property, unmeasured dimensions, scope, possible overstatement and source anchors. These describe the limits of specific measurements; they do not claim that complementary checks are absent throughout the repository. Detection is bounded to supported Python patterns and declared objectives.

Advanced: override the discovered context

Use an explicit task only when you need to replace the automatically discovered context:

from evaluation_sdk import TaskBrief

report = build_evaluation_report(
    discovery,
    project_name="Customer document assistant",
    tasks=[TaskBrief(
        "Document answers",
        "Answer questions from uploaded documents",
        goal="Support answers with the supplied sources",
        output_requirements=("Claims have source support",),
    )],
)

Core functions

inspect_repository(root, **limits)
Returns a DiscoveryReport containing files, evidence, links, evaluation_flows, quality_assessments, unresolved references and warnings. Function traces retain calls, calculations, exclusions and writes with source locations. Target code is never imported.
TaskBrief(title, description, goal='', output_requirements=())
An optional advanced override for automatically discovered context. No TaskBrief is needed for the default review.
build_evaluation_report(discovery, project_name=None, tasks=())
Builds the report using automatically discovered repository context. Explicitly supplied tasks replace that context.
render_html(report, submission_endpoint=None, report_date=None)
Returns HTML. Without an endpoint, sharing controls are disabled. Pass a Python date to make the rendering date reproducible.
write_report(report, path, **options)
Writes a new HTML file. Existing paths are rejected.

Retain structured evidence

import json
from pathlib import Path

Path("discovery.json").write_text(
    json.dumps(discovery.to_dict(), indent=2),
    encoding="utf-8",
)

Discovery follows explicit calls between top-level Python functions, import aliases and package re-exports. It detects supported scoring and result-storage mechanisms even without evaluation folders or evaluator names. A main-guard path is source reachability, not verified runtime execution. Dynamic dispatch and unsupported patterns remain unresolved. No model inference is used.

Keep evidence with the repository revision and any task context. File names and static checks do not prove runtime execution or task-quality coverage. Use a private location when the evidence describes a private repository.