{"id":15441652,"url":"https://github.com/mudler/localai-github-action","last_synced_at":"2025-04-14T18:51:36.400Z","repository":{"id":248764047,"uuid":"829639577","full_name":"mudler/localai-github-action","owner":"mudler","description":"LocalAI github action","archived":false,"fork":false,"pushed_at":"2024-07-20T07:29:02.000Z","size":12,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T03:41:39.706Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mudler.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-16T20:57:30.000Z","updated_at":"2025-03-25T08:26:52.000Z","dependencies_parsed_at":"2024-07-17T01:31:46.471Z","dependency_job_id":"3a8df941-3fd3-4092-a6b3-1430342577b4","html_url":"https://github.com/mudler/localai-github-action","commit_stats":null,"previous_names":["mudler/localai-github-action"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudler%2Flocalai-github-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudler%2Flocalai-github-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudler%2Flocalai-github-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mudler%2Flocalai-github-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mudler","download_url":"https://codeload.github.com/mudler/localai-github-action/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248941531,"owners_count":21186915,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T19:21:51.774Z","updated_at":"2025-04-14T18:51:36.379Z","avatar_url":"https://github.com/mudler.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# localai-github-action\n\nA dead simple Github action which allows to run [LocalAI](https://github.com/mudler/LocalAI) in the Github action runner workflow.\n\nExample usage:\n```yaml\non: [push]\n\njobs:\n  hello_world_job:\n    runs-on: ubuntu-latest\n    name: A job to say hello\n    steps:\n      - uses: actions/checkout@v4\n      - id: foo\n        uses: mudler/localai-github-action@v1\n        with:\n          model: 'hermes-2-theta-llama-3-8b' # Any from models.localai.io, or from huggingface.com with: \"huggingface://\u003crepository\u003e/file\"\n      - name: Greet\n        id: greet\n        run: |\n                input=\"Hello!\"\n\n                # Define the LocalAI API endpoint\n                API_URL=\"http://localhost:8080/chat/completions\"\n\n                # Create a JSON payload using jq to handle special characters\n                json_payload=$(jq -n --arg input \"$input\" '{\n                model: \"'$MODEL_NAME'\",\n                messages: [\n                    {\n                    role: \"system\",\n                    content: \"You are a friendly companion\"\n                    },\n                    {\n                    role: \"user\",\n                    content: $input\n                    }\n                ]\n                }')\n\n                # Send the request to LocalAI\n                response=$(curl -s -X POST $API_URL \\\n                -H \"Content-Type: application/json\" \\\n                -d \"$json_payload\")\n\n                # Extract the result from the response\n                result=\"$(echo $response | jq -r '.choices[0].message.content')\"\n\n                # Print the result\n                echo \"Result:\"\n                echo \"$result\"\n                echo \"payload sent\"\n                echo \"$json_payload\"\n                {\n                    echo 'message\u003c\u003cEOF'\n                    echo \"$result\"\n                    echo EOF\n                } \u003e\u003e \"$GITHUB_OUTPUT\"\n                # now the output can be consumed with ${{ steps.greet.outputs.message }} by other steps\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmudler%2Flocalai-github-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmudler%2Flocalai-github-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmudler%2Flocalai-github-action/lists"}