llama-index llms duel agents integration
Project description
LlamaIndex Llms Integration: Duel Agents
Duel Agents routes each prompt against multiple models and bills the cheapest answer that still wins, behind an OpenAI-compatible proxy.
Installation
pip install llama-index-llms-duel
Create an API key at duelagents.com/dashboard/settings (an active subscription is required) and set it:
export DUEL_API_KEY="duel_<prefix>_<secret>"
Usage
from llama_index.llms.duel import DuelLLM
llm = DuelLLM(model="duel-auto")
resp = llm.complete("Explain concurrent agents in one sentence.")
print(resp)
Chat:
from llama_index.core.llms import ChatMessage
messages = [
ChatMessage(role="system", content="You answer concisely."),
ChatMessage(role="user", content="What is model routing?"),
]
print(llm.chat(messages))
duel-auto lets Duel pick the model. You can also pass a specific model name
(for example gpt-4o-mini or claude-3-5-haiku-latest) to route to that
provider.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file llama_index_llms_duel-0.1.0.tar.gz.
File metadata
- Download URL: llama_index_llms_duel-0.1.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5e24da1f16fe89171beb753674594c03203ea2bf0ac8bd3704faa2274ff9b1f
|
|
| MD5 |
135da850712552158c4bc77e794e0f4b
|
|
| BLAKE2b-256 |
ae03b84125a0eabe1b29f56bb6fdfbaa824ecef26384e18c8b8e3ac4ba8266e4
|
File details
Details for the file llama_index_llms_duel-0.1.0-py3-none-any.whl.
File metadata
- Download URL: llama_index_llms_duel-0.1.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10ce98f895f2d28a312869e5e4405ede0926abc54c70ef92a4481dea9fa4134b
|
|
| MD5 |
d32eef4fa0a5865728f26a7d55e10bb9
|
|
| BLAKE2b-256 |
e5e8d364a2f2ff796351d065eb078700cfcd218b88d9f8050ead1fd0682e01cb
|