gpt4all接口api调用示例20250330
gpt4all接口api调用示例20250330
官方示意文档: https://docs.gpt4all.io/gpt4all_api_server/home.html#localdocs-integration
curl --request POST \
--url http://localhost:8899/v1/chat/completions \
--header 'Content-Type: application/json' \
--data '{
"model": "DeepSeek-R1-Distill-Qwen-7B-Q3_0.gguf",
"messages": [{"role": "user", "content": "作一首简单的爱情诗。"}],
"max_tokens": 5000000,
"temperature": 1
}'
——————————————————————————————————————————————————————————————————————
import requests
url = "http://localhost:8899/v1/chat/completions"
headers = {"Content-Type": "application/json"}
data = {
"model": "gpt4all-falcon-q4_0",
"messages": [{"role": "user", "content": "解释下vlan的优点"}],
"max_tokens": 50000000,
"temperature": 1,
}
response = requests.post(url, json=data, headers=headers)
print(response.json()["choices"][0]["message"]["content"])


浙公网安备 33010602011771号