Summarization
This API is no longer maintained and will soon be deprecated. The end of service is 10 May 2024.
Generates concise summaries of provided texts in a variety of formats to improve understanding and practical use. Designed for ease and adaptability, the Summarization API allows developers to seamlessly incorporate sophisticated text summarization features into their applications. This ensures that users can effortlessly capture the core insights of extensive texts, facilitating a quicker and more effective understanding.
Available models
Model | Release date | Context Length | Description |
---|---|---|---|
solar-1-mini-summarization | 2024-03-12 beta | 16384 | Solar-based Summarization model with a 16k context limit. |
Request
POST https://api.upstage.ai/v1/solar/chat/completions
Parameters
The messages
parameter is a list of message objects. In the context of the Summarization API, you will send only one message object for the text to be summarized. This message object’s role
must be "user," and its content
must exceed 250 characters.
The Summarization API will determine the most suitable format for the summarization result based on the input content. However, users have the option to select the length and format of their summarization result.
Currently, the solar-1-mini-summarization model supports a context limit of 16,384 tokens.
Request headers
Authorization string Required |
Request body
messages list Required |
messages[].role string Required |
messages[].content string Required |
model string Required Current available model name is |
format string Optional |
length string Optional |
temperature float Optional |
Response
Return values
Returns a chat.completion
object.
The chat completion object
id string |
object string |
created integer |
model string |
choices list |
choices[].finish_reason string |
choices[].index integer |
choices[].message object |
choices[].message.content string |
choices[].message.role string |
choices[].logprobs null |
usage object |
usage.completion_tokens integer |
usage.prompt_tokens integer |
usage.total_tokens integer |
system_fingerprint null |
Example
Request
curl --location 'https://api.upstage.ai/v1/solar/chat/completions' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "solar-1-mini-summarization",
"messages": [
{
"role": "user",
"content": "(Blog post) Introducing Solar Mini : Powerful, Purpose-trained LLM. Welcome to the era of Solar, a pre-trained Large Language Model (LLM) from Upstage. In December 2023, Solar Mini made waves by reaching the pinnacle of the Open LLM Leaderboard of Hugging Face. Using notably fewer parameters, Solar Mini delivers responses comparable to GPT-3.5, but is 2.5 times faster. Let me guide you through how Solar Mini revolutionized the downsizing of LLM models without sacrificing its performance. - Looking into the model :Why we need Smaller LLMs Size became a pivotal factor in integrating Large Language Models (LLMs) into real-world applications. The main advantage of smaller models is their reduced computational time, which boosts responsiveness and efficiency. This translates to lower manpower requirements for optimization, as these LLMs are more straightforward to customize for specific domains and services. Additionally, their compact size enables on-device deployment, facilitating a decentralized approach that brings AI capabilities directly to the user'\''s local device. This not only enhances accessibility but also diminishes the dependence on extensive GPU resources, paving the way for more new and affordable AI solutions. - Compact Size, Mighty Performance Solar Mini is proof that you don'\''t need a large size for exceptional performance. It impressively outshined competitors like Llama2, Mistral 7B, Ko-Alpaca, and KULLM in a range of benchmarks."
}
],
"format": "bullets",
"temperature": 0,
"length": "auto"
}'
Response
Success - HTTP Status 200 OK
{
"id": "998685e8-58e1-43aa-acde-098118365af5",
"object": "chat.completion",
"created": 1710337925,
"model": "solar-1-mini-summarization",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "* Solar Mini is a powerful, purpose-trained LLM from Upstage.\n* It reached the top of the Open LLM Leaderboard in December 2023.\n* Solar Mini uses fewer parameters than GPT-3.5 but delivers comparable responses and is 2.5 times faster.\n* Smaller models like Solar Mini have reduced computational time, resulting in increased responsiveness and efficiency.\n* They are easier to customize for specific domains and services and can be deployed on local devices, enhancing accessibility and reducing dependence on GPU resources."
},
"logprobs": null,
"finish_reason": "stop"
}
],
"usage": {
"prompt_tokens": 500,
"completion_tokens": 120,
"total_tokens": 620
},
"system_fingerprint": ""
}
Error - HTTP Status : 400 Bad Request (Reason : content length)
{
"error": {
"message": "content must be at least 250 characters. content length provided: 227",
"type": "invalid_request_error",
"param": null,
"code": null
}
}
Error - HTTP Status : 400 Bad Request (Reason : exceed maximum token)
{
"error": {
"message": "summarization could not be completed due to a token limit. please provide a shorter input. prompt tokens: 15977, completion tokens: 408, total tokens: 16385",
"type": "invalid_request_error",
"param": null,
"code": null
}
}