Environment:2aronS Duel Agents Python 3 10 Plus
| Knowledge Sources | |
|---|---|
| Domains | Infrastructure, LLMs |
| Last Updated | 2026-10-27 00:00 GMT |
Overview
Python >= 3.10, < 4.0 environment for the `llama-index-llms-duel` package, built on LlamaIndex Core 0.13–0.14 and `llama-index-llms-openai-like` 0.5.x to provide the `DuelLLM` model.
Description
This environment runs the `llama-index-llms-duel` integration, which subclasses `llama_index.llms.openai_like.OpenAILike` to route requests through the Duel Agents proxy. The build is managed by `hatchling` and the package metadata pins `requires-python = ">=3.10,<4.0"`. The toolchain config (`[tool.mypy]`) targets `python_version = "3.10"` and the dev dependency group pins `mypy==0.991` and `black<=23.9.1` for compatibility. Like the LangChain integration, it is network-bound with no GPU requirement.
Usage
Use this environment when installing or running the `llama-index-llms-duel` package, i.e. whenever using the DuelLLM model in a LlamaIndex application. It is the mandatory prerequisite for the `DuelLLM` Implementation page.
System Requirements
| Category | Requirement | Notes |
|---|---|---|
| OS | Linux, macOS, or Windows | Pure Python; no compiled extensions |
| Hardware | Any modern CPU | No GPU; inference is delegated to the Duel proxy |
| Runtime | Python >= 3.10, < 4.0 | Declared via `requires-python` in pyproject.toml |
| Network | Outbound HTTPS to duelagents.com | Required for every model call |
Dependencies
Python Packages
- `llama-index-llms-openai-like` >= 0.5.0, < 0.6
- `llama-index-core` >= 0.13.0, < 0.15
Dev Dependencies
- `pytest` == 7.4.4
- `pytest-mock` == 3.11.1
- `pytest-cov` >= 6.1.1
- `mypy` == 0.991
- `ruff` == 0.11.11
- `black[jupyter]` >= 23.7.0, <= 23.9.1
- `codespell[toml]` >= v2.2.6
- `pre-commit` == 3.2.0
- `ipython` == 8.10.0
- `jupyter` >= 1.0.0, < 2
Build System
- `hatchling` (PEP 517 backend, declared in `[build-system]`)
Credentials
The following environment variables are read at runtime by `DuelLLM`:
- `DUEL_API_KEY`: Duel API key, format `duel_<prefix>_<secret>` (passed to `OpenAILike` as `api_key`)
- `DUEL_PROXY_URL`: optional proxy override, defaults to `https://duelagents.com/v1`
Never hardcode key values; pass the key via the `api_key` parameter or the `DUEL_API_KEY` environment variable.
Quick Install
pip install llama-index-llms-duel
export DUEL_API_KEY="duel_<prefix>_<secret>"
Code Evidence
Python version constraint from `python/llama-index-llms-duel/pyproject.toml:25`:
requires-python = ">=3.10,<4.0"
Dependency pins from `python/llama-index-llms-duel/pyproject.toml:29-32`:
dependencies = [
"llama-index-llms-openai-like>=0.5.0,<0.6",
"llama-index-core>=0.13.0,<0.15",
]
mypy target version from `python/llama-index-llms-duel/pyproject.toml:58-62`:
[tool.mypy]
disallow_untyped_defs = true
ignore_missing_imports = true
python_version = "3.10"
Environment-variable resolution from `python/llama-index-llms-duel/llama_index/llms/duel/base.py:35-44`:
def __init__(
self,
model: str = DEFAULT_MODEL,
api_base: str = DEFAULT_API_BASE,
api_key: Optional[str] = None,
is_chat_model: bool = True,
**kwargs: Any,
) -> None:
api_base = os.getenv("DUEL_PROXY_URL", api_base)
api_key = api_key or os.getenv("DUEL_API_KEY")
Common Errors
| Error Message | Cause | Solution |
|---|---|---|
| `ModuleNotFoundError: llama_index.llms.openai_like` | `llama-index-llms-openai-like` not installed or pinned to < 0.5 | `pip install -U "llama-index-llms-openai-like>=0.5.0,<0.6"` |
| `AuthenticationError` / 401 from proxy | `DUEL_API_KEY` unset or malformed | Set `DUEL_API_KEY` to a `duel_<prefix>_<secret>` key from the dashboard |
| `TypeError: 'NoneType' object is not iterable` on init | `api_key` arg and `DUEL_API_KEY` env both unset, so `OpenAILike` receives `None` | Pass `api_key=` or export `DUEL_API_KEY` |
| mypy fails on `Optional[...]` style | Running a mypy newer than 0.991 against the repo's config | The dev group pins `mypy==0.991`; use that version for type checks |
Compatibility Notes
- Python 3.9: not supported — `requires-python = ">=3.10"` rejects it, and the mypy config targets 3.10.
- Python 4.x: explicitly excluded by the `<4.0` upper bound.
- LlamaIndex Core 0.12: not supported — the `>=0.13.0` lower bound requires 0.13 or 0.14; earlier `OpenAILike` APIs differ.
- llama-index-llms-openai-like 0.4.x: not supported — the `>=0.5.0` lower bound is required by the current subclass API.
- black/jupyter pins: the dev group pins `black<=23.9.1` to stay compatible with `jupyter` formatting; do not bump black independently without checking the pin.
- No GPU: all inference is delegated to the Duel proxy.