Skip to content

Native async LLM calls in adetect and adetect_batch #209

Backlog

Description

@adaamko

Problem

adetect and adetect_batch run the sync path in a worker thread of the default executor. For the OpenAI path this uses a thread per call, and cancelling adetect stops the wait but not the call.

What to do

After the LLM-call layer decision, add a native async path for the LLM-backed detectors:

  • The caller passes an async client, as it passes the sync one today.
  • The thread path stays the default, because Bedrock, the fact checker and the encoder have no native async path.
  • The change adds to signatures and results and removes nothing.

Done looks like

With an async client, adetect makes no worker-thread call and cancelling it cancels the provider call. Both behaviour changes are in the changelog of that release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions