LocalAI
App · 6 actions
Run chat, text generation and embeddings on a LocalAI server you control.
Actions
| Action | What it does |
|---|---|
| Chat with a model | Send messages to a model and get a text reply. |
| Create embeddings | Turn a list of text strings into vectors using an embedding model. |
| Generate text | Complete a text prompt using an installed model. |
| Get model configuration metadata | Read descriptions of supported model configuration fields. |
| List installed models | Read the model IDs available on your LocalAI server. |
| List model capabilities | Read which tasks the installed models can handle. |
Chat with a model
Send messages to a model and get a text reply.
Inputs
- Model
modeltextRequired - The installed model to use.
- Messages
messageslistRequired - Messages in conversation order, each with a role and text.
- Temperature
temperaturenumber - How much variation to allow.From 0 to 2.
- Max Tokens
max_tokensnumber - The maximum response length in tokens.At least 1.
Outputs
dataobject- The response from LocalAI.
Example output
{
"data": {
"choices": [
{
"index": 1,
"message": {
"content": "example",
"role": "example"
},
"text": "example"
}
],
"id": "example",
"model": "example",
"usage": {
"completion_tokens": 1,
"prompt_tokens": 1,
"total_tokens": 1
}
}
}Create embeddings
Turn a list of text strings into vectors using an embedding model.
Inputs
- Model
modeltextRequired - The installed model to use.
- Input
inputlistRequired - The text values to encode as vectors.
Outputs
dataobject- The response from LocalAI.
Example output
{
"data": {
"data": [
{
"embedding": [
1
],
"index": 1
}
],
"model": "example"
}
}Generate text
Complete a text prompt using an installed model.
Inputs
- Model
modeltextRequired - The installed model to use.
- Prompt
prompttextRequired - The text to continue.
- Max Tokens
max_tokensnumber - The maximum response length in tokens.At least 1.
Outputs
dataobject- The response from LocalAI.
Example output
{
"data": {
"choices": [
{
"index": 1,
"message": {
"content": "example",
"role": "example"
},
"text": "example"
}
],
"id": "example",
"model": "example",
"usage": {
"completion_tokens": 1,
"prompt_tokens": 1,
"total_tokens": 1
}
}
}Get model configuration metadata
Read descriptions of supported model configuration fields.
Inputs
None.
Outputs
dataobject- The response from LocalAI.
Example output
{
"data": {}
}List installed models
Read the model IDs available on your LocalAI server.
Inputs
None.
Outputs
dataobject- The response from LocalAI.
Example output
{
"data": {
"data": [
{
"id": "example",
"object": "example"
}
],
"object": "example"
}
}List model capabilities
Read which tasks the installed models can handle.
Inputs
None.
Outputs
dataobject- The response from LocalAI.
Example output
{
"data": {}
}