Embeddings
Embed any text with Solar Embeddings API.
The embeddings API converts text into numbers that computers can understand. Imagine converting a sentence into a list of numbers, each capturing a piece of the sentence's meaning. This makes it easier for machines to do tasks like finding similar texts, sorting information, or even answering questions.
Solar Embeddings API features dual models, solar-embedding-1-large-query
for user queries and solar-embedding-1-large-passage
for document embedding, within a unified vector space, designed to enhance text processing tasks with a focus on performance.
For developers building search engines or retrieval systems, solar-embedding-1-large-passage
is ideal for initially embedding the searchable content. Upon user query submission, leveraging solar-embedding-1-large-query
facilitates efficient and accurate matching of queries with the embedded content, thereby optimizing the information retrieval process.
Available models
Model | Release date | Context Length | Description |
---|---|---|---|
solar-embedding-1-large-querybeta | 2024-05-10 | 4000 | Solar-based Query Embedding model with a 4k context limit. This model is optimized for embedding user's question in information-seeking tasks such as retrieval & reranking. |
solar-embedding-1-large-passagebeta | 2024-05-10 | 4000 | Solar-based Passage Embedding model with a 4k context limit. This model is optimized for embedding documents or texts to be searched. |
Request
POST https://api.upstage.ai/v1/solar/embeddings
Parameters
Request headers
Authorization string Required |
Request body
model string Required |
input string or array Required
|
Response
A list of embedding objects.
The embedding object
Represents an embedding vector returned by the embeddings API endpoint.
index integer |
embedding array |
object string |
Additional information
model string |
usage object |
usage.prompt_tokens integer |
usage.total_tokens integer |
Example
Request
curl --location 'https://api.upstage.ai/v1/solar/embeddings' \
--header 'Authorization: Bearer UPSTAGE_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"model": "solar-embedding-1-large-query",
"input": "What makes Solar LLM small yet effective?"
}'
Response
Success - HTTP Status 200 OK - Single input response
{
"object": "list",
"data": [
{
"object": "embedding",
"index": 0,
"embedding": [
0.01850688,
-0.0066606696,
...
0.009938696,
0.006452979
]
}
],
"model": "solar-embedding-1-large-query",
"usage": {
"prompt_tokens": 21,
"total_tokens": 21
}
}