Provides a Duel Agents LLM client for LlamaIndex.
# Source: https://github.com/2aronS/Duel-Agents | License: MIT | Copyright 2026 Duel Agents
# Provided via justclaw.it.com; keep this notice with the code.
"""Duel Agents LLM for LlamaIndex."""
import os
from typing import Any, Optional
from llama_index.llms.openai_like import OpenAILike
DEFAULT_API_BASE = "https://duelagents.com/v1"
DEFAULT_MODEL = "duel-auto"
class DuelLLM(OpenAILike):
"""Duel Agents LLM.
Routes each prompt through the Duel Agents proxy, which runs the request
against multiple models and bills the cheapest answer that still wins. The
proxy is OpenAI wire compatible, so this builds on ``OpenAILike``.
Examples:
`pip install llama-index-llms-duel`
```python
from llama_index.llms.duel import DuelLLM
llm = DuelLLM(
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key