Implementation:Open compass VLMEvalKit SiliconFlowAPI
| Field | Value |
|---|---|
| source | VLMEvalKit |
| domain | Vision, API_Integration |
Overview
SiliconFlowAPI provides a VLMEvalKit API adapter for models hosted on the SiliconFlow inference platform.
Description
SiliconFlowAPI inherits from BaseAPI and communicates with the SiliconFlow chat completions API endpoint. It includes image resizing and encoding utilities with configurable max dimensions, supports an optional reasoning mode that returns both content and reasoning outputs, and uses Bearer token authentication via the SiliconFlow_API_KEY environment variable.
Usage
Use this adapter when evaluating vision-language models (such as DeepSeek-V2.5) hosted on the SiliconFlow platform.
Code Reference
- Source:
vlmeval/api/siliconflow.py, Lines: L1-277 - Import:
from vlmeval.api.siliconflow import SiliconFlowAPI
Signature:
class SiliconFlowAPI(BaseAPI):
def __init__(self, model='deepseek-ai/DeepSeek-V2.5', retry=5,
key=None, api_base=API_BASE, verbose=True,
system_prompt=None, timeout=60, reasoning=False,
**kwargs): ...
def generate_inner(self, inputs, **kwargs): ...
I/O Contract
| Direction | Description |
|---|---|
| Inputs | message — text/image/video content list; model-specific params via kwargs |
| Outputs | generate() returns str prediction; generate_inner() returns (int, str, str) tuple |
Usage Examples
# Example instantiation
model = SiliconFlowAPI(model='deepseek-ai/DeepSeek-V2.5')
response = model.generate(message)