文档

模型调用的API

您可以通过以下API端点调用我们的模型:

POST https://fastaitool.xyz/v1/models/{model_id}/predict

请求参数

参数名类型描述
model_idstring要使用的模型ID
inputobject输入数据
parametersobject可选的模型参数

使用例子

基本调用示例


// 使用fetch API
fetch('https://fastaitool.xyz/v1/models/text-model/predict', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer YOUR_API_KEY'
  },
  body: JSON.stringify({
    input: {
      text: "您好,请介绍一下您的服务。"
    },
    parameters: {
      temperature: 0.7,
      max_tokens: 100
    }
  })
})
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error('Error:', error));
        

批量处理示例


// 批量处理多个输入
const inputs = [
  "第一个问题",
  "第二个问题",
  "第三个问题"
];

const requests = inputs.map(text => 
  fetch('https://fastaitool.xyz/v1/models/text-model/predict', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'Bearer YOUR_API_KEY'
    },
    body: JSON.stringify({
      input: { text },
      parameters: {
        temperature: 0.5,
        max_tokens: 50
      }
    })
  }).then(res => res.json())
);

Promise.all(requests)
  .then(results => console.log(results))
  .catch(error => console.error('Error:', error));
        

企业解决方案

私有化部署方案

我们提供完整的模型私有化部署解决方案,可根据您的业务需求在您的基础设施上部署模型,确保数据安全与隐私。

推理性能加速

为指定模型提供专业的推理性能加速服务,优化推理速度,降低资源消耗,提升用户体验。

低成本模型微调

提供经济高效的模型微调方案,帮助您以较低成本将通用模型适配到特定领域或任务。

详情请发送邮件至 emotiversetech@gmail.com