mirror of
https://github.com/mudler/LocalAI.git
synced 2026-08-07 05:43:30 -04:00
Compare commits
6 Commits
dependabot
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8845ccebf7 | ||
|
|
07dfb32bc9 | ||
|
|
1101d72707 | ||
|
|
b5137ad26f | ||
|
|
ee1bf0e25b | ||
|
|
a5ba3577a4 |
@@ -67,7 +67,9 @@ entry (`backend/index.yaml`):
|
||||
|
||||
```yaml
|
||||
- name: localai
|
||||
url: github:mudler/LocalAI/backend/index.yaml@master
|
||||
url: https://index.localai.io/backends
|
||||
mirrors:
|
||||
- github:mudler/LocalAI/backend/index.yaml@master
|
||||
verification:
|
||||
issuer: "https://token.actions.githubusercontent.com"
|
||||
identity_regex: "^https://github\\.com/mudler/LocalAI/\\.github/workflows/backend_merge\\.yml@refs/(heads/master|tags/.+)$"
|
||||
|
||||
@@ -198,7 +198,7 @@ Two properties this relies on:
|
||||
|
||||
The same reasoning applies to master pushes, and the volume is larger there: on 2026-07-30, **12 of the 23 queued `image.yml` runs** were commits like "add 1 new model to gallery" or a docs fix, each rebuilding all 18 container images.
|
||||
|
||||
`image.yml` now has a `changes` job that decides once whether the push can affect any image; the other 11 jobs carry `needs: changes` plus an `if:` on its output. Verified against the shipped `Dockerfile`: the final stage copies only `entrypoint.sh`, `healthcheck.sh` and the `local-ai` binary, there is no `go:embed` of `gallery/` or `docs/`, and the gallery is fetched at runtime from `github:mudler/LocalAI/gallery/index.yaml@master`. A gallery-only commit therefore produces byte-identical images, and the gallery change reaches users through GitHub immediately whether or not an image is rebuilt.
|
||||
`image.yml` now has a `changes` job that decides once whether the push can affect any image; the other 11 jobs carry `needs: changes` plus an `if:` on its output. Verified against the shipped `Dockerfile`: the final stage copies only `entrypoint.sh`, `healthcheck.sh` and the `local-ai` binary, there is no `go:embed` of `gallery/` or `docs/`, and the gallery is fetched at runtime from `https://index.localai.io/models` (a caching mirror of `gallery/index.yaml` on master, with `github:mudler/LocalAI/gallery/index.yaml@master` as the fallback mirror). A gallery-only commit therefore produces byte-identical images, and the gallery change reaches users over the network immediately whether or not an image is rebuilt.
|
||||
|
||||
Two properties to preserve if you touch it:
|
||||
|
||||
|
||||
2
.github/workflows/refresh-site-counters.yml
vendored
2
.github/workflows/refresh-site-counters.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
refresh:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/checkout@v7
|
||||
|
||||
- name: Read the counts off the GitHub API
|
||||
env:
|
||||
|
||||
2
.github/workflows/stalebot.yml
vendored
2
.github/workflows/stalebot.yml
vendored
@@ -11,7 +11,7 @@ jobs:
|
||||
if: github.repository == 'mudler/LocalAI'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/stale@1e223db275d687790206a7acac4d1a11bd6fe629 # v9
|
||||
- uses: actions/stale@4391f3da665fdf50b6810c1a66712fb9ba21aa93 # v9
|
||||
with:
|
||||
stale-issue-message: 'This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
|
||||
stale-pr-message: 'This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 10 days.'
|
||||
|
||||
@@ -9,4 +9,4 @@
|
||||
# memory architecture crash deterministically with an empty "Engine core init
|
||||
# failed" set (mudler/LocalAI#10722). Leaving this unpinned let the L4T image
|
||||
# drift onto whatever wheel was latest at build time.
|
||||
vllm==0.26.0
|
||||
vllm==0.25.1
|
||||
|
||||
@@ -12,8 +12,13 @@ import (
|
||||
// the "${galleries}" / "${backends}" vars, and DefaultRuntimeBaseline uses
|
||||
// them to tell "kong default" apart from "user-configured" at settings-load
|
||||
// time - they must stay the single source for both.
|
||||
const DefaultGalleriesJSON = `[{"name":"localai", "url":"github:mudler/LocalAI/gallery/index.yaml@master"}]`
|
||||
const DefaultBackendGalleriesJSON = `[{"name":"localai", "url":"github:mudler/LocalAI/backend/index.yaml@master"}]`
|
||||
//
|
||||
// The primary is served by index-server (github.com/localai-org/index-server),
|
||||
// a caching mirror of the files below. The GitHub URI stays as a mirror so an
|
||||
// install still resolves its gallery unchanged whenever the primary is
|
||||
// unreachable - see the fallback chain in core/gallery/gallery_mirrors.go.
|
||||
const DefaultGalleriesJSON = `[{"name":"localai", "url":"https://index.localai.io/models", "mirrors":["github:mudler/LocalAI/gallery/index.yaml@master"]}]`
|
||||
const DefaultBackendGalleriesJSON = `[{"name":"localai", "url":"https://index.localai.io/backends", "mirrors":["github:mudler/LocalAI/backend/index.yaml@master"]}]`
|
||||
|
||||
func mustGalleries(jsonList string) []Gallery {
|
||||
var g []Gallery
|
||||
|
||||
83
core/config/runtime_settings_startup_test.go
Normal file
83
core/config/runtime_settings_startup_test.go
Normal file
@@ -0,0 +1,83 @@
|
||||
package config_test
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
|
||||
"github.com/mudler/LocalAI/core/config"
|
||||
|
||||
. "github.com/onsi/ginkgo/v2"
|
||||
. "github.com/onsi/gomega"
|
||||
)
|
||||
|
||||
var _ = Describe("default galleries", func() {
|
||||
It("serves the model gallery from index.localai.io with GitHub as a mirror", func() {
|
||||
var galleries []config.Gallery
|
||||
Expect(json.Unmarshal([]byte(config.DefaultGalleriesJSON), &galleries)).To(Succeed())
|
||||
Expect(galleries).To(HaveLen(1))
|
||||
Expect(galleries[0].Name).To(Equal("localai"))
|
||||
Expect(galleries[0].URL).To(Equal("https://index.localai.io/models"))
|
||||
Expect(galleries[0].Mirrors).To(Equal([]string{"github:mudler/LocalAI/gallery/index.yaml@master"}))
|
||||
})
|
||||
|
||||
It("serves the backend gallery from index.localai.io with GitHub as a mirror", func() {
|
||||
var galleries []config.Gallery
|
||||
Expect(json.Unmarshal([]byte(config.DefaultBackendGalleriesJSON), &galleries)).To(Succeed())
|
||||
Expect(galleries).To(HaveLen(1))
|
||||
Expect(galleries[0].Name).To(Equal("localai"))
|
||||
Expect(galleries[0].URL).To(Equal("https://index.localai.io/backends"))
|
||||
Expect(galleries[0].Mirrors).To(Equal([]string{"github:mudler/LocalAI/backend/index.yaml@master"}))
|
||||
})
|
||||
|
||||
// The mirror is the whole reason this default is safe to ship: if
|
||||
// index.localai.io is unreachable, an install must still resolve its
|
||||
// gallery from GitHub exactly as it did before.
|
||||
It("always leaves a reachable fallback behind the primary", func() {
|
||||
for _, raw := range []string{config.DefaultGalleriesJSON, config.DefaultBackendGalleriesJSON} {
|
||||
var galleries []config.Gallery
|
||||
Expect(json.Unmarshal([]byte(raw), &galleries)).To(Succeed())
|
||||
for _, g := range galleries {
|
||||
Expect(g.Mirrors).ToNot(BeEmpty(), "default %q has no mirror", g.Name)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// mustGalleries panics on malformed JSON, and these constants are also
|
||||
// fed to kong as defaults, so a typo would be a startup crash rather
|
||||
// than a config error.
|
||||
It("parses through the same path startup uses", func() {
|
||||
baseline := config.DefaultRuntimeBaseline()
|
||||
Expect(baseline.Galleries).To(HaveLen(1))
|
||||
Expect(baseline.BackendGalleries).To(HaveLen(1))
|
||||
Expect(baseline.Galleries[0].URL).To(Equal("https://index.localai.io/models"))
|
||||
Expect(baseline.BackendGalleries[0].URL).To(Equal("https://index.localai.io/backends"))
|
||||
})
|
||||
|
||||
// The baseline decides "kong default" vs "user-configured", and since
|
||||
// the defaults grew a Mirrors slice that comparison runs through
|
||||
// GalleriesEqual rather than ==. A default install must still let the
|
||||
// persisted file apply, and any override - including one that differs
|
||||
// from the default only by its mirrors - must still be seen as env-set.
|
||||
Context("as the option-less startup baseline", func() {
|
||||
It("treats an untouched default list as not env-set, so the file applies", func() {
|
||||
o := config.DefaultRuntimeBaseline()
|
||||
saved := []config.Gallery{{Name: "mine", URL: "https://example.com/index.yaml"}}
|
||||
savedBackends := []config.Gallery{{Name: "mine-backends", URL: "https://example.com/backends.yaml"}}
|
||||
o.ApplyRuntimeSettingsAtStartup(&config.RuntimeSettings{
|
||||
Galleries: &saved,
|
||||
BackendGalleries: &savedBackends,
|
||||
})
|
||||
Expect(o.Galleries).To(Equal(saved))
|
||||
Expect(o.BackendGalleries).To(Equal(savedBackends))
|
||||
})
|
||||
|
||||
It("treats LOCALAI_GALLERIES as env-set even when it only drops the mirror", func() {
|
||||
o := config.DefaultRuntimeBaseline()
|
||||
// Same primary as the default, mirror removed: env-set.
|
||||
o.Galleries = []config.Gallery{{Name: "localai", URL: "https://index.localai.io/models"}}
|
||||
saved := []config.Gallery{{Name: "file", URL: "https://file.example/index.yaml"}}
|
||||
o.ApplyRuntimeSettingsAtStartup(&config.RuntimeSettings{Galleries: &saved})
|
||||
Expect(o.Galleries[0].Name).To(Equal("localai"),
|
||||
"an env list differing only by mirrors must still win over the file")
|
||||
})
|
||||
})
|
||||
})
|
||||
@@ -79,7 +79,7 @@ they provide. Add a `verification` policy to the gallery configuration, then
|
||||
enable strict integrity mode:
|
||||
|
||||
```bash
|
||||
export LOCALAI_BACKEND_GALLERIES='[{"name":"localai","url":"github:mudler/LocalAI/backend/index.yaml@master","verification":{"issuer":"https://token.actions.githubusercontent.com","identity_regex":"^https://github\\.com/mudler/LocalAI/\\.github/workflows/backend_merge\\.yml@refs/(heads/master|tags/.+)$"}}]'
|
||||
export LOCALAI_BACKEND_GALLERIES='[{"name":"localai","url":"https://index.localai.io/backends","mirrors":["github:mudler/LocalAI/backend/index.yaml@master"],"verification":{"issuer":"https://token.actions.githubusercontent.com","identity_regex":"^https://github\\.com/mudler/LocalAI/\\.github/workflows/backend_merge\\.yml@refs/(heads/master|tags/.+)$"}}]'
|
||||
export LOCALAI_REQUIRE_BACKEND_INTEGRITY=1
|
||||
local-ai run
|
||||
```
|
||||
|
||||
@@ -100,13 +100,13 @@ To use additional repositories you need to start `local-ai` with the `GALLERIES`
|
||||
GALLERIES=[{"name":"<GALLERY_NAME>", "url":"<GALLERY_URL"}]
|
||||
```
|
||||
|
||||
For example, to enable the default `localai` repository, you can start `local-ai` with:
|
||||
For example, to spell out the default `localai` repository, you can start `local-ai` with:
|
||||
|
||||
```
|
||||
GALLERIES=[{"name":"localai", "url":"github:mudler/localai/gallery/index.yaml"}]
|
||||
GALLERIES=[{"name":"localai", "url":"https://index.localai.io/models", "mirrors":["github:mudler/LocalAI/gallery/index.yaml@master"]}]
|
||||
```
|
||||
|
||||
where `github:mudler/localai/gallery/index.yaml` will be expanded automatically to `https://raw.githubusercontent.com/mudler/LocalAI/main/index.yaml`.
|
||||
`https://index.localai.io/models` is a caching mirror of the same index file, and the `github:` entry is the fallback used whenever it cannot be reached. `github:mudler/LocalAI/gallery/index.yaml@master` is expanded automatically to `https://raw.githubusercontent.com/mudler/LocalAI/master/gallery/index.yaml`.
|
||||
|
||||
Note: the url are expanded automatically for `github` and `huggingface`, however `https://` and `http://` prefix works as well.
|
||||
|
||||
|
||||
@@ -148,13 +148,15 @@ The `runtime_settings.json` file follows this structure:
|
||||
"federated": false,
|
||||
"galleries": [
|
||||
{
|
||||
"url": "github:mudler/LocalAI/gallery/index.yaml@master",
|
||||
"url": "https://index.localai.io/models",
|
||||
"mirrors": ["github:mudler/LocalAI/gallery/index.yaml@master"],
|
||||
"name": "localai"
|
||||
}
|
||||
],
|
||||
"backend_galleries": [
|
||||
{
|
||||
"url": "github:mudler/LocalAI/backend/index.yaml@master",
|
||||
"url": "https://index.localai.io/backends",
|
||||
"mirrors": ["github:mudler/LocalAI/backend/index.yaml@master"],
|
||||
"name": "localai"
|
||||
}
|
||||
],
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
{
|
||||
"version": "v4.8.0"
|
||||
"version": "v4.8.1"
|
||||
}
|
||||
|
||||
@@ -2089,7 +2089,7 @@
|
||||
files:
|
||||
- filename: ds4flash.gguf
|
||||
uri: https://huggingface.co/unsloth/DeepSeek-V4-Flash-GGUF
|
||||
sha256: ea3dc48cb9797ea1bfaa8a74d8a819756b06b16e8fbaa30728ad2cd0a643c605
|
||||
sha256: a9aadd5a1921708c97aecaf29e6b3d5c0aa252aadc3b706d1281f68361bd52b9
|
||||
- name: "qwopus3.6-35b-a3b-coder-mtp"
|
||||
url: "github:mudler/LocalAI/gallery/virtual.yaml@master"
|
||||
urls:
|
||||
@@ -40618,7 +40618,7 @@
|
||||
files:
|
||||
- filename: cohere-transcribe-q4_k.gguf
|
||||
uri: huggingface://cstr/cohere-transcribe-03-2026-GGUF/cohere-transcribe-q4_k.gguf
|
||||
sha256: 2931fc0ac6d6708eef5389aadf1ebd5eec7b8e764bac385be585e910c0e7b410
|
||||
sha256: 237261c543dc9124a3f08f95b48c9c672896ef0d79dc8cadce3fb4ddc09a2ef8
|
||||
- name: wav2vec2-crispasr
|
||||
url: github:mudler/LocalAI/gallery/virtual.yaml@master
|
||||
urls:
|
||||
|
||||
@@ -3822,6 +3822,13 @@ const docTemplate = `{
|
||||
"config.Gallery": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"mirrors": {
|
||||
"description": "Mirrors are tried in order when URL cannot be fetched. They are a\nfallback for availability, not a load-balancing pool: the primary is\nalways preferred, and a mirror is only consulted after the one before\nit fails. Any URI the gallery loader understands works here\n(https://, github:, file://).",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
@@ -3819,6 +3819,13 @@
|
||||
"config.Gallery": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"mirrors": {
|
||||
"description": "Mirrors are tried in order when URL cannot be fetched. They are a\nfallback for availability, not a load-balancing pool: the primary is\nalways preferred, and a mirror is only consulted after the one before\nit fails. Any URI the gallery loader understands works here\n(https://, github:, file://).",
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"name": {
|
||||
"type": "string"
|
||||
},
|
||||
|
||||
@@ -2,6 +2,16 @@ basePath: /
|
||||
definitions:
|
||||
config.Gallery:
|
||||
properties:
|
||||
mirrors:
|
||||
description: |-
|
||||
Mirrors are tried in order when URL cannot be fetched. They are a
|
||||
fallback for availability, not a load-balancing pool: the primary is
|
||||
always preferred, and a mirror is only consulted after the one before
|
||||
it fails. Any URI the gallery loader understands works here
|
||||
(https://, github:, file://).
|
||||
items:
|
||||
type: string
|
||||
type: array
|
||||
name:
|
||||
type: string
|
||||
url:
|
||||
|
||||
Reference in New Issue
Block a user