You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The AIPerf plugin system provides a flexible, extensible architecture for customizing benchmark behavior. It uses YAML-based configuration with lazy loading, priority-based conflict resolution, and dynamic enum generation.
Scan aiperf.plugins entry points for plugins.yaml files
2. Loading
Parse YAML, validate with Pydantic, register with conflict resolution
3. Access
get_class() imports module, caches class for reuse
Registry Singleton Pattern
The plugin registry follows the singleton pattern with module-level exports:
fromaiperf.pluginimportpluginsfromaiperf.plugin.enumsimportPluginType# Get a plugin class by nameEndpointClass=plugins.get_class(PluginType.ENDPOINT, "chat")
# Iterate all plugins in a categoryforentry, clsinplugins.iter_all(PluginType.ENDPOINT):
print(f"{entry.name}: {entry.description}")
Plugin Categories
AIPerf supports 34 plugin categories organized by function, including api_router and public_dataset_loader:
Service orchestration for local multiprocessing and distributed Kubernetes deployments. Built-in multiprocessing and kubernetes service-manager plugins are registered.
Visualization and Telemetry Categories
Category
Enum
Description
plot
PlotType
Chart types (scatter, histogram, timeline, etc.)
gpu_telemetry_collector
GPUTelemetryCollectorType
GPU metric collection (DCGM, pynvml)
Infrastructure Categories (Internal)
Category
Enum
Description
communication
CommunicationBackend
ZMQ backends (IPC, TCP, dual-bind)
communication_client
CommClientType
Socket patterns (PUB, SUB, PUSH, PULL)
zmq_proxy
ZMQProxyType
Message routing proxies
Sweep / Adaptive Search Categories
Category
Enum
Description
search_recipe
SearchRecipeType
Named presets that compile to AdaptiveSearchSweep or grid sweep parameters; selected via --search-recipe
search_recipe_post_process
SearchRecipePostProcessType
Stateless handlers emitting derived artifacts (curves, knee points) into sweep_aggregate/ after SweepAnalyzer.compute()
convergence_criterion
ConvergenceCriterionType
Decides when metrics have stabilized across repeated runs; selected via --convergence-mode
search_planner
SearchPlannerType
Drives the adaptive outer loop via ask()/tell(); selected via --search-planner
Using Plugins
fromaiperf.pluginimportpluginsfromaiperf.plugin.enumsimportPluginType, EndpointType# Get class by name, enum, or full pathChatEndpoint=plugins.get_class(PluginType.ENDPOINT, "chat")
ChatEndpoint=plugins.get_class(PluginType.ENDPOINT, EndpointType.CHAT)
ChatEndpoint=plugins.get_class(PluginType.ENDPOINT, "aiperf.endpoints.openai_chat:ChatEndpoint")
# Iterate pluginsforentry, clsinplugins.iter_all(PluginType.ENDPOINT):
print(f"{entry.name}: {entry.class_path}")
# Get metadata (raw dict or typed)metadata=plugins.get_metadata("endpoint", "chat")
endpoint_meta=plugins.get_endpoint_metadata("chat") # Returns EndpointMetadata
Function
Returns
Use Case
get_class(category, name)
type
Get plugin class
iter_all(category)
Iterator[tuple[PluginEntry, type]]
List all plugins
get_metadata(category, name)
dict
Raw metadata
get_endpoint_metadata(name)
EndpointMetadata
Typed endpoint config
get_transport_metadata(name)
TransportMetadata
Typed transport config
get_plot_metadata(name)
PlotMetadata
Typed plot config
get_service_metadata(name)
ServiceMetadata
Typed service config
get_gpu_telemetry_collector_metadata(name)
GPUTelemetryCollectorMetadata
Typed GPU collector config
Creating Custom Plugins
Tip
Contributing directly to AIPerf? You only need two things:
Add your class under src/aiperf/
Register it in src/aiperf/plugin/plugins.yaml
The pyproject.toml entry points and separate package install below are only needed for external/third-party plugins.
Quick Start (4 steps):
Step
File
Action
1
my_endpoint.py
Create class extending BaseEndpoint
2
plugins.yaml
Register with class path, description, and metadata
# yaml-language-server: $schema=https://raw.githubusercontent.com/ai-dynamo/aiperf/refs/heads/main/src/aiperf/plugin/schema/plugins.schema.json# my_package/plugins.yamlschema_version: "1.0"endpoint:
my_custom:
class: my_package.endpoints.custom_endpoint:MyCustomEndpointdescription: Custom endpoint for my API.metadata: { endpoint_path: /v1/generate, supports_streaming: true, produces_tokens: true, tokenizes_input: true, metrics_title: My Custom Metrics }
Note
Extend base classes (BaseEndpoint, etc.) to get logging, helpers, and default implementations. Only implement core methods.
Plugin Configuration
categories.yaml Schema
Defines plugin categories with their protocols and metadata schemas:
# yaml-language-server: $schema=https://raw.githubusercontent.com/ai-dynamo/aiperf/refs/heads/main/src/aiperf/plugin/schema/categories.schema.jsonschema_version: "1.0"endpoint:
protocol: aiperf.endpoints.protocols:EndpointProtocolmetadata_class: aiperf.plugin.schema.schemas:EndpointMetadataenum: EndpointTypedescription: | Endpoints define how to format requests and parse responses for different APIs.internal: false # Set to true for infrastructure categories
Type Safety: get_class() returns typed results (e.g., type[EndpointProtocol]) with IDE autocomplete.
Built-in Plugins Reference
Endpoints
Name
Class
Description
audio_transcription
AudioTranscriptionEndpoint
OpenAI Audio Transcription (Whisper-style) API; multipart upload of audio to /v1/audio/transcriptions, returns a plain-text transcript. Pairs with ASR datasets (e.g. librispeech).
chat
ChatEndpoint
OpenAI Chat Completions API
chat_embeddings
ChatEmbeddingsEndpoint
vLLM multimodal embeddings via chat API
completions
CompletionsEndpoint
OpenAI Completions API
cohere_rankings
CohereRankingsEndpoint
Cohere Reranking API
embeddings
EmbeddingsEndpoint
OpenAI Embeddings API
hf_tei_rankings
HFTeiRankingsEndpoint
HuggingFace TEI Rankings
huggingface_generate
HuggingFaceGenerateEndpoint
HuggingFace TGI
image_edit
ImageEditEndpoint
OpenAI Image Edit (image-to-image) API; multipart upload of reference image + prompt to /v1/images/edits. Compatible with SGLang FLUX.2 unified diffusion serving.
image_generation
ImageGenerationEndpoint
OpenAI Image Generation API
image_retrieval
ImageRetrievalEndpoint
Image retrieval API
nim_embeddings
NIMEmbeddingsEndpoint
NVIDIA NIM Embeddings
nim_rankings
NIMRankingsEndpoint
NVIDIA NIM Rankings
responses
ResponsesEndpoint
OpenAI Responses API
solido_rag
SolidoEndpoint
Solido RAG Pipeline
template
TemplateEndpoint
Template for custom endpoints
video_generation
VideoGenerationEndpoint
Text-to-video generation API
Timing Strategies
Name
Class
Description
fixed_schedule
FixedScheduleStrategy
Send requests at exact timestamps
request_rate
RequestRateStrategy
Send requests at specified rate
user_centric_rate
UserCentricStrategy
Each session acts as separate user
Arrival Patterns
Name
Class
Description
constant
ConstantIntervalGenerator
Fixed intervals between requests
poisson
PoissonIntervalGenerator
Poisson process arrivals
gamma
GammaIntervalGenerator
Gamma distribution with tunable smoothness
concurrency_burst
ConcurrencyBurstIntervalGenerator
Send ASAP up to concurrency limit
Dataset Composers
Name
Class
Description
synthetic
SyntheticDatasetComposer
Generate synthetic conversations
custom
CustomDatasetComposer
Load from JSONL files
synthetic_rankings
SyntheticRankingsDatasetComposer
Generate ranking tasks
UI Types
Name
Class
Description
dashboard
AIPerfDashboardUI
Rich terminal dashboard
simple
TQDMProgressUI
Simple tqdm progress bar
none
NoUI
Headless execution
Accuracy Benchmarks
Name
Class
Description
mmlu
MMLUBenchmark
Massive Multitask Language Understanding
aime
AIMEBenchmark
American Invitational Mathematics Examination
aime24
AIME24Benchmark
AIME 2024 competition problems
aime25
AIME25Benchmark
AIME 2025 competition problems
hellaswag
HellaSwagBenchmark
HellaSwag commonsense reasoning
bigbench
BigBenchBenchmark
BIG-Bench benchmark tasks
math_500
Math500Benchmark
MATH-500 problem set
gpqa_diamond
GPQADiamondBenchmark
GPQA Diamond graduate-level science
lcb_codegeneration
LCBCodeGenerationBenchmark
LiveCodeBench code generation
Accuracy Graders
Name
Class
Description
exact_match
ExactMatchGrader
Exact string matching
math
MathGrader
Mathematical expression evaluation
multiple_choice
MultipleChoiceGrader
Multiple choice answer extraction
code_execution
CodeExecutionGrader
Code execution and output comparison
Troubleshooting
Plugin Not Found
TypeNotFoundError: Type 'my_plugin' not found for category 'endpoint'.
Solutions:
Verify the plugin is registered in plugins.yaml
Check the entry point is defined in pyproject.toml
Reinstall the package in the active environment: uv pip install -e .
Run aiperf plugins --validate to check for errors
Module Import Errors
ImportError: Failed to import module for endpoint:my_plugin
Solutions:
Verify the class path format: module.path:ClassName
Check all dependencies are installed
Verify the module is importable: python -c "import module.path"
Class Not Found
AttributeError: Class 'MyClass' not found
Solutions:
Verify the class name matches exactly (case-sensitive)
Ensure the class is exported from the module
Run aiperf plugins --validate for detailed error
Conflict Resolution Issues
If your plugin is being shadowed by another:
Use higher priority: priority: 10 in plugins.yaml
Access by full class path: plugins.get_class("endpoint", "my_pkg.endpoints:MyEndpoint")
Check aiperf plugins to see which packages are loaded