docs/content/integrations.md
+++ disableToc = false title = "Integrations" weight = 19 icon = "sync"
+++
The lists below cover software and community projects that integrate with LocalAI.
Feel free to open up a Pull request (by clicking at the "Edit page" below) to get your project added!
This section provides step-by-step instructions for configuring specific software to work with LocalAI.
OpenCode is an AI-powered code editor that can be configured to use LocalAI as its backend provider.
8080)Edit the OpenCode configuration file
Open the OpenCode configuration file located at ~/.config/opencode/opencode.json in your editor.
Add LocalAI provider configuration
Add the following configuration to your opencode.json file, replacing the values with your own:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"LocalAI": {
"npm": "@ai-sdk/openai-compatible",
"name": "LocalAI (local)",
"options": {
"baseURL": "http://127.0.0.1:8080/v1"
},
"models": {
"Qwen3-Coder-30B-A3B-Instruct-i1-GGUF": {
"name": "Qwen3-Coder-30B-A3B-Instruct-i1-GGUF",
"limit": {
"context": 38000,
"output": 65536
}
},
"qwen_qwen3-30b-a3b-instruct-2507": {
"name": "qwen_qwen3-30b-a3b-instruct-2507",
"limit": {
"context": 38000,
"output": 65536
}
}
}
}
}
}
Customize the configuration
http://127.0.0.1:8080/v1 with your LocalAI server's address and port.context and output token limits based on your model's capabilities and available resources.Verify your models
Ensure that the model names in the configuration match exactly with the model names configured in your LocalAI instance. You can verify available models by checking your LocalAI configuration or using the /v1/models endpoint.
Restart OpenCode
After saving the configuration file, restart OpenCode for the changes to take effect.
Claude Code is Anthropic's official CLI tool for coding with Claude. LocalAI implements the Anthropic Messages API (/v1/messages), so Claude Code can be pointed directly at a LocalAI instance.
8080)Set the ANTHROPIC_BASE_URL and ANTHROPIC_API_KEY environment variables to point Claude Code at your LocalAI server:
ANTHROPIC_BASE_URL=http://127.0.0.1:8080 \
ANTHROPIC_API_KEY=your-localai-api-key \
claude --model your-model-name
For example, if you have a Gemma model loaded:
ANTHROPIC_BASE_URL=http://127.0.0.1:8080 \
ANTHROPIC_API_KEY=your-localai-api-key \
claude --model gemma-4-12B-it-GGUF
You can also run a single prompt non-interactively:
ANTHROPIC_BASE_URL=http://127.0.0.1:8080 \
ANTHROPIC_API_KEY=your-localai-api-key \
claude -p "list the files in /tmp" --model your-model-name
To avoid setting environment variables every time, you can add them to your shell profile (e.g., ~/.bashrc or ~/.zshrc):
export ANTHROPIC_BASE_URL=http://127.0.0.1:8080
export ANTHROPIC_API_KEY=your-localai-api-key
Check which models are available in your LocalAI instance:
curl http://127.0.0.1:8080/v1/models
Use one of the listed model IDs as the --model argument.
You can ask Charm Crush to generate your config by giving it this documentation's URL and your LocalAI instance URL. The configuration will look something like the following and goes in ~/.config/crush/crush.json:
{
"$schema": "https://charm.land/crush.json",
"providers": {
"localai": {
"name": "LocalAI",
"base_url": "http://localai.lan:8081/v1",
"type": "openai-compat",
"models": [
{
"id": "qwen3-coder-480b-a35b-instruct",
"name": "Qwen 3 Coder 480b",
"context_window": 256000
},
{
"id": "qwen3-30b-a3b",
"name": "Qwen 3 30b a3b",
"context_window": 32000
}
]
}
}
}
A list of models can be fetched with https://<server_address>/v1/models by crush itself and appropriate models added to the provider list. Crush does not appear to be optimized for smaller models.
You can use LocalAI in GitHub Actions workflows to perform AI-powered tasks like code review, diff summarization, or automated analysis. The LocalAI GitHub Action makes it easy to spin up a LocalAI instance in your CI/CD pipeline.
This example workflow demonstrates how to use LocalAI to summarize pull request diffs and send notifications:
Create a workflow file
Create a new file in your repository at .github/workflows/localai.yml:
name: Use LocalAI in GHA
on:
pull_request:
types:
- closed
jobs:
notify-discord:
if: ${{ (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'area/ai-model')) }}
env:
MODEL_NAME: qwen_qwen3-4b-instruct-2507
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # needed to checkout all branches for this Action to work
# Starts the LocalAI container
- id: foo
uses: mudler/[email protected]
with:
model: 'qwen_qwen3-4b-instruct-2507' # Any from models.localai.io, or from huggingface.com with: "huggingface://<repository>/file"
# Check the PR diff using the current branch and the base branch of the PR
- uses: GrantBirki/[email protected]
id: git-diff-action
with:
json_diff_file_output: diff.json
raw_diff_file_output: diff.txt
file_output_only: "true"
# Ask to explain the diff to LocalAI
- name: Summarize
env:
DIFF: ${{ steps.git-diff-action.outputs.raw-diff-path }}
id: summarize
run: |
input="$(cat $DIFF)"
# Define the LocalAI API endpoint
API_URL="http://localhost:8080/chat/completions"
# Create a JSON payload using jq to handle special characters
json_payload=$(jq -n --arg input "$input" '{
model: "'$MODEL_NAME'",
messages: [
{
role: "system",
content: "Write a message summarizing the change diffs"
},
{
role: "user",
content: $input
}
]
}')
# Send the request to LocalAI
response=$(curl -s -X POST $API_URL \
-H "Content-Type: application/json" \
-d "$json_payload")
# Extract the summary from the response
summary="$(echo $response | jq -r '.choices[0].message.content')"
# Print the summary
echo "Summary:"
echo "$summary"
echo "payload sent"
echo "$json_payload"
{
echo 'message<<EOF'
echo "$summary"
echo EOF
} >> "$GITHUB_OUTPUT"
# Send the summary somewhere (e.g. Discord)
- name: Discord notification
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }}
DISCORD_USERNAME: "discord-bot"
DISCORD_AVATAR: ""
uses: Ilshidur/action-discord@master
with:
args: ${{ steps.summarize.outputs.message }}
qwen_qwen3-4b-instruct-2507 with any model from models.localai.io. You can also use Hugging Face models by using the full huggingface model url`.if condition to control when the workflow runs. The example only runs when a PR is merged and has a specific label.http://localhost:8080 by default. The action exposes the service on the standard port.LocalAI supports realtime voice interactions , enabling voice assistant applications with real-time speech-to-speech communication. A complete example implementation is available in the LocalAI-examples repository.
The realtime voice assistant example demonstrates how to build a voice assistant that:
Clone the example repository
git clone https://github.com/mudler/LocalAI-examples.git
cd LocalAI-examples/realtime
Start LocalAI with Docker Compose
docker compose up -d
The first time you start docker compose, it will take a while to download the available models. You can follow the model downloads in real-time:
docker logs -f realtime-localai-1
Install host dependencies
Install the required host dependencies (sudo is required):
sudo bash setup.sh
Run the voice assistant
Start the voice assistant application:
bash run.sh