Skip to main content

A multi-provider LLM orchestrator using a analyse-delegate-judge strategy.

Project description

adj-ai

adj-ai is a multi-provider LLM orchestrator. It generates several candidate responses to a task from one or more model providers (Anthropic, OpenAI, DeepSeek), then uses a "judge" model to adjudicate the candidates and return the best one.

The core idea is analyse-delegate-judge: by producing multiple candidates and scoring them against a judging rubric, you get higher-quality outputs than a single one-shot completion.

Status: Early development. The Anthropic, OpenAI, and DeepSeek generation/judging paths are all implemented.

How it works

  1. Model selection – A lightweight model (e.g. Anthropic Haiku) inspects the task prompt and picks the most appropriate generation model, balancing cost and performance.
  2. Candidate generation – The chosen model produces candidates responses to the task_prompt.
  3. Judging – A stronger model (e.g. Anthropic Sonnet) ranks the candidates using the judge_prompt and returns them in order of preference.
  4. Result – The top-ranked candidate is returned.

When multiple clients are configured, judging falls back in priority order: Anthropic → OpenAI → DeepSeek.

Installation

pip install adj-ai

This pulls in the official provider SDKs (anthropic, openai) automatically.

DeepSeek and OpenAI share the openai SDK (DeepSeek exposes an OpenAI-compatible API).

Usage

from anthropic import Anthropic
from openai import OpenAI

from adj_ai import Orchestrator

anthropic_client = Anthropic(api_key="...")
openai_client = OpenAI(api_key="...")
deepseek_client = OpenAI(api_key="...", base_url="https://api.deepseek.com")

orch = Orchestrator(
    task_prompt="Write a concise product description for a smart water bottle.",
    judge_prompt="Pick the description that is clearest and most persuasive.",
    anthropic_client=anthropic_client,
    openai_client=openai_client,
    deepseek_client=deepseek_client,
    candidate_number=5,
    max_task_tokens=1000,
)

best = orch.run_task()
print(best)

At least one of anthropic_client, openai_client, or deepseek_client must be provided, otherwise an OrchestratorError is raised.

Configuration

Parameter Type Default Description
task_prompt str The task to generate candidate responses for.
judge_prompt str The rubric used to rank candidates.
anthropic_client Anthropic Optional Anthropic client.
openai_client OpenAI Optional OpenAI client.
deepseek_client OpenAI Optional DeepSeek (OpenAI-compatible) client.
candidate_number int 1 Number of candidate responses to generate.
max_task_tokens int 1000 Maximum tokens per generated candidate.

TODO

License

Released under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adj_ai-1.0.0.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adj_ai-1.0.0-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

Details for the file adj_ai-1.0.0.tar.gz.

File metadata

  • Download URL: adj_ai-1.0.0.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for adj_ai-1.0.0.tar.gz
Algorithm Hash digest
SHA256 9a9004d2ff7e417ed84a97f2b583ae7b0a7f8d7087c77d71d2794f22723e5723
MD5 4a06c39014f5973e141a0933d2d34014
BLAKE2b-256 ab8618a45b5fecf0afbcfd3615807d244a20eb7218b8af972a94ace67fa86fd5

See more details on using hashes here.

Provenance

The following attestation bundles were made for adj_ai-1.0.0.tar.gz:

Publisher: release.yml on TEP-DEV-ACT/adj-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file adj_ai-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: adj_ai-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for adj_ai-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b485bf496c2d7802298c592370fa10b825bc078192c06de87e9bb1b2327173ee
MD5 96c9a69d503ca593fa6cc50a7c2bf22f
BLAKE2b-256 b921fc1919ec467e72a6fd287eccb21ca58fe2c2e0508fb6364c06a3d0fe706e

See more details on using hashes here.

Provenance

The following attestation bundles were made for adj_ai-1.0.0-py3-none-any.whl:

Publisher: release.yml on TEP-DEV-ACT/adj-ai

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page