DeepInfra raises $107M Series B to scale the inference cloud — read the announcement

Cloudflare/

clef-flash

$0.038 / 1M tokens

50% off · 1 day left

Public
Zero retention
bfloat16
24,576
Cloudflare/clef-flash cover image
demo
Request
curl -X POST \
    -d '{"model": "Cloudflare/clef-flash", "state": "Help! My payouts have been failing for 3 days.", "questions": {"is_urgent": {"type": "noul", "instructions": "Does this convey urgency?"}, "department": {"type": "choice", "instructions": "Which team should handle this?", "criteria": {"billing": "Payments", "technical": "Bugs", "sales": "Pricing"}}, "frustration": {"type": "score", "instructions": "How frustrated is the customer?", "criteria": ["Calm", "Frustrated", "Very angry"]}}}' \
    -H "Authorization: bearer $DEEPINFRA_API_KEY" \
    -H 'Content-Type: application/json' \
    'https://api.deepinfra.com/v1/decisions'
Response
{
  "model": "Cloudflare/clef-flash",
  "answers": {
    "is_urgent": {
      "type": "noul",
      "noul": 0.93
    },
    "department": {
      "type": "choice",
      "choice": "billing",
      "probabilities": {
        "billing": 0.88,
        "technical": 0.1,
        "sales": 0.02
      },
      "confidence": 0.88
    },
    "frustration": {
      "type": "score",
      "score": 1.67,
      "legend": {
        "0": "Calm",
        "1": "Frustrated",
        "2": "Very angry"
      },
      "probabilities": {
        "0": 0.04,
        "1": 0.25,
        "2": 0.71
      },
      "confidence": 0.45
    }
  },
  "usage": {
    "input_tokens": 96,
    "output_tokens": 3
  }
}
Input schema
{
  "additionalProperties": false,
  "properties": {
    "state": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "items": {},
          "type": "array"
        }
      ],
      "title": "State"
    },
    "model": {
      "title": "Model",
      "type": "string"
    },
    "questions": {
      "additionalProperties": {
        "discriminator": {
          "propertyName": "type"
        },
        "oneOf": [
          {
            "additionalProperties": false,
            "properties": {
              "type": {
                "const": "noul",
                "title": "Type",
                "type": "string"
              },
              "instructions": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  {
                    "items": {},
                    "type": "array"
                  }
                ],
                "title": "Instructions"
              },
              "criteria": {
                "anyOf": [
                  {
                    "additionalProperties": false,
                    "properties": {
                      "true": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "additionalProperties": true,
                            "type": "object"
                          },
                          {
                            "items": {},
                            "type": "array"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "title": "True"
                      },
                      "false": {
                        "anyOf": [
                          {
                            "type": "string"
                          },
                          {
                            "additionalProperties": true,
                            "type": "object"
                          },
                          {
                            "items": {},
                            "type": "array"
                          },
                          {
                            "type": "null"
                          }
                        ],
                        "default": null,
                        "title": "False"
                      }
                    },
                    "title": "NoulCriteria",
                    "type": "object"
                  },
                  {
                    "type": "null"
                  }
                ],
                "default": null
              }
            },
            "required": [
              "type",
              "instructions"
            ],
            "title": "NoulQuestion",
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "type": {
                "const": "choice",
                "title": "Type",
                "type": "string"
              },
              "instructions": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  {
                    "items": {},
                    "type": "array"
                  }
                ],
                "title": "Instructions"
              },
              "criteria": {
                "additionalProperties": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "additionalProperties": true,
                      "type": "object"
                    },
                    {
                      "items": {},
                      "type": "array"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "maxProperties": 52,
                "minProperties": 2,
                "title": "Criteria",
                "type": "object"
              }
            },
            "required": [
              "type",
              "instructions",
              "criteria"
            ],
            "title": "ChoiceQuestion",
            "type": "object"
          },
          {
            "additionalProperties": false,
            "properties": {
              "type": {
                "const": "score",
                "title": "Type",
                "type": "string"
              },
              "instructions": {
                "anyOf": [
                  {
                    "type": "string"
                  },
                  {
                    "additionalProperties": true,
                    "type": "object"
                  },
                  {
                    "items": {},
                    "type": "array"
                  }
                ],
                "title": "Instructions"
              },
              "criteria": {
                "items": {
                  "anyOf": [
                    {
                      "type": "string"
                    },
                    {
                      "additionalProperties": true,
                      "type": "object"
                    },
                    {
                      "items": {},
                      "type": "array"
                    }
                  ]
                },
                "maxItems": 10,
                "minItems": 2,
                "title": "Criteria",
                "type": "array"
              }
            },
            "required": [
              "type",
              "instructions",
              "criteria"
            ],
            "title": "ScoreQuestion",
            "type": "object"
          }
        ]
      },
      "maxProperties": 64,
      "minProperties": 1,
      "title": "Questions",
      "type": "object"
    }
  },
  "required": [
    "state",
    "model",
    "questions"
  ],
  "title": "SystemOneRequest",
  "type": "object"
}
Output schema
{
  "properties": {
    "model": {
      "title": "Model",
      "type": "string"
    },
    "answers": {
      "additionalProperties": {
        "anyOf": [
          {
            "properties": {
              "type": {
                "const": "noul",
                "default": "noul",
                "title": "Type",
                "type": "string"
              },
              "noul": {
                "title": "Noul",
                "type": "number"
              }
            },
            "required": [
              "noul"
            ],
            "title": "NoulAnswer",
            "type": "object"
          },
          {
            "properties": {
              "type": {
                "const": "choice",
                "default": "choice",
                "title": "Type",
                "type": "string"
              },
              "choice": {
                "title": "Choice",
                "type": "string"
              },
              "probabilities": {
                "additionalProperties": {
                  "type": "number"
                },
                "title": "Probabilities",
                "type": "object"
              },
              "confidence": {
                "title": "Confidence",
                "type": "number"
              }
            },
            "required": [
              "choice",
              "probabilities",
              "confidence"
            ],
            "title": "ChoiceAnswer",
            "type": "object"
          },
          {
            "properties": {
              "type": {
                "const": "score",
                "default": "score",
                "title": "Type",
                "type": "string"
              },
              "score": {
                "title": "Score",
                "type": "number"
              },
              "legend": {
                "additionalProperties": {
                  "type": "string"
                },
                "title": "Legend",
                "type": "object"
              },
              "probabilities": {
                "additionalProperties": {
                  "type": "number"
                },
                "title": "Probabilities",
                "type": "object"
              },
              "confidence": {
                "title": "Confidence",
                "type": "number"
              }
            },
            "required": [
              "score",
              "legend",
              "probabilities",
              "confidence"
            ],
            "title": "ScoreAnswer",
            "type": "object"
          }
        ]
      },
      "title": "Answers",
      "type": "object"
    },
    "usage": {
      "properties": {
        "input_tokens": {
          "title": "Input Tokens",
          "type": "integer"
        },
        "output_tokens": {
          "title": "Output Tokens",
          "type": "integer"
        }
      },
      "required": [
        "input_tokens",
        "output_tokens"
      ],
      "title": "Usage",
      "type": "object"
    }
  },
  "required": [
    "model",
    "answers",
    "usage"
  ],
  "title": "SystemOneResponse",
  "type": "object"
}