Skip to content

Route ir's LLM calls through aix (multi-provider) instead of oa #59

Description

@thorwhalen

Summary

Route all of ir's LLM calls through aix (the multi-provider facade) instead
of oa (OpenAI-specific), so the provider/model is switchable. ir used oa
in exactly one way — oa.prompt_function(prompt, egress=…, name=…, **kwargs) — in
four modules, all behind the lazy-import + injectable pattern.

Done (implemented; live-verified)

  • aix gained the one missing facade piece (egress + name on prompt_func) —
    prompt_func: add egress (output post-processor) + name, for oa.prompt_function parity thorwhalen/aix#29 (shipped, 34 prompt tests green). With that, the swap is a
    near drop-in: oa.prompt_functionaix.prompt_func.
  • Migrated call sites (lazy import oaimport aix):
    • ir/synopsis.py (make_llm_synthesizer; synthesizer_id prefix oa:aix:)
    • ir/select.py (make_llm_selector chooser; egress=_parse_ids)
    • ir/formulate.py (make_llm_formulator rewriter; egress=_parse_lines)
    • ir/eval_gen.py (make_oa_*make_default_* generators; egress=_parse_lines)
  • Tests updated to the aix path (offline guards now poison aix; default-generator
    tests mock aix.prompts.chat). Full suite green (399).
  • Live end-to-end check passed: ir.synopsis → aix.prompt_func → aix.chat →
    OpenAI (gpt-4o-mini) returned a real synopsis. Injectable stubs unchanged, so
    import ir stays offline and tests need no network.

oa is no longer imported anywhere in ir. Default model resolution now follows
aix config (default provider still OpenAI, switchable).

Part of the ecosystem-wide oa→aix direction (audit tracked in a priv issue).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions