Baraaqasem commited on
Commit
700a3cf
1 Parent(s): 651d019

Upload 71 files

Browse files
This view is limited to 50 files because it contains too many changes.   See raw diff
Files changed (50) hide show
  1. .bruno/LocalAI Test Requests/Sound Generation/musicgen.bru +23 -0
  2. .bruno/LocalAI Test Requests/backend monitor/backend monitor.bru +17 -0
  3. .bruno/LocalAI Test Requests/backend monitor/backend-shutdown.bru +21 -0
  4. .bruno/LocalAI Test Requests/bruno.json +5 -0
  5. .bruno/LocalAI Test Requests/environments/localhost.bru +6 -0
  6. .bruno/LocalAI Test Requests/get models list.bru +11 -0
  7. .bruno/LocalAI Test Requests/image generation/Generate image.bru +25 -0
  8. .bruno/LocalAI Test Requests/llm text/-completions.bru +24 -0
  9. .bruno/LocalAI Test Requests/llm text/-edits.bru +23 -0
  10. .bruno/LocalAI Test Requests/llm text/-embeddings.bru +22 -0
  11. .bruno/LocalAI Test Requests/llm text/chat/chat completion -simple- 1 message-.bru +30 -0
  12. .bruno/LocalAI Test Requests/llm text/chat/chat-completions -long-.bru +29 -0
  13. .bruno/LocalAI Test Requests/llm text/chat/chat-completions -stream-.bru +25 -0
  14. .bruno/LocalAI Test Requests/model gallery/add model gallery.bru +22 -0
  15. .bruno/LocalAI Test Requests/model gallery/delete model gallery.bru +21 -0
  16. .bruno/LocalAI Test Requests/model gallery/list MODELS in galleries.bru +11 -0
  17. .bruno/LocalAI Test Requests/model gallery/list model GALLERIES.bru +11 -0
  18. .bruno/LocalAI Test Requests/model gallery/model delete.bru +11 -0
  19. .bruno/LocalAI Test Requests/model gallery/model gallery apply -gist-.bru +21 -0
  20. .bruno/LocalAI Test Requests/model gallery/model gallery apply.bru +22 -0
  21. .bruno/LocalAI Test Requests/transcription/gb1.ogg +3 -0
  22. .bruno/LocalAI Test Requests/transcription/transcribe.bru +16 -0
  23. .bruno/LocalAI Test Requests/tts/-tts.bru +22 -0
  24. .bruno/LocalAI Test Requests/tts/musicgen.bru +23 -0
  25. .devcontainer-scripts/postcreate.sh +17 -0
  26. .devcontainer-scripts/poststart.sh +16 -0
  27. .devcontainer-scripts/utils.sh +55 -0
  28. .devcontainer/customization/README.md +25 -0
  29. .devcontainer/devcontainer.json +24 -0
  30. .devcontainer/docker-compose-devcontainer.yml +48 -0
  31. .devcontainer/grafana/datasource.yml +10 -0
  32. .devcontainer/prometheus/prometheus.yml +21 -0
  33. .gitattributes +1 -0
  34. .github/FUNDING.yml +5 -0
  35. .github/ISSUE_TEMPLATE/bug_report.md +29 -0
  36. .github/ISSUE_TEMPLATE/config.yml +8 -0
  37. .github/ISSUE_TEMPLATE/feature_request.md +20 -0
  38. .github/PULL_REQUEST_TEMPLATE.md +31 -0
  39. .github/bump_deps.sh +22 -0
  40. .github/bump_docs.sh +7 -0
  41. .github/check_and_update.py +85 -0
  42. .github/checksum_checker.sh +63 -0
  43. .github/ci/modelslist.go +304 -0
  44. .github/dependabot.yml +135 -0
  45. .github/labeler.yml +24 -0
  46. .github/release.yml +37 -0
  47. .github/stale.yml +18 -0
  48. .github/workflows/bump_deps.yaml +70 -0
  49. .github/workflows/bump_docs.yaml +31 -0
  50. .github/workflows/checksum_checker.yaml +47 -0
