Expand description
vLLM model adapter for the agentkit agent loop.
This crate provides VllmAdapter and VllmConfig for connecting
the agent loop to a vLLM server via its
OpenAI-compatible chat completions endpoint. It is built on the generic
agentkit_adapter_completions crate.
An API key is optional — vLLM servers can run with or without authentication.
§Quick start
ⓘ
use agentkit_loop::{Agent, SessionConfig};
use agentkit_provider_vllm::{VllmAdapter, VllmConfig};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = VllmConfig::new("meta-llama/Llama-3.1-8B-Instruct");
let adapter = VllmAdapter::new(config)?;
let agent = Agent::builder()
.model(adapter)
.build()?;
let mut driver = agent
.start(SessionConfig::new("demo"))
.await?;
Ok(())
}Structs§
- Vllm
Adapter - Model adapter that connects the agentkit agent loop to a vLLM server.
- Vllm
Config - Configuration for connecting to a vLLM server.
- Vllm
Provider - The vLLM provider, implementing
CompletionsProvider. - Vllm
Request Config - Request parameters serialized into the vLLM request body.
Enums§
- Vllm
Error - Errors produced by the vLLM adapter.
Type Aliases§
- Vllm
Session - An active session with a vLLM server.
- Vllm
Turn - A completed turn from a vLLM server.