Autonomous Integration
Since HAP v6.1.0, it supports integration with third-party large models compatible with the OpenAI API standard. You can quickly complete model integration and invocation by configuring the base_url
to the target service API address.
Configuration Steps
Configuration steps are exactly the same as those in the based on OpenAI document. You only need to modify the following field values in the configuration file:
- resource: The API base_url address of the target service (compatible with the OpenAI API).
- deployment: The model name of the target service.
- apiKey: The access credential (API key) for the target service.
Integration Examples
DeepSeek Integration Example
The base_url compatible with the OpenAI API for DeepSeek is: https://api.deepseek.com/v1
.
- For more compatibility information concerning OpenAI API with DeepSeek, please refer to the DeepSeek official documentation.
Configuration file example:
md.aigc.configs=[{\
'model': 'DeepSeek-V3', \
'resource': 'https://api.deepseek.com/v1', \
'deployment': 'deepseek-chat', \
'apiVersion': '', \
'apiKey': 'sk-dd0bd***********************4306', \
'price': '0.012' \
},{\
'model': 'DeepSeek-R1', \
'resource': 'https://api.deepseek.com/v1', \
'deployment': 'deepseek-reasoner', \
'apiVersion': '', \
'apiKey': 'sk-dd0bd***********************4306', \
'price': '0.012' \
}]
- resource: Fill in the base_url for the DeepSeek service compatible with the OpenAI API.
- deployment: Fill in the name of the model provided by DeepSeek.
- apiKey: Fill in the API Key provided by DeepSeek.
- For detailed configuration steps, please refer to based on OpenAI.
Volcano Ark Platform Integration Example
The base_url compatible with the OpenAI API for the Volcano Ark platform is: https://ark.cn-beijing.volces.com/api/v3
.
- For more compatibility information concerning OpenAI API with the Volcano Ark platform, please refer to the Volcano Ark platform official documentation.
Configuration file example:
md.aigc.configs=[{\
'model': 'DouBao-1.5-Pro', \
'resource': 'https://ark.cn-beijing.volces.com/api/v3', \
'deployment': 'doubao-1-5-pro-32k-250115', \
'apiVersion': '', \
'apiKey': 'da***********************5e', \
'price': '0.012' \
},{\
'model': 'DeepSeek-V3', \
'resource': 'https://ark.cn-beijing.volces.com/api/v3', \
'deployment': 'ep-2025******0241-6szgr', \
'apiVersion': '', \
'apiKey': 'da***********************5e', \
'price': '0.012' \
}]
- resource: Fill in the base_url for the Volcano Ark service compatible with the OpenAI API.
- deployment: Fill in the Model ID or Endpoint ID provided by the Volcano Ark platform.
- apiKey: Fill in the API Key provided by the Volcano Ark platform.
- For detailed configuration steps, please refer to based on OpenAI.
Ollama Local Large Model Integration Example
Ollama provides a local service compatible with the OpenAI API, with a default base_url of: http://localhost:11434/v1
.
- For more compatibility information concerning OpenAI API with Ollama, please refer to the Ollama official documentation.
Configuration file example:
md.aigc.configs=[{\
'model': 'Ollama-DeepSeek-V3', \
'resource': 'http://192.168.10.154:11434/v1', \
'deployment': 'deepseek-r1:32b', \
'apiVersion': '', \
'apiKey': 'example-key', \
'price': '0.012' \
}]
- resource: Fill in the actual
base_url
for the local Ollama service compatible with the OpenAI API, typically in the format{host}/v1
, e.g.,http://192.168.10.154:11434/v1
. - deployment: Fill in the name of the model running on the local Ollama service.
- apiKey: Fill in the API Key for the local Ollama service. If Key authentication is not enabled, enter any non-empty string (e.g.,
example-key
). - For detailed configuration steps, please refer to based on OpenAI.