.bruno/LocalAI Test Requests/Sound Generation/musicgen.bru ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ meta {
2
+ name: musicgen
3
+ type: http
4
+ seq: 1
5
+ }
6
+
7
+ post {
8
+ url: {{PROTOCOL}}{{HOST}}:{{PORT}}/v1/sound-generation
9
+ body: json
10
+ auth: none
11
+ }
12
+
13
+ headers {
14
+ Content-Type: application/json
15
+ }
16
+
17
+ body:json {
18
+ {
19
+ "model_id": "facebook/musicgen-small",
20
+ "text": "Exciting 80s Newscast Interstitial",
21
+ "duration_seconds": 8
22
+ }
23
+ }
.bruno/LocalAI Test Requests/backend monitor/backend monitor.bru ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ meta {
2
+ name: backend monitor
3
+ type: http
4
+ seq: 4
5
+ }
6
+
7
+ get {
8
+ url: {{PROTOCOL}}{{HOST}}:{{PORT}}/backend/monitor
9
+ body: json
10
+ auth: none
11
+ }
12
+
13
+ body:json {
14
+ {
15
+ "model": "{{DEFAULT_MODEL}}"
16
+ }
17
+ }
.bruno/LocalAI Test Requests/backend monitor/backend-shutdown.bru ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ meta {
2
+ name: backend-shutdown
3
+ type: http
4
+ seq: 3
5
+ }
6
+
7
+ post {
8
+ url: {{PROTOCOL}}{{HOST}}:{{PORT}}/backend/shutdown
9
+ body: json
10
+ auth: none
11
+ }
12
+
13
+ headers {
14
+ Content-Type: application/json
15
+ }
16
+
17
+ body:json {
18
+ {
19
+ "model": "{{DEFAULT_MODEL}}"
20
+ }
21
+ }
.bruno/LocalAI Test Requests/bruno.json ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ {
2
+ "version": "1",
3
+ "name": "LocalAI Test Requests",
4
+ "type": "collection"
5
+ }
.bruno/LocalAI Test Requests/environments/localhost.bru ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ vars {
2
+ HOST: localhost
3
+ PORT: 8080
4
+ DEFAULT_MODEL: gpt-3.5-turbo
5
+ PROTOCOL: http://
6
+ }
.bruno/LocalAI Test Requests/get models list.bru ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ meta {
2
+ name: get models list
3
+ type: http
4
+ seq: 2
5
+ }
6
+
7
+ get {
8
+ url: {{PROTOCOL}}{{HOST}}:{{PORT}}/models
9
+ body: none
10
+ auth: none
11
+ }
.bruno/LocalAI Test Requests/image generation/Generate image.bru ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ meta {
2
+ name: Generate image
3
+ type: http
4
+ seq: 1
5
+ }
6
+
7
+ post {
8
+ url: {{PROTOCOL}}{{HOST}}:{{PORT}}/v1/images/generations
9
+ body: json
10
+ auth: none
11
+ }
12
+
13
+ headers {
14
+ Content-Type: application/json
15
+ }
16
+
17
+ body:json {
18
+ {
19
+ "prompt": "<positive prompt>|<negative prompt>",
20
+ "model": "model-name",
21
+ "step": 51,
22
+ "size": "1024x1024",
23
+ "image": ""
24
+ }
25
+ }
.bruno/LocalAI Test Requests/llm text/-completions.bru ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ meta {
2
+ name: -completions
3
+ type: http
4
+ seq: 4
5
+ }
6
+
7
+ post {
8
+ url: {{PROTOCOL}}{{HOST}}:{{PORT}}/completions
9
+ body: json
10
+ auth: none
11
+ }
12
+
13
+ headers {
14
+ Content-Type: application/json
15
+ }
16
+
17
+ body:json {
18
+ {
19
+ "model": "{{DEFAULT_MODEL}}",
20
+ "prompt": "function downloadFile(string url, string outputPath) {",
21
+ "max_tokens": 256,
22
+ "temperature": 0.5
23
+ }
24
+ }
.bruno/LocalAI Test Requests/llm text/-edits.bru ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ meta {
2
+ name: -edits
3
+ type: http
4
+ seq: 5
5
+ }
6
+
7
+ post {
8
+ url: {{PROTOCOL}}{{HOST}}:{{PORT}}/edits
9
+ body: json
10
+ auth: none
11
+ }
12
+
13
+ headers {
14
+ Content-Type: application/json
15
+ }
16
+
17
+ body:json {
18
+ {
19
+ "model": "{{DEFAULT_MODEL}}",
20
+ "input": "What day of the wek is it?",
21
+ "instruction": "Fix the spelling mistakes"
22
+ }
23
+ }
.bruno/LocalAI Test Requests/llm text/-embeddings.bru ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ meta {
2
+ name: -embeddings
3
+ type: http
4
+ seq: 6
5
+ }
6
+
7
+ post {
8
+ url: {{PROTOCOL}}{{HOST}}:{{PORT}}/embeddings
9
+ body: json
10
+ auth: none
11
+ }
12
+
13
+ headers {
14
+ Content-Type: application/json
15
+ }
16
+
17
+ body:json {
18
+ {
19
+ "model": "{{DEFAULT_MODEL}}",
20
+ "input": "A STRANGE GAME.\nTHE ONLY WINNING MOVE IS NOT TO PLAY.\n\nHOW ABOUT A NICE GAME OF CHESS?"
21
+ }
22
+ }
.bruno/LocalAI Test Requests/llm text/chat/chat completion -simple- 1 message-.bru ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ meta {
2
+ name: chat completion -simple- 1 message-
3
+ type: http
4
+ seq: 4
5
+ }
6
+
7
+ post {
8
+ url: {{PROTOCOL}}{{HOST}}:{{PORT}}/chat/completions
9
+ body: json
10
+ auth: none
11
+ }
12
+
13
+ headers {
14
+ Content-Type: application/json
15
+ }
16
+
17
+ body:json {
18
+ {
19
+ "model": "{{DEFAULT_MODEL}}",
20
+ "messages": [
21
+ {
22
+ "role": "user",
23
+ "content": "How could one use friction to cook an egg?"
24
+ }
25
+ ],
26
+ "max_tokens": 256,
27
+ "temperature": 0.2,
28
+ "grammar": ""
29
+ }
30
+ }
.bruno/LocalAI Test Requests/llm text/chat/chat-completions -long-.bru ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ meta {
2
+ name: chat-completions -long-
3
+ type: http
4
+ seq: 5
5
+ }
6
+
7
+ post {
8
+ url: {{PROTOCOL}}{{HOST}}:{{PORT}}/chat/completions
9
+ body: json
10
+ auth: none
11
+ }
12
+
13
+ headers {
14
+ Content-Type: application/json
15
+ }
16
+
17
+ body:json {
18
+ {
19
+ "model": "{{DEFAULT_MODEL}}",
20
+ "messages": [{"role": "system", "content": "You are a helpful, intelligent pirate assistant. Always answer as helpfully as possible, while being a pirate and using pirate language. If a question does not make any sense, or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information."},
21
+ {"role": "user", "content": "How could one use electricity to cook an egg?"},
22
+ {"role": "assistant",
23
+ "content": "Shiver me timbers! Using electricity to cook an egg? Well, matey, I reckon that be a right curious idea! *adjusts spectacles* Now, I ain't sure if this be possible, but I'll do me best to help ye out.\n\nFirst things first, ye gotta understand that electricity be a powerful force, and it can't just cook an egg on its own. Ye see, electricity be like a mighty wind that can make things happen, but it needs somethin' to work with. So, if ye want to use electricity to cook an egg, ye gotta find a way to harness that power and make it do the cookin'.\n\nNow, I know what ye might be thinkin': \"How do I harness the power of electricity to cook an egg?\" Well, matey, there be a few ways to do it. One way be to use a special device called an \"electric frying pan.\" This be a pan that has a built-in heating element that gets hot when ye plug it into a wall socket. When the element gets hot, ye can crack an egg into the pan and watch as it cook"
24
+ },
25
+ {"role": "user", "content": "I don't have one of those, just a raw wire and plenty of power! How do we get it done?"}],
26
+ "max_tokens": 1024,
27
+ "temperature": 0.5
28
+ }
29
+ }
.bruno/LocalAI Test Requests/llm text/chat/chat-completions -stream-.bru ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ meta {
2
+ name: chat-completions -stream-
3
+ type: http
4
+ seq: 6
5
+ }
6
+
7
+ post {
8
+ url: {{PROTOCOL}}{{HOST}}:{{PORT}}/chat/completions
9
+ body: json
10
+ auth: none
11
+ }
12
+
13
+ headers {
14
+ Content-Type: application/json
15
+ }
16
+
17
+ body:json {
18
+ {
19
+ "model": "{{DEFAULT_MODEL}}",
20
+ "messages": [{"role": "user", "content": "Explain how I can set sail on the ocean using only power generated by seagulls?"}],
21
+ "max_tokens": 256,
22
+ "temperature": 0.9,
23
+ "stream": true
24
+ }
25
+ }
.bruno/LocalAI Test Requests/model gallery/add model gallery.bru ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ meta {
2
+ name: add model gallery
3
+ type: http
4
+ seq: 10
5
+ }
6
+
7
+ post {
8
+ url: {{PROTOCOL}}{{HOST}}:{{PORT}}/models/galleries
9
+ body: json
10
+ auth: none
11
+ }
12
+
13
+ headers {
14
+ Content-Type: application/json
15
+ }
16
+
17
+ body:json {
18
+ {
19
+ "url": "file:///home/dave/projects/model-gallery/huggingface/TheBloke__CodeLlama-7B-Instruct-GGML.yaml",
20
+ "name": "test"
21
+ }
22
+ }
.bruno/LocalAI Test Requests/model gallery/delete model gallery.bru ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ meta {
2
+ name: delete model gallery
3
+ type: http
4
+ seq: 11
5
+ }
6
+
7
+ delete {
8
+ url: {{PROTOCOL}}{{HOST}}:{{PORT}}/models/galleries
9
+ body: json
10
+ auth: none
11
+ }
12
+
13
+ headers {
14
+ Content-Type: application/json
15
+ }
16
+
17
+ body:json {
18
+ {
19
+ "name": "test"
20
+ }
21
+ }
.bruno/LocalAI Test Requests/model gallery/list MODELS in galleries.bru ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ meta {
2
+ name: list MODELS in galleries
3
+ type: http
4
+ seq: 7
5
+ }
6
+
7
+ get {
8
+ url: {{PROTOCOL}}{{HOST}}:{{PORT}}/models/available
9
+ body: none
10
+ auth: none
11
+ }
.bruno/LocalAI Test Requests/model gallery/list model GALLERIES.bru ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ meta {
2
+ name: list model GALLERIES
3
+ type: http
4
+ seq: 8
5
+ }
6
+
7
+ get {
8
+ url: {{PROTOCOL}}{{HOST}}:{{PORT}}/models/galleries
9
+ body: none
10
+ auth: none
11
+ }
.bruno/LocalAI Test Requests/model gallery/model delete.bru ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ meta {
2
+ name: model delete
3
+ type: http
4
+ seq: 7
5
+ }
6
+
7
+ post {
8
+ url: {{PROTOCOL}}{{HOST}}:{{PORT}}/models/galleries
9
+ body: none
10
+ auth: none
11
+ }
.bruno/LocalAI Test Requests/model gallery/model gallery apply -gist-.bru ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ meta {
2
+ name: model gallery apply -gist-
3
+ type: http
4
+ seq: 12
5
+ }
6
+
7
+ post {
8
+ url: {{PROTOCOL}}{{HOST}}:{{PORT}}/models/apply
9
+ body: json
10
+ auth: none
11
+ }
12
+
13
+ headers {
14
+ Content-Type: application/json
15
+ }
16
+
17
+ body:json {
18
+ {
19
+ "id": "TheBloke__CodeLlama-7B-Instruct-GGML__codellama-7b-instruct.ggmlv3.Q2_K.bin"
20
+ }
21
+ }
.bruno/LocalAI Test Requests/model gallery/model gallery apply.bru ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ meta {
2
+ name: model gallery apply
3
+ type: http
4
+ seq: 9
5
+ }
6
+
7
+ post {
8
+ url: {{PROTOCOL}}{{HOST}}:{{PORT}}/models/apply
9
+ body: json
10
+ auth: none
11
+ }
12
+
13
+ headers {
14
+ Content-Type: application/json
15
+ }
16
+
17
+ body:json {
18
+ {
19
+ "id": "dave@TheBloke__CodeLlama-7B-Instruct-GGML__codellama-7b-instruct.ggmlv3.Q3_K_S.bin",
20
+ "name": "codellama7b"
21
+ }
22
+ }
.bruno/LocalAI Test Requests/transcription/gb1.ogg ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:97a6384767e2fc3fb27c7593831aa19115d909fcdb85a1e389359ecc4b92a1e8
3
+ size 1667662
.bruno/LocalAI Test Requests/transcription/transcribe.bru ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ meta {
2
+ name: transcribe
3
+ type: http
4
+ seq: 1
5
+ }
6
+
7
+ post {
8
+ url: {{PROTOCOL}}{{HOST}}:{{PORT}}/v1/audio/transcriptions
9
+ body: multipartForm
10
+ auth: none
11
+ }
12
+
13
+ body:multipart-form {
14
+ file: @file(transcription/gb1.ogg)
15
+ model: whisper-1
16
+ }
.bruno/LocalAI Test Requests/tts/-tts.bru ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ meta {
2
+ name: -tts
3
+ type: http
4
+ seq: 2
5
+ }
6
+
7
+ post {
8
+ url: {{PROTOCOL}}{{HOST}}:{{PORT}}/tts
9
+ body: json
10
+ auth: none
11
+ }
12
+
13
+ headers {
14
+ Content-Type: application/json
15
+ }
16
+
17
+ body:json {
18
+ {
19
+ "model": "{{DEFAULT_MODEL}}",
20
+ "input": "A STRANGE GAME.\nTHE ONLY WINNING MOVE IS NOT TO PLAY.\n\nHOW ABOUT A NICE GAME OF CHESS?"
21
+ }
22
+ }
.bruno/LocalAI Test Requests/tts/musicgen.bru ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ meta {
2
+ name: musicgen
3
+ type: http
4
+ seq: 2
5
+ }
6
+
7
+ post {
8
+ url: {{PROTOCOL}}{{HOST}}:{{PORT}}/tts
9
+ body: json
10
+ auth: none
11
+ }
12
+
13
+ headers {
14
+ Content-Type: application/json
15
+ }
16
+
17
+ body:json {
18
+ {
19
+ "backend": "transformers-musicgen",
20
+ "model": "facebook/musicgen-small",
21
+ "input": "80s Synths playing Jazz"
22
+ }
23
+ }
.devcontainer-scripts/postcreate.sh ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ cd /workspace
4
+
5
+ # Get the files into the volume without a bind mount
6
+ if [ ! -d ".git" ]; then
7
+ git clone https://github.com/mudler/LocalAI.git .
8
+ else
9
+ git fetch
10
+ fi
11
+
12
+ echo "Standard Post-Create script completed."
13
+
14
+ if [ -f "/devcontainer-customization/postcreate.sh" ]; then
15
+ echo "Launching customization postcreate.sh"
16
+ bash "/devcontainer-customization/postcreate.sh"
17
+ fi
.devcontainer-scripts/poststart.sh ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ cd /workspace
4
+
5
+ # Grab the pre-stashed backend assets to avoid build issues
6
+ cp -r /build/backend-assets /workspace/backend-assets
7
+
8
+ # Ensures generated source files are present upon load
9
+ make prepare
10
+
11
+ echo "Standard Post-Start script completed."
12
+
13
+ if [ -f "/devcontainer-customization/poststart.sh" ]; then
14
+ echo "Launching customization poststart.sh"
15
+ bash "/devcontainer-customization/poststart.sh"
16
+ fi
.devcontainer-scripts/utils.sh ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+
3
+ # This file contains some really simple functions that are useful when building up customization scripts.
4
+
5
+
6
+ # Checks if the git config has a user registered - and sets it up if not.
7
+ #
8
+ # Param 1: name
9
+ # Param 2: email
10
+ #
11
+ config_user() {
12
+ echo "Configuring git for $1 <$2>"
13
+ local gcn=$(git config --global user.name)
14
+ if [ -z "${gcn}" ]; then
15
+ echo "Setting up git user / remote"
16
+ git config --global user.name "$1"
17
+ git config --global user.email "$2"
18
+
19
+ fi
20
+ }
21
+
22
+ # Checks if the git remote is configured - and sets it up if not. Fetches either way.
23
+ #
24
+ # Param 1: remote name
25
+ # Param 2: remote url
26
+ #
27
+ config_remote() {
28
+ echo "Adding git remote and fetching $2 as $1"
29
+ local gr=$(git remote -v | grep $1)
30
+ if [ -z "${gr}" ]; then
31
+ git remote add $1 $2
32
+ fi
33
+ git fetch $1
34
+ }
35
+
36
+ # Setup special .ssh files
37
+ # Prints out lines of text to make things pretty
38
+ # Param 1: bash array, filenames relative to the customization directory that should be copied to ~/.ssh
39
+ setup_ssh() {
40
+ echo "starting ~/.ssh directory setup..."
41
+ mkdir -p "${HOME}.ssh"
42
+ chmod 0700 "${HOME}/.ssh"
43
+ echo "-----"
44
+ local files=("$@")
45
+ for file in "${files[@]}" ; do
46
+ local cfile="/devcontainer-customization/${file}"
47
+ local hfile="${HOME}/.ssh/${file}"
48
+ if [ ! -f "${hfile}" ]; then
49
+ echo "copying \"${file}\""
50
+ cp "${cfile}" "${hfile}"
51
+ chmod 600 "${hfile}"
52
+ fi
53
+ done
54
+ echo "~/.ssh directory setup complete!"
55
+ }
.devcontainer/customization/README.md ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Place any additional resources your environment requires in this directory
2
+
3
+ Script hooks are currently called for:
4
+ `postcreate.sh` and `poststart.sh`
5
+
6
+ If files with those names exist here, they will be called at the end of the normal script.
7
+
8
+ This is a good place to set things like `git config --global user.name` are set - and to handle any other files that are mounted via this directory.
9
+
10
+ To assist in doing so, `source /.devcontainer-scripts/utils.sh` will provide utility functions that may be useful - for example:
11
+
12
+ ```
13
+ #!/bin/bash
14
+
15
+ source "/.devcontainer-scripts/utils.sh"
16
+
17
+ sshfiles=("config", "key.pub")
18
+
19
+ setup_ssh "${sshfiles[@]}"
20
+
21
+ config_user "YOUR NAME" "YOUR EMAIL"
22
+
23
+ config_remote "REMOTE NAME" "REMOTE URL"
24
+
25
+ ```
.devcontainer/devcontainer.json ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "$schema": "https://raw.githubusercontent.com/devcontainers/spec/main/schemas/devContainer.schema.json",
3
+ "name": "LocalAI",
4
+ "workspaceFolder": "/workspace",
5
+ "dockerComposeFile": [ "./docker-compose-devcontainer.yml" ],
6
+ "service": "api",
7
+ "shutdownAction": "stopCompose",
8
+ "customizations": {
9
+ "vscode": {
10
+ "extensions": [
11
+ "golang.go",
12
+ "ms-vscode.makefile-tools",
13
+ "ms-azuretools.vscode-docker",
14
+ "ms-python.python",
15
+ "ms-python.debugpy",
16
+ "wayou.vscode-todo-highlight",
17
+ "waderyan.gitblame"
18
+ ]
19
+ }
20
+ },
21
+ "forwardPorts": [8080, 3000],
22
+ "postCreateCommand": "bash /.devcontainer-scripts/postcreate.sh",
23
+ "postStartCommand": "bash /.devcontainer-scripts/poststart.sh"
24
+ }
.devcontainer/docker-compose-devcontainer.yml ADDED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ services:
2
+ api:
3
+ build:
4
+ context: ..
5
+ dockerfile: Dockerfile
6
+ target: devcontainer
7
+ args:
8
+ - FFMPEG=true
9
+ - IMAGE_TYPE=extras
10
+ - GO_TAGS=stablediffusion p2p tts
11
+ env_file:
12
+ - ../.env
13
+ ports:
14
+ - 8080:8080
15
+ volumes:
16
+ - localai_workspace:/workspace
17
+ - ../models:/host-models
18
+ - ./customization:/devcontainer-customization
19
+ command: /bin/sh -c "while sleep 1000; do :; done"
20
+ cap_add:
21
+ - SYS_PTRACE
22
+ security_opt:
23
+ - seccomp:unconfined
24
+ prometheus:
25
+ image: prom/prometheus
26
+ container_name: prometheus
27
+ command:
28
+ - '--config.file=/etc/prometheus/prometheus.yml'
29
+ ports:
30
+ - 9090:9090
31
+ restart: unless-stopped
32
+ volumes:
33
+ - ./prometheus:/etc/prometheus
34
+ - prom_data:/prometheus
35
+ grafana:
36
+ image: grafana/grafana
37
+ container_name: grafana
38
+ ports:
39
+ - 3000:3000
40
+ restart: unless-stopped
41
+ environment:
42
+ - GF_SECURITY_ADMIN_USER=admin
43
+ - GF_SECURITY_ADMIN_PASSWORD=grafana
44
+ volumes:
45
+ - ./grafana:/etc/grafana/provisioning/datasources
46
+ volumes:
47
+ prom_data:
48
+ localai_workspace:
.devcontainer/grafana/datasource.yml ADDED
@@ -0,0 +1,10 @@
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ apiVersion: 1
3
+
4
+ datasources:
5
+ - name: Prometheus
6
+ type: prometheus
7
+ url: http://prometheus:9090
8
+ isDefault: true
9
+ access: proxy
10
+ editable: true
.devcontainer/prometheus/prometheus.yml ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ global:
2
+ scrape_interval: 15s
3
+ scrape_timeout: 10s
4
+ evaluation_interval: 15s
5
+ alerting:
6
+ alertmanagers:
7
+ - static_configs:
8
+ - targets: []
9
+ scheme: http
10
+ timeout: 10s
11
+ api_version: v1
12
+ scrape_configs:
13
+ - job_name: prometheus
14
+ honor_timestamps: true
15
+ scrape_interval: 15s
16
+ scrape_timeout: 10s
17
+ metrics_path: /metrics
18
+ scheme: http
19
+ static_configs:
20
+ - targets:
21
+ - localhost:9090
.gitattributes CHANGED
@@ -1 +1,2 @@
1
  *.sh text eol=lf
 
 
1
  *.sh text eol=lf
2
+ .bruno/LocalAI[[:space:]]Test[[:space:]]Requests/transcription/gb1.ogg filter=lfs diff=lfs merge=lfs -text
.github/FUNDING.yml ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ # These are supported funding model platforms
2
+
3
+ github: [mudler]
4
+ custom:
5
+ - https://www.buymeacoffee.com/mudler
.github/ISSUE_TEMPLATE/bug_report.md ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: Bug report
3
+ about: Create a report to help us improve
4
+ title: ''
5
+ labels: bug, unconfirmed, up-for-grabs
6
+ ---
7
+
8
+ <!-- Thanks for helping us to improve LocalAI! We welcome all bug reports. Please fill out each area of the template so we can better help you. Comments like this will be hidden when you post but you can delete them if you wish. -->
9
+
10
+ **LocalAI version:**
11
+ <!-- Container Image or LocalAI tag/commit -->
12
+
13
+ **Environment, CPU architecture, OS, and Version:**
14
+ <!-- Provide the output from "uname -a", HW specs, if it's a VM -->
15
+
16
+ **Describe the bug**
17
+ <!-- A clear and concise description of what the bug is. -->
18
+
19
+ **To Reproduce**
20
+ <!-- Steps to reproduce the behavior, including the LocalAI command used, if any -->
21
+
22
+ **Expected behavior**
23
+ <!-- A clear and concise description of what you expected to happen. -->
24
+
25
+ **Logs**
26
+ <!-- If applicable, add logs while running LocalAI in debug mode (`--debug` or `DEBUG=true`) to help explain your problem. -->
27
+
28
+ **Additional context**
29
+ <!-- Add any other context about the problem here. -->
.github/ISSUE_TEMPLATE/config.yml ADDED
@@ -0,0 +1,8 @@
 
 
 
 
 
 
 
 
 
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Community Support
4
+ url: https://github.com/go-skynet/LocalAI/discussions
5
+ about: Please ask and answer questions here.
6
+ - name: Discord
7
+ url: https://discord.gg/uJAeKSAGDy
8
+ about: Join our community on Discord!
.github/ISSUE_TEMPLATE/feature_request.md ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ name: Feature request
3
+ about: Suggest an idea for this project
4
+ title: ''
5
+ labels: enhancement, up-for-grabs
6
+ ---
7
+
8
+ <!-- Thanks for helping us to improve LocalAI! We welcome all feature requests. Please fill out each area of the template so we can better help you. Comments like this will be hidden when you post but you can delete them if you wish. -->
9
+
10
+ **Is your feature request related to a problem? Please describe.**
11
+ <!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
12
+
13
+ **Describe the solution you'd like**
14
+ <!-- A clear and concise description of what you want to happen. -->
15
+
16
+ **Describe alternatives you've considered**
17
+ <!-- A clear and concise description of any alternative solutions or features you've considered. -->
18
+
19
+ **Additional context**
20
+ <!-- Add any other context or screenshots about the feature request here. -->
.github/PULL_REQUEST_TEMPLATE.md ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ **Description**
2
+
3
+ This PR fixes #
4
+
5
+ **Notes for Reviewers**
6
+
7
+
8
+ **[Signed commits](../CONTRIBUTING.md#signing-off-on-commits-developer-certificate-of-origin)**
9
+ - [ ] Yes, I signed my commits.
10
+
11
+ <!--
12
+ Thank you for contributing to LocalAI!
13
+
14
+ Contributing Conventions
15
+ -------------------------
16
+
17
+ The draft above helps to give a quick overview of your PR.
18
+
19
+ Remember to remove this comment and to at least:
20
+
21
+ 1. Include descriptive PR titles with [<component-name>] prepended. We use [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/).
22
+ 2. Build and test your changes before submitting a PR (`make build`).
23
+ 3. Sign your commits
24
+ 4. **Tag maintainer:** for a quicker response, tag the relevant maintainer (see below).
25
+ 5. **X/Twitter handle:** we announce bigger features on X/Twitter. If your PR gets announced, and you'd like a mention, we'll gladly shout you out!
26
+
27
+ By following the community's contribution conventions upfront, the review process will
28
+ be accelerated and your PR merged more quickly.
29
+
30
+ If no one reviews your PR within a few days, please @-mention @mudler.
31
+ -->
.github/bump_deps.sh ADDED
@@ -0,0 +1,22 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ set -xe
3
+ REPO=$1
4
+ BRANCH=$2
5
+ VAR=$3
6
+
7
+ LAST_COMMIT=$(curl -s -H "Accept: application/vnd.github.VERSION.sha" "https://api.github.com/repos/$REPO/commits/$BRANCH")
8
+
9
+ # Read $VAR from Makefile (only first match)
10
+ set +e
11
+ CURRENT_COMMIT="$(grep -m1 "^$VAR?=" Makefile | cut -d'=' -f2)"
12
+ set -e
13
+
14
+ sed -i Makefile -e "s/$VAR?=.*/$VAR?=$LAST_COMMIT/"
15
+
16
+ if [ -z "$CURRENT_COMMIT" ]; then
17
+ echo "Could not find $VAR in Makefile."
18
+ exit 0
19
+ fi
20
+
21
+ echo "Changes: https://github.com/$REPO/compare/${CURRENT_COMMIT}..${LAST_COMMIT}" >> "${VAR}_message.txt"
22
+ echo "${LAST_COMMIT}" >> "${VAR}_commit.txt"
.github/bump_docs.sh ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ set -xe
3
+ REPO=$1
4
+
5
+ LATEST_TAG=$(curl -s "https://api.github.com/repos/$REPO/releases/latest" | jq -r '.tag_name')
6
+
7
+ cat <<< $(jq ".version = \"$LATEST_TAG\"" docs/data/version.json) > docs/data/version.json
.github/check_and_update.py ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import hashlib
2
+ from huggingface_hub import hf_hub_download, get_paths_info
3
+ import requests
4
+ import sys
5
+ import os
6
+
7
+ uri = sys.argv[1]
8
+ file_name = uri.split('/')[-1]
9
+
10
+ # Function to parse the URI and determine download method
11
+ def parse_uri(uri):
12
+ if uri.startswith('huggingface://'):
13
+ repo_id = uri.split('://')[1]
14
+ return 'huggingface', repo_id.rsplit('/', 1)[0]
15
+ elif 'huggingface.co' in uri:
16
+ parts = uri.split('/resolve/')
17
+ if len(parts) > 1:
18
+ repo_path = parts[0].split('https://huggingface.co/')[-1]
19
+ return 'huggingface', repo_path
20
+ return 'direct', uri
21
+
22
+ def calculate_sha256(file_path):
23
+ sha256_hash = hashlib.sha256()
24
+ with open(file_path, 'rb') as f:
25
+ for byte_block in iter(lambda: f.read(4096), b''):
26
+ sha256_hash.update(byte_block)
27
+ return sha256_hash.hexdigest()
28
+
29
+ def manual_safety_check_hf(repo_id):
30
+ scanResponse = requests.get('https://huggingface.co/api/models/' + repo_id + "/scan")
31
+ scan = scanResponse.json()
32
+ # Check if 'hasUnsafeFile' exists in the response
33
+ if 'hasUnsafeFile' in scan:
34
+ if scan['hasUnsafeFile']:
35
+ return scan
36
+ else:
37
+ return None
38
+ else:
39
+ return None
40
+
41
+ download_type, repo_id_or_url = parse_uri(uri)
42
+
43
+ new_checksum = None
44
+ file_path = None
45
+
46
+ # Decide download method based on URI type
47
+ if download_type == 'huggingface':
48
+ # Check if the repo is flagged as dangerous by HF
49
+ hazard = manual_safety_check_hf(repo_id_or_url)
50
+ if hazard != None:
51
+ print(f'Error: HuggingFace has detected security problems for {repo_id_or_url}: {str(hazard)}', filename=file_name)
52
+ sys.exit(5)
53
+ # Use HF API to pull sha
54
+ for file in get_paths_info(repo_id_or_url, [file_name], repo_type='model'):
55
+ try:
56
+ new_checksum = file.lfs.sha256
57
+ break
58
+ except Exception as e:
59
+ print(f'Error from Hugging Face Hub: {str(e)}', file=sys.stderr)
60
+ sys.exit(2)
61
+ if new_checksum is None:
62
+ try:
63
+ file_path = hf_hub_download(repo_id=repo_id_or_url, filename=file_name)
64
+ except Exception as e:
65
+ print(f'Error from Hugging Face Hub: {str(e)}', file=sys.stderr)
66
+ sys.exit(2)
67
+ else:
68
+ response = requests.get(repo_id_or_url)
69
+ if response.status_code == 200:
70
+ with open(file_name, 'wb') as f:
71
+ f.write(response.content)
72
+ file_path = file_name
73
+ elif response.status_code == 404:
74
+ print(f'File not found: {response.status_code}', file=sys.stderr)
75
+ sys.exit(2)
76
+ else:
77
+ print(f'Error downloading file: {response.status_code}', file=sys.stderr)
78
+ sys.exit(1)
79
+
80
+ if new_checksum is None:
81
+ new_checksum = calculate_sha256(file_path)
82
+ print(new_checksum)
83
+ os.remove(file_path)
84
+ else:
85
+ print(new_checksum)
.github/checksum_checker.sh ADDED
@@ -0,0 +1,63 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ # This scripts needs yq and huggingface_hub to be installed
3
+ # to install hugingface_hub run pip install huggingface_hub
4
+
5
+ # Path to the input YAML file
6
+ input_yaml=$1
7
+
8
+ # Function to download file and check checksum using Python
9
+ function check_and_update_checksum() {
10
+ model_name="$1"
11
+ file_name="$2"
12
+ uri="$3"
13
+ old_checksum="$4"
14
+ idx="$5"
15
+
16
+ # Download the file and calculate new checksum using Python
17
+ new_checksum=$(python3 ./.github/check_and_update.py $uri)
18
+ result=$?
19
+
20
+ if [[ $result -eq 5 ]]; then
21
+ echo "Contaminated entry detected, deleting entry for $model_name..."
22
+ yq eval -i "del([$idx])" "$input_yaml"
23
+ return
24
+ fi
25
+
26
+ if [[ "$new_checksum" == "" ]]; then
27
+ echo "Error calculating checksum for $file_name. Skipping..."
28
+ return
29
+ fi
30
+
31
+ echo "Checksum for $file_name: $new_checksum"
32
+
33
+ # Compare and update the YAML file if checksums do not match
34
+
35
+ if [[ $result -eq 2 ]]; then
36
+ echo "File not found, deleting entry for $file_name..."
37
+ # yq eval -i "del(.[$idx].files[] | select(.filename == \"$file_name\"))" "$input_yaml"
38
+ elif [[ "$old_checksum" != "$new_checksum" ]]; then
39
+ echo "Checksum mismatch for $file_name. Updating..."
40
+ yq eval -i "del(.[$idx].files[] | select(.filename == \"$file_name\").sha256)" "$input_yaml"
41
+ yq eval -i "(.[$idx].files[] | select(.filename == \"$file_name\")).sha256 = \"$new_checksum\"" "$input_yaml"
42
+ elif [[ $result -ne 0 ]]; then
43
+ echo "Error downloading file $file_name. Skipping..."
44
+ else
45
+ echo "Checksum match for $file_name. No update needed."
46
+ fi
47
+ }
48
+
49
+ # Read the YAML and process each file
50
+ len=$(yq eval '. | length' "$input_yaml")
51
+ for ((i=0; i<$len; i++))
52
+ do
53
+ name=$(yq eval ".[$i].name" "$input_yaml")
54
+ files_len=$(yq eval ".[$i].files | length" "$input_yaml")
55
+ for ((j=0; j<$files_len; j++))
56
+ do
57
+ filename=$(yq eval ".[$i].files[$j].filename" "$input_yaml")
58
+ uri=$(yq eval ".[$i].files[$j].uri" "$input_yaml")
59
+ checksum=$(yq eval ".[$i].files[$j].sha256" "$input_yaml")
60
+ echo "Checking model $name, file $filename. URI = $uri, Checksum = $checksum"
61
+ check_and_update_checksum "$name" "$filename" "$uri" "$checksum" "$i"
62
+ done
63
+ done
.github/ci/modelslist.go ADDED
@@ -0,0 +1,304 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ package main
2
+
3
+ import (
4
+ "fmt"
5
+ "html/template"
6
+ "io/ioutil"
7
+ "os"
8
+
9
+ "github.com/microcosm-cc/bluemonday"
10
+ "gopkg.in/yaml.v3"
11
+ )
12
+
13
+ var modelPageTemplate string = `
14
+ <!DOCTYPE html>
15
+ <html>
16
+ <head>
17
+ <meta charset="UTF-8">
18
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
19
+ <title>LocalAI models</title>
20
+ <link href="https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.3.0/flowbite.min.css" rel="stylesheet" />
21
+ <script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload@19.1.3/dist/lazyload.min.js"></script>
22
+
23
+ <link
24
+ rel="stylesheet"
25
+ href="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.8.0/build/styles/default.min.css"
26
+ />
27
+ <script
28
+ defer
29
+ src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.8.0/build/highlight.min.js"
30
+ ></script>
31
+ <script
32
+ defer
33
+ src="https://cdn.jsdelivr.net/npm/alpinejs@3.x.x/dist/cdn.min.js"
34
+ ></script>
35
+ <script
36
+ defer
37
+ src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"
38
+ ></script>
39
+ <script
40
+ defer
41
+ src="https://cdn.jsdelivr.net/npm/dompurify@3.0.6/dist/purify.min.js"
42
+ ></script>
43
+
44
+ <link href="/static/general.css" rel="stylesheet" />
45
+ <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&family=Roboto:wght@400;500&display=swap" rel="stylesheet">
46
+ <link
47
+ href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700,900&display=swap"
48
+ rel="stylesheet" />
49
+ <link
50
+ rel="stylesheet"
51
+ href="https://cdn.jsdelivr.net/npm/tw-elements/css/tw-elements.min.css" />
52
+ <script src="https://cdn.tailwindcss.com/3.3.0"></script>
53
+ <script>
54
+ tailwind.config = {
55
+ darkMode: "class",
56
+ theme: {
57
+ fontFamily: {
58
+ sans: ["Roboto", "sans-serif"],
59
+ body: ["Roboto", "sans-serif"],
60
+ mono: ["ui-monospace", "monospace"],
61
+ },
62
+ },
63
+ corePlugins: {
64
+ preflight: false,
65
+ },
66
+ };
67
+ </script>
68
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css">
69
+ <script src="https://unpkg.com/htmx.org@1.9.12" integrity="sha384-ujb1lZYygJmzgSwoxRggbCHcjc0rB2XoQrxeTUQyRjrOnlCoYta87iKBWq3EsdM2" crossorigin="anonymous"></script>
70
+ </head>
71
+
72
+ <body class="bg-gray-900 text-gray-200">
73
+ <div class="flex flex-col min-h-screen">
74
+
75
+ <nav class="bg-gray-800 shadow-lg">
76
+ <div class="container mx-auto px-4 py-4">
77
+ <div class="flex items-center justify-between">
78
+ <div class="flex items-center">
79
+ <a href="/" class="text-white text-xl font-bold"><img src="https://github.com/mudler/LocalAI/assets/2420543/0966aa2a-166e-4f99-a3e5-6c915fc997dd" alt="LocalAI Logo" class="h-10 mr-3 border-2 border-gray-300 shadow rounded"></a>
80
+ <a href="/" class="text-white text-xl font-bold">LocalAI</a>
81
+ </div>
82
+ <!-- Menu button for small screens -->
83
+ <div class="lg:hidden">
84
+ <button id="menu-toggle" class="text-gray-400 hover:text-white focus:outline-none">
85
+ <i class="fas fa-bars fa-lg"></i>
86
+ </button>
87
+ </div>
88
+ <!-- Navigation links -->
89
+ <div class="hidden lg:flex lg:items-center lg:justify-end lg:flex-1 lg:w-0">
90
+ <a href="https://localai.io" class="text-gray-400 hover:text-white px-3 py-2 rounded" target="_blank" ><i class="fas fa-book-reader pr-2"></i> Documentation</a>
91
+ </div>
92
+ </div>
93
+ <!-- Collapsible menu for small screens -->
94
+ <div class="hidden lg:hidden" id="mobile-menu">
95
+ <div class="pt-4 pb-3 border-t border-gray-700">
96
+
97
+ <a href="https://localai.io" class="block text-gray-400 hover:text-white px-3 py-2 rounded mt-1" target="_blank" ><i class="fas fa-book-reader pr-2"></i> Documentation</a>
98
+
99
+ </div>
100
+ </div>
101
+ </div>
102
+ </nav>
103
+
104
+ <style>
105
+ .is-hidden {
106
+ display: none;
107
+ }
108
+ </style>
109
+
110
+ <div class="container mx-auto px-4 flex-grow">
111
+
112
+ <div class="models mt-12">
113
+ <h2 class="text-center text-3xl font-semibold text-gray-100">
114
+ LocalAI model gallery list </h2><br>
115
+
116
+ <h2 class="text-center text-3xl font-semibold text-gray-100">
117
+
118
+ 🖼️ Available {{.AvailableModels}} models</i> <a href="https://localai.io/models/" target="_blank" >
119
+ <i class="fas fa-circle-info pr-2"></i>
120
+ </a></h2>
121
+
122
+ <h3>
123
+ Refer to the Model gallery <a href="https://localai.io/models/" target="_blank" ><i class="fas fa-circle-info pr-2"></i></a> for more information on how to use the models with LocalAI.<br>
124
+
125
+ You can install models with the CLI command <code>local-ai models install <model-name></code>. or by using the WebUI.
126
+ </h3>
127
+
128
+ <input class="form-control appearance-none block w-full mt-5 px-3 py-2 text-base font-normal text-gray-300 pb-2 mb-5 bg-gray-800 bg-clip-padding border border-solid border-gray-600 rounded transition ease-in-out m-0 focus:text-gray-300 focus:bg-gray-900 focus:border-blue-500 focus:outline-none" type="search"
129
+ id="searchbox" placeholder="Live search keyword..">
130
+ <div class="dark grid grid-cols-1 grid-rows-1 md:grid-cols-3 block rounded-lg shadow-secondary-1 dark:bg-surface-dark">
131
+ {{ range $_, $model := .Models }}
132
+ <div class="box me-4 mb-2 block rounded-lg bg-white shadow-secondary-1 dark:bg-gray-800 dark:bg-surface-dark dark:text-white text-surface pb-2">
133
+ <div>
134
+ {{ $icon := "https://upload.wikimedia.org/wikipedia/commons/6/65/No-Image-Placeholder.svg" }}
135
+ {{ if $model.Icon }}
136
+ {{ $icon = $model.Icon }}
137
+ {{ end }}
138
+ <div class="flex justify-center items-center">
139
+ <img data-src="{{ $icon }}" alt="{{$model.Name}}" class="rounded-t-lg max-h-48 max-w-96 object-cover mt-3 lazy">
140
+ </div>
141
+ <div class="p-6 text-surface dark:text-white">
142
+ <h5 class="mb-2 text-xl font-medium leading-tight">{{$model.Name}}</h5>
143
+
144
+
145
+ <p class="mb-4 text-base truncate">{{ $model.Description }}</p>
146
+
147
+ </div>
148
+ <div class="px-6 pt-4 pb-2">
149
+
150
+ <!-- Modal toggle -->
151
+ <button data-modal-target="{{ $model.Name}}-modal" data-modal-toggle="{{ $model.Name }}-modal" class="block text-white bg-blue-700 hover:bg-blue-800 focus:ring-4 focus:outline-none focus:ring-blue-300 font-medium rounded-lg text-sm px-5 py-2.5 text-center dark:bg-blue-600 dark:hover:bg-blue-700 dark:focus:ring-blue-800" type="button">
152
+ More info
153
+ </button>
154
+
155
+ <!-- Main modal -->
156
+ <div id="{{ $model.Name}}-modal" tabindex="-1" aria-hidden="true" class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
157
+ <div class="relative p-4 w-full max-w-2xl max-h-full">
158
+ <!-- Modal content -->
159
+ <div class="relative bg-white rounded-lg shadow dark:bg-gray-700">
160
+ <!-- Modal header -->
161
+ <div class="flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600">
162
+ <h3 class="text-xl font-semibold text-gray-900 dark:text-white">
163
+ {{ $model.Name}}
164
+ </h3>
165
+ <button type="button" class="text-gray-400 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm w-8 h-8 ms-auto inline-flex justify-center items-center dark:hover:bg-gray-600 dark:hover:text-white" data-modal-hide="{{$model.Name}}-modal">
166
+ <svg class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
167
+ <path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
168
+ </svg>
169
+ <span class="sr-only">Close modal</span>
170
+ </button>
171
+ </div>
172
+ <!-- Modal body -->
173
+ <div class="p-4 md:p-5 space-y-4">
174
+ <div class="flex justify-center items-center">
175
+ <img data-src="{{ $icon }}" alt="{{$model.Name}}" class="lazy rounded-t-lg max-h-48 max-w-96 object-cover mt-3">
176
+ </div>
177
+
178
+ <p class="text-base leading-relaxed text-gray-500 dark:text-gray-400">
179
+ {{ $model.Description }}
180
+
181
+ </p>
182
+
183
+ <p class="text-base leading-relaxed text-gray-500 dark:text-gray-400">
184
+ To install the model with the CLI, run: <br>
185
+ <code> local-ai models install {{$model.Name}} </code> <br>
186
+
187
+ <hr>
188
+ See also <a href="https://localai.io/models/" target="_blank" >
189
+ Installation <i class="fas fa-circle-info pr-2"></i>
190
+ </a> to see how to install models with the REST API.
191
+ </p>
192
+
193
+ <p class="text-base leading-relaxed text-gray-500 dark:text-gray-400">
194
+ <ul>
195
+ {{ range $_, $u := $model.URLs }}
196
+ <li><a href="{{ $u }}" target=_blank><i class="fa-solid fa-link"></i> {{ $u }}</a></li>
197
+ {{ end }}
198
+ </ul>
199
+ </p>
200
+ </div>
201
+ <!-- Modal footer -->
202
+ <div class="flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600">
203
+ <button data-modal-hide="{{ $model.Name}}-modal" type="button" class="py-2.5 px-5 ms-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700">Close</button>
204
+ </div>
205
+ </div>
206
+ </div>
207
+ </div>
208
+
209
+
210
+ </div>
211
+ </div>
212
+ </div>
213
+ {{ end }}
214
+
215
+ </div>
216
+ </div>
217
+ </div>
218
+
219
+ <script>
220
+ var lazyLoadInstance = new LazyLoad({
221
+ // Your custom settings go here
222
+ });
223
+
224
+ let cards = document.querySelectorAll('.box')
225
+
226
+ function liveSearch() {
227
+ let search_query = document.getElementById("searchbox").value;
228
+
229
+ //Use innerText if all contents are visible
230
+ //Use textContent for including hidden elements
231
+ for (var i = 0; i < cards.length; i++) {
232
+ if(cards[i].textContent.toLowerCase()
233
+ .includes(search_query.toLowerCase())) {
234
+ cards[i].classList.remove("is-hidden");
235
+ } else {
236
+ cards[i].classList.add("is-hidden");
237
+ }
238
+ }
239
+ }
240
+
241
+ //A little delay
242
+ let typingTimer;
243
+ let typeInterval = 500;
244
+ let searchInput = document.getElementById('searchbox');
245
+
246
+ searchInput.addEventListener('keyup', () => {
247
+ clearTimeout(typingTimer);
248
+ typingTimer = setTimeout(liveSearch, typeInterval);
249
+ });
250
+ </script>
251
+
252
+ </div>
253
+
254
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/flowbite/2.3.0/flowbite.min.js"></script>
255
+ </body>
256
+ </html>
257
+ `
258
+
259
+ type GalleryModel struct {
260
+ Name string `json:"name" yaml:"name"`
261
+ URLs []string `json:"urls" yaml:"urls"`
262
+ Icon string `json:"icon" yaml:"icon"`
263
+ Description string `json:"description" yaml:"description"`
264
+ }
265
+
266
+ func main() {
267
+ // read the YAML file which contains the models
268
+
269
+ f, err := ioutil.ReadFile(os.Args[1])
270
+ if err != nil {
271
+ fmt.Println("Error reading file:", err)
272
+ return
273
+ }
274
+
275
+ models := []*GalleryModel{}
276
+ err = yaml.Unmarshal(f, &models)
277
+ if err != nil {
278
+ // write to stderr
279
+ os.Stderr.WriteString("Error unmarshaling YAML: " + err.Error() + "\n")
280
+ return
281
+ }
282
+
283
+ // Ensure that all arbitrary text content is sanitized before display
284
+ for i, m := range models {
285
+ models[i].Name = bluemonday.StrictPolicy().Sanitize(m.Name)
286
+ models[i].Description = bluemonday.StrictPolicy().Sanitize(m.Description)
287
+ }
288
+
289
+ // render the template
290
+ data := struct {
291
+ Models []*GalleryModel
292
+ AvailableModels int
293
+ }{
294
+ Models: models,
295
+ AvailableModels: len(models),
296
+ }
297
+ tmpl := template.Must(template.New("modelPage").Parse(modelPageTemplate))
298
+
299
+ err = tmpl.Execute(os.Stdout, data)
300
+ if err != nil {
301
+ fmt.Println("Error executing template:", err)
302
+ return
303
+ }
304
+ }
.github/dependabot.yml ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
2
+ version: 2
3
+ updates:
4
+ - package-ecosystem: "gitsubmodule"
5
+ directory: "/"
6
+ schedule:
7
+ interval: "weekly"
8
+ - package-ecosystem: "gomod"
9
+ directory: "/"
10
+ schedule:
11
+ interval: "weekly"
12
+ ignore:
13
+ - dependency-name: "github.com/mudler/LocalAI/pkg/grpc/proto"
14
+ - package-ecosystem: "github-actions"
15
+ # Workflow files stored in the default location of `.github/workflows`. (You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.)
16
+ directory: "/"
17
+ schedule:
18
+ # Check for updates to GitHub Actions every weekday
19
+ interval: "weekly"
20
+ - package-ecosystem: "pip"
21
+ # Workflow files stored in the default location of `.github/workflows`. (You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.)
22
+ directory: "/"
23
+ schedule:
24
+ # Check for updates to GitHub Actions every weekday
25
+ interval: "weekly"
26
+ - package-ecosystem: "docker"
27
+ # Workflow files stored in the default location of `.github/workflows`. (You don't need to specify `/.github/workflows` for `directory`. You can use `directory: "/"`.)
28
+ directory: "/"
29
+ schedule:
30
+ # Check for updates to GitHub Actions every weekday
31
+ interval: "weekly"
32
+ - package-ecosystem: "pip"
33
+ directory: "/backend/python/autogptq"
34
+ schedule:
35
+ interval: "weekly"
36
+ - package-ecosystem: "pip"
37
+ directory: "/backend/python/bark"
38
+ schedule:
39
+ interval: "weekly"
40
+ - package-ecosystem: "pip"
41
+ directory: "/backend/python/common/template"
42
+ schedule:
43
+ interval: "weekly"
44
+ - package-ecosystem: "pip"
45
+ directory: "/backend/python/coqui"
46
+ schedule:
47
+ interval: "weekly"
48
+ - package-ecosystem: "pip"
49
+ directory: "/backend/python/diffusers"
50
+ schedule:
51
+ interval: "weekly"
52
+ - package-ecosystem: "pip"
53
+ directory: "/backend/python/exllama"
54
+ schedule:
55
+ interval: "weekly"
56
+ - package-ecosystem: "pip"
57
+ directory: "/backend/python/exllama2"
58
+ schedule:
59
+ interval: "weekly"
60
+ - package-ecosystem: "pip"
61
+ directory: "/backend/python/mamba"
62
+ schedule:
63
+ interval: "weekly"
64
+ - package-ecosystem: "pip"
65
+ directory: "/backend/python/openvoice"
66
+ schedule:
67
+ interval: "weekly"
68
+ - package-ecosystem: "pip"
69
+ directory: "/backend/python/parler-tts"
70
+ schedule:
71
+ interval: "weekly"
72
+ - package-ecosystem: "pip"
73
+ directory: "/backend/python/rerankers"
74
+ schedule:
75
+ interval: "weekly"
76
+ - package-ecosystem: "pip"
77
+ directory: "/backend/python/sentencetransformers"
78
+ schedule:
79
+ interval: "weekly"
80
+ - package-ecosystem: "pip"
81
+ directory: "/backend/python/transformers"
82
+ schedule:
83
+ interval: "weekly"
84
+ - package-ecosystem: "pip"
85
+ directory: "/backend/python/transformers-musicgen"
86
+ schedule:
87
+ interval: "weekly"
88
+ - package-ecosystem: "pip"
89
+ directory: "/backend/python/vall-e-x"
90
+ schedule:
91
+ interval: "weekly"
92
+ - package-ecosystem: "pip"
93
+ directory: "/backend/python/vllm"
94
+ schedule:
95
+ interval: "weekly"
96
+ - package-ecosystem: "pip"
97
+ directory: "/examples/chainlit"
98
+ schedule:
99
+ interval: "weekly"
100
+ - package-ecosystem: "pip"
101
+ directory: "/examples/functions"
102
+ schedule:
103
+ interval: "weekly"
104
+ - package-ecosystem: "pip"
105
+ directory: "/examples/langchain/langchainpy-localai-example"
106
+ schedule:
107
+ interval: "weekly"
108
+ - package-ecosystem: "pip"
109
+ directory: "/examples/langchain-chroma"
110
+ schedule:
111
+ interval: "weekly"
112
+ - package-ecosystem: "pip"
113
+ directory: "/examples/streamlit-bot"
114
+ schedule:
115
+ interval: "weekly"
116
+ - package-ecosystem: "docker"
117
+ directory: "/examples/k8sgpt"
118
+ schedule:
119
+ interval: "weekly"
120
+ - package-ecosystem: "docker"
121
+ directory: "/examples/kubernetes"
122
+ schedule:
123
+ interval: "weekly"
124
+ - package-ecosystem: "docker"
125
+ directory: "/examples/langchain"
126
+ schedule:
127
+ interval: "weekly"
128
+ - package-ecosystem: "gomod"
129
+ directory: "/examples/semantic-todo"
130
+ schedule:
131
+ interval: "weekly"
132
+ - package-ecosystem: "docker"
133
+ directory: "/examples/telegram-bot"
134
+ schedule:
135
+ interval: "weekly"
.github/labeler.yml ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ enhancements:
2
+ - head-branch: ['^feature', 'feature']
3
+
4
+ kind/documentation:
5
+ - any:
6
+ - changed-files:
7
+ - any-glob-to-any-file: 'docs/*'
8
+ - changed-files:
9
+ - any-glob-to-any-file: '*.md'
10
+
11
+ area/ai-model:
12
+ - any:
13
+ - changed-files:
14
+ - any-glob-to-any-file: 'gallery/*'
15
+
16
+ examples:
17
+ - any:
18
+ - changed-files:
19
+ - any-glob-to-any-file: 'examples/*'
20
+
21
+ ci:
22
+ - any:
23
+ - changed-files:
24
+ - any-glob-to-any-file: '.github/*'
.github/release.yml ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # .github/release.yml
2
+
3
+ changelog:
4
+ exclude:
5
+ labels:
6
+ - ignore-for-release
7
+ categories:
8
+ - title: Breaking Changes 🛠
9
+ labels:
10
+ - Semver-Major
11
+ - breaking-change
12
+ - title: "Bug fixes :bug:"
13
+ labels:
14
+ - bug
15
+ - regression
16
+ - title: "🖧 P2P area"
17
+ labels:
18
+ - area/p2p
19
+ - title: Exciting New Features 🎉
20
+ labels:
21
+ - Semver-Minor
22
+ - enhancement
23
+ - ux
24
+ - roadmap
25
+ - title: 🧠 Models
26
+ labels:
27
+ - area/ai-model
28
+ - title: 📖 Documentation and examples
29
+ labels:
30
+ - kind/documentation
31
+ - examples
32
+ - title: 👒 Dependencies
33
+ labels:
34
+ - dependencies
35
+ - title: Other Changes
36
+ labels:
37
+ - "*"
.github/stale.yml ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Number of days of inactivity before an issue becomes stale
2
+ daysUntilStale: 45
3
+ # Number of days of inactivity before a stale issue is closed
4
+ daysUntilClose: 10
5
+ # Issues with these labels will never be considered stale
6
+ exemptLabels:
7
+ - issue/willfix
8
+ # Label to use when marking an issue as stale
9
+ staleLabel: issue/stale
10
+ # Comment to post when marking an issue as stale. Set to `false` to disable
11
+ markComment: >
12
+ This issue has been automatically marked as stale because it has not had
13
+ recent activity. It will be closed if no further activity occurs. Thank you
14
+ for your contributions.
15
+ # Comment to post when closing a stale issue. Set to `false` to disable
16
+ closeComment: >
17
+ This issue is being automatically closed due to inactivity.
18
+ However, you may choose to reopen this issue.
.github/workflows/bump_deps.yaml ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Bump dependencies
2
+ on:
3
+ schedule:
4
+ - cron: 0 20 * * *
5
+ workflow_dispatch:
6
+ jobs:
7
+ bump:
8
+ strategy:
9
+ fail-fast: false
10
+ matrix:
11
+ include:
12
+ - repository: "ggerganov/llama.cpp"
13
+ variable: "CPPLLAMA_VERSION"
14
+ branch: "master"
15
+ - repository: "go-skynet/go-ggml-transformers.cpp"
16
+ variable: "GOGGMLTRANSFORMERS_VERSION"
17
+ branch: "master"
18
+ - repository: "donomii/go-rwkv.cpp"
19
+ variable: "RWKV_VERSION"
20
+ branch: "main"
21
+ - repository: "ggerganov/whisper.cpp"
22
+ variable: "WHISPER_CPP_VERSION"
23
+ branch: "master"
24
+ - repository: "go-skynet/go-bert.cpp"
25
+ variable: "BERT_VERSION"
26
+ branch: "master"
27
+ - repository: "go-skynet/bloomz.cpp"
28
+ variable: "BLOOMZ_VERSION"
29
+ branch: "main"
30
+ - repository: "mudler/go-ggllm.cpp"
31
+ variable: "GOGGLLM_VERSION"
32
+ branch: "master"
33
+ - repository: "mudler/go-stable-diffusion"
34
+ variable: "STABLEDIFFUSION_VERSION"
35
+ branch: "master"
36
+ - repository: "mudler/go-piper"
37
+ variable: "PIPER_VERSION"
38
+ branch: "master"
39
+ runs-on: ubuntu-latest
40
+ steps:
41
+ - uses: actions/checkout@v4
42
+ - name: Bump dependencies 🔧
43
+ id: bump
44
+ run: |
45
+ bash .github/bump_deps.sh ${{ matrix.repository }} ${{ matrix.branch }} ${{ matrix.variable }}
46
+ {
47
+ echo 'message<<EOF'
48
+ cat "${{ matrix.variable }}_message.txt"
49
+ echo EOF
50
+ } >> "$GITHUB_OUTPUT"
51
+ {
52
+ echo 'commit<<EOF'
53
+ cat "${{ matrix.variable }}_commit.txt"
54
+ echo EOF
55
+ } >> "$GITHUB_OUTPUT"
56
+ rm -rfv ${{ matrix.variable }}_message.txt
57
+ rm -rfv ${{ matrix.variable }}_commit.txt
58
+ - name: Create Pull Request
59
+ uses: peter-evans/create-pull-request@v7
60
+ with:
61
+ token: ${{ secrets.UPDATE_BOT_TOKEN }}
62
+ push-to-fork: ci-forks/LocalAI
63
+ commit-message: ':arrow_up: Update ${{ matrix.repository }}'
64
+ title: 'chore: :arrow_up: Update ${{ matrix.repository }} to `${{ steps.bump.outputs.commit }}`'
65
+ branch: "update/${{ matrix.variable }}"
66
+ body: ${{ steps.bump.outputs.message }}
67
+ signoff: true
68
+
69
+
70
+
.github/workflows/bump_docs.yaml ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Bump dependencies
2
+ on:
3
+ schedule:
4
+ - cron: 0 20 * * *
5
+ workflow_dispatch:
6
+ jobs:
7
+ bump:
8
+ strategy:
9
+ fail-fast: false
10
+ matrix:
11
+ include:
12
+ - repository: "mudler/LocalAI"
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - uses: actions/checkout@v4
16
+ - name: Bump dependencies 🔧
17
+ run: |
18
+ bash .github/bump_docs.sh ${{ matrix.repository }}
19
+ - name: Create Pull Request
20
+ uses: peter-evans/create-pull-request@v7
21
+ with:
22
+ token: ${{ secrets.UPDATE_BOT_TOKEN }}
23
+ push-to-fork: ci-forks/LocalAI
24
+ commit-message: ':arrow_up: Update docs version ${{ matrix.repository }}'
25
+ title: 'docs: :arrow_up: update docs version ${{ matrix.repository }}'
26
+ branch: "update/docs"
27
+ body: Bump of ${{ matrix.repository }} version inside docs
28
+ signoff: true
29
+
30
+
31
+
.github/workflows/checksum_checker.yaml ADDED
@@ -0,0 +1,47 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ name: Check if checksums are up-to-date
2
+ on:
3
+ schedule:
4
+ - cron: 0 20 * * *
5
+ workflow_dispatch:
6
+ jobs:
7
+ checksum_check:
8
+ runs-on: arc-runner-set
9
+ steps:
10
+ - name: Force Install GIT latest
11
+ run: |
12
+ sudo apt-get update \
13
+ && sudo apt-get install -y software-properties-common \
14
+ && sudo apt-get update \
15
+ && sudo add-apt-repository -y ppa:git-core/ppa \
16
+ && sudo apt-get update \
17
+ && sudo apt-get install -y git
18
+ - uses: actions/checkout@v4
19
+ - name: Install dependencies
20
+ run: |
21
+ sudo apt-get update
22
+ sudo apt-get install -y pip wget
23
+ sudo pip install --upgrade pip
24
+ pip install huggingface_hub
25
+ - name: 'Setup yq'
26
+ uses: dcarbone/install-yq-action@v1.1.1
27
+ with:
28
+ version: 'v4.44.2'
29
+ download-compressed: true
30
+ force: true
31
+
32
+ - name: Checksum checker 🔧
33
+ run: |
34
+ export HF_HOME=/hf_cache
35
+ sudo mkdir /hf_cache
36
+ sudo chmod 777 /hf_cache
37
+ bash .github/checksum_checker.sh gallery/index.yaml
38
+ - name: Create Pull Request
39
+ uses: peter-evans/create-pull-request@v7
40
+ with:
41
+ token: ${{ secrets.UPDATE_BOT_TOKEN }}
42
+ push-to-fork: ci-forks/LocalAI
43
+ commit-message: ':arrow_up: Checksum updates in gallery/index.yaml'
44
+ title: 'chore(model-gallery): :arrow_up: update checksum'
45
+ branch: "update/checksum"
46
+ body: Updating checksums in gallery/index.yaml
47
+ signoff: true