Skip to content

Commit f0245fa

Browse files
committed
Reapply "chore(ci): change notifications settings"
This reverts commit 0309615.
1 parent 83534f8 commit f0245fa

File tree

2 files changed

+22
-42
lines changed

2 files changed

+22
-42
lines changed

.github/workflows/notify-models.yaml

Lines changed: 15 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,12 @@ permissions:
1111
jobs:
1212
notify-discord:
1313
if: ${{ (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'area/ai-model')) }}
14-
env:
15-
MODEL_NAME: gemma-3-12b-it-qat
1614
runs-on: ubuntu-latest
1715
steps:
1816
- uses: actions/checkout@v5
1917
with:
2018
fetch-depth: 0 # needed to checkout all branches for this Action to work
2119
ref: ${{ github.event.pull_request.head.sha }} # Checkout the PR head to get the actual changes
22-
- uses: mudler/localai-github-action@v1
23-
with:
24-
model: 'gemma-3-12b-it-qat' # Any from models.localai.io, or from huggingface.com with: "huggingface://<repository>/file"
25-
# Check the PR diff using the current branch and the base branch of the PR
2620
- uses: GrantBirki/[email protected]
2721
id: git-diff-action
2822
with:
@@ -32,16 +26,16 @@ jobs:
3226
- name: Summarize
3327
env:
3428
DIFF: ${{ steps.git-diff-action.outputs.raw-diff-path }}
29+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
30+
OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }}
31+
OPENAI_MODEL: "gemma-3-27b-it-qat"
3532
id: summarize
3633
run: |
3734
input="$(cat $DIFF)"
3835
39-
# Define the LocalAI API endpoint
40-
API_URL="http://localhost:8080/chat/completions"
41-
4236
# Create a JSON payload using jq to handle special characters
4337
json_payload=$(jq -n --arg input "$input" '{
44-
model: "'$MODEL_NAME'",
38+
model: "'$OPENAI_MODEL'",
4539
messages: [
4640
{
4741
role: "system",
@@ -54,16 +48,16 @@ jobs:
5448
]
5549
}')
5650
57-
# Send the request to LocalAI
58-
response=$(curl -s -X POST $API_URL \
51+
# Send the request to OpenAI API
52+
response=$(curl -s -X POST $OPENAI_BASE_URL/chat/completions \
5953
-H "Content-Type: application/json" \
54+
-H "Authorization: Bearer $OPENAI_API_KEY" \
6055
-d "$json_payload")
6156
6257
# Extract the summary from the response
6358
summary="$(echo $response | jq -r '.choices[0].message.content')"
6459
6560
# Print the summary
66-
# -H "Authorization: Bearer $API_KEY" \
6761
echo "Summary:"
6862
echo "$summary"
6963
echo "payload sent"
@@ -73,7 +67,6 @@ jobs:
7367
echo "$summary"
7468
echo EOF
7569
} >> "$GITHUB_OUTPUT"
76-
docker logs --tail 10 local-ai
7770
- name: Discord notification
7871
env:
7972
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK_URL }}
@@ -91,20 +84,12 @@ jobs:
9184
limit-access-to-actor: true
9285
notify-twitter:
9386
if: ${{ (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'area/ai-model')) }}
94-
env:
95-
MODEL_NAME: gemma-3-12b-it-qat
9687
runs-on: ubuntu-latest
9788
steps:
9889
- uses: actions/checkout@v5
9990
with:
10091
fetch-depth: 0 # needed to checkout all branches for this Action to work
10192
ref: ${{ github.event.pull_request.head.sha }} # Checkout the PR head to get the actual changes
102-
- name: Start LocalAI
103-
run: |
104-
echo "Starting LocalAI..."
105-
docker run -e -ti -d --name local-ai -p 8080:8080 localai/localai:master run --debug $MODEL_NAME
106-
until [ "`docker inspect -f {{.State.Health.Status}} local-ai`" == "healthy" ]; do echo "Waiting for container to be ready"; docker logs --tail 10 local-ai; sleep 2; done
107-
# Check the PR diff using the current branch and the base branch of the PR
10893
- uses: GrantBirki/[email protected]
10994
id: git-diff-action
11095
with:
@@ -114,20 +99,20 @@ jobs:
11499
- name: Summarize
115100
env:
116101
DIFF: ${{ steps.git-diff-action.outputs.raw-diff-path }}
102+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
103+
OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }}
104+
OPENAI_MODEL: "gemma-3-27b-it-qat"
117105
id: summarize
118106
run: |
119107
input="$(cat $DIFF)"
120108
121-
# Define the LocalAI API endpoint
122-
API_URL="http://localhost:8080/chat/completions"
123-
124109
# Create a JSON payload using jq to handle special characters
125110
json_payload=$(jq -n --arg input "$input" '{
126-
model: "'$MODEL_NAME'",
111+
model: "'$OPENAI_MODEL'",
127112
messages: [
128113
{
129114
role: "system",
130-
content: "You are LocalAI-bot. Write a twitter message to notify everyone about the new model from the git diff. Make it informal and really short. An example can include: the name, and a brief description of the model if exists. Also add an hint on how to install it in LocalAI. For example: local-ai run model_name_here"
115+
content: "You are LocalAI-bot. Write a short, twitter message to notify everyone about the new model from the git diff. Make it informal and really short, less than 250 characters. An example can include: the name, and a brief description of the model if exists. Also add an hint on how to install it in LocalAI. For example: local-ai run model_name_here"
131116
},
132117
{
133118
role: "user",
@@ -136,16 +121,16 @@ jobs:
136121
]
137122
}')
138123
139-
# Send the request to LocalAI
140-
response=$(curl -s -X POST $API_URL \
124+
# Send the request to OpenAI API
125+
response=$(curl -s -X POST $OPENAI_BASE_URL/chat/completions \
141126
-H "Content-Type: application/json" \
127+
-H "Authorization: Bearer $OPENAI_API_KEY" \
142128
-d "$json_payload")
143129
144130
# Extract the summary from the response
145131
summary="$(echo $response | jq -r '.choices[0].message.content')"
146132
147133
# Print the summary
148-
# -H "Authorization: Bearer $API_KEY" \
149134
echo "Summary:"
150135
echo "$summary"
151136
echo "payload sent"
@@ -155,7 +140,6 @@ jobs:
155140
echo "$summary"
156141
echo EOF
157142
} >> "$GITHUB_OUTPUT"
158-
docker logs --tail 10 local-ai
159143
- uses: Eomm/why-don-t-you-tweet@v2
160144
with:
161145
tweet-message: ${{ steps.summarize.outputs.message }}

.github/workflows/notify-releases.yaml

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,18 @@ jobs:
1111
RELEASE_BODY: ${{ github.event.release.body }}
1212
RELEASE_TITLE: ${{ github.event.release.name }}
1313
RELEASE_TAG_NAME: ${{ github.event.release.tag_name }}
14-
MODEL_NAME: gemma-3-12b-it-qat
14+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
15+
OPENAI_BASE_URL: ${{ secrets.OPENAI_BASE_URL }}
16+
OPENAI_MODEL: "gemma-3-27b-it-qat"
1517
steps:
16-
- uses: mudler/localai-github-action@v1
17-
with:
18-
model: 'gemma-3-12b-it-qat' # Any from models.localai.io, or from huggingface.com with: "huggingface://<repository>/file"
1918
- name: Summarize
2019
id: summarize
2120
run: |
2221
input="$RELEASE_TITLE\b$RELEASE_BODY"
2322
24-
# Define the LocalAI API endpoint
25-
API_URL="http://localhost:8080/chat/completions"
26-
2723
# Create a JSON payload using jq to handle special characters
2824
json_payload=$(jq -n --arg input "$input" '{
29-
model: "'$MODEL_NAME'",
25+
model: "'$OPENAI_MODEL'",
3026
messages: [
3127
{
3228
role: "system",
@@ -39,16 +35,16 @@ jobs:
3935
]
4036
}')
4137
42-
# Send the request to LocalAI API
43-
response=$(curl -s -X POST $API_URL \
38+
# Send the request to OpenAI API
39+
response=$(curl -s -X POST $OPENAI_BASE_URL/chat/completions \
4440
-H "Content-Type: application/json" \
41+
-H "Authorization: Bearer $OPENAI_API_KEY" \
4542
-d "$json_payload")
4643
4744
# Extract the summary from the response
4845
summary=$(echo $response | jq -r '.choices[0].message.content')
4946
5047
# Print the summary
51-
# -H "Authorization: Bearer $API_KEY" \
5248
{
5349
echo 'message<<EOF'
5450
echo "$summary"

0 commit comments

Comments
 (0)