Skip to content

~95% on SimpleQA (e.g. Qwen3.6-27B on a 3090). Supports all local and cloud LLMs (llama.cpp, Ollama, Google, ...). 10+ search engines - arXiv, PubMed, your private documents. Everything Local & Encrypted.

1.4 KB
Raw Blame
from types import SimpleNamespace

import pytest

from local_deep_research.exporters import quarto_exporter
from local_deep_research.text_optimization import citation_formatter
from tests.performance._shared.pytest_workload import (
    Workload,
    add_options,
    resolve,
)

PROFILES = {
    "ci": dict(size=4, iterations=2, warmups=1),
    "local": dict(size=128, iterations=7, warmups=2),
}


def pytest_addoption(parser):
    add_options(parser, "quarto")


@pytest.fixture(scope="session")
def quarto_workload(request):
    workload = Workload("quarto", resolve(request.config, "quarto", PROFILES))
    yield workload
    workload.finish(
        modules=(
            "local_deep_research.exporters.quarto_exporter",
            "local_deep_research.text_optimization.citation_formatter",
        )
    )


@pytest.fixture
def entry_probe(monkeypatch):
    counts = dict(parses=0, parsed_characters=0)
    original = citation_formatter.QuartoExporter._bibliography_entries

    def counted(exporter, content):
        counts["parses"] += 1
        counts["parsed_characters"] += len(content)
        return original(exporter, content)

    def noop(*args, **kwargs):
        return None

    monkeypatch.setattr(
        citation_formatter.QuartoExporter, "_bibliography_entries", counted
    )
    monkeypatch.setattr(
        quarto_exporter, "logger", SimpleNamespace(info=noop, exception=noop)
    )
    return counts