mirror of
https://github.com/mudler/LocalAI.git
synced 2026-11-01 18:19:50 -05:00
Add the add-on runtime to LocalAI: manifests, the host operation broker, admin gating by account role, the add-on UI bundle builder and the SDK for add-on pages. Move the navigation to Chat, Models, Add-ons and Settings, with pinned add-ons in the sidebar and an Add-ons drawer. Ship the first-party add-ons (voice, face, fine-tuning, quantization) as packages for linux/amd64, linux/arm64 and darwin/arm64. Intel macOS (darwin/amd64) is enabled in the platform files. Squashed from the review branch. The tree is unchanged; the pre-squash history is kept on a local backup branch. Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
22 lines
569 B
Go
22 lines
569 B
Go
// SPDX-License-Identifier: MIT
|
|
package protocol
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/mudler/LocalAI/pkg/addons/contract"
|
|
)
|
|
|
|
func TestRunRefusesWithoutTheProtocolFlagAndBuildsNoRuntime(t *testing.T) {
|
|
built := false
|
|
factory := func(Startup) contract.Runtime { built = true; return nil }
|
|
for _, args := range [][]string{{"x"}, {"x", "--other"}, {"x", "--localai-addon-v1", "extra"}} {
|
|
if got := Run(args, factory); got != 2 {
|
|
t.Fatalf("%v: exit code %d, want 2", args, got)
|
|
}
|
|
}
|
|
if built {
|
|
t.Fatal("the factory ran before the protocol flag was checked")
|
|
}
|
|
}
|