llm_backends

A configuration module for connecting AgentFly to different text-generation systems, including vLLM, Verl, and OpenAI-compatible clients. It provides configuration classes and backend implementations for these connection types.

In plain words
What is it for?
Use it to configure asynchronous vLLM or Verl connections and clients that follow the OpenAI-compatible interface. Verl is also intended for internal model-training use.
Why use it?
It separates the agent system from the specific text-generation service being used. This makes backend-specific settings explicit and allows different services to be configured through a common module.

Agent

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add agents/agent-one-lab/agentfly/llm_backends
Clone the repo
git clone --depth 1 https://github.com/Agent-One-Lab/AgentFly
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 709 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00709
Opus 5 $0.00000 $0.00354
Sonnet 5 $0.00000 $0.00142
Haiku 4.5 $0.00000 $0.00071

Measured 2d ago against content hash 66db9813154f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

llm_backends scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/api_references/agents/llm_backends.md · 118 lines

How it starts

The opening of the file, as written. The whole thing — 118 lines — stays where its author put it; the contents beside it link to each section on GitHub.

LLM Backends

Overview

AgentFly supports multiple LLM backends for text generation, each with their own configuration options. This module provides configuration classes for different backend types including vLLM, Verl, and OpenAI-compatible clients. Among them, Verl backend is designed for internal training usage. The Verl backend is the core design that decouples agent system and rl training.

Configuration Classes

Async VLLM Backend

Configuration for asynchronous vLLM backend with engine arguments:

::: agentfly.utils.llm_backends.backend_configs.AsyncVLLMConfig options: show_inheritance: true

Async Verl Backend

Configuration for asynchronous Verl backend:

::: agentfly.utils.llm_backends.backend_configs.AsyncVerlConfig options: show_inheritance: true

Client Backend

Configuration for OpenAI-compatible client backends:

::: agentfly.utils.llm_backends.backend_configs.ClientConfig options: show_inheritance: true

Backend Implementations

Base Backend

Abstract base class for all LLM backends:

::: agentfly.utils.llm_backends.llm_backends.LLMBackend options: show_inheritance: true

Async VLLM Backend

Asynchronous vLLM implementation for high-performance model inference:

::: agentfly.utils.llm_backends.llm_backends.AsyncVLLMBackend options: show_inheritance: true

Async Verl Backend

Asynchronous Verl implementation for distributed model inference:

::: agentfly.utils.llm_backends.llm_backends.AsyncVerlBackend options: show_inheritance: true

Client Backend

OpenAI-compatible client backend for remote API inference:

::: agentfly.utils.llm_backends.llm_backends.ClientBackend options: show_inheritance: true

Usage Examples

Backends are designed to work together with agents. Here are examples showing how to configure different backends when creating agents:

Async VLLM Backend

from agentfly.agents import HFAgent
from agentfly.tools import calculator
from agentfly.rewards import math_equal_reward_tool
from agentfly.utils.llm_backends import AsyncVLLMConfig

agent = HFAgent(
    model_name_or_path="Qwen/Qwen2.5-3B-Instruct",
    tools=[calculator],
    reward_fn=math_equal_reward_tool,
    template="qwen2.5",
    backend_config=AsyncVLLMConfig(
        pipeline_parallel_size=2,
        data_parallel_size=1,
        tensor_parallel_size=1,
        gpu_memory_utilization=0.8
    )
)

Read the full file on GitHub · 118 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 118 lines · 0 tokens per session scan A 66db9813154f

Subscribe to this mod's changes

llm_backends is an agent published in the GitHub repository Agent-One-Lab/AgentFly (122 stars, last pushed 7d ago), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 709 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.