Tip
AI inference request GitHub Models via this GitHub Action.
Compare available AI models to choose the best one for your use-case.
on:
issues:
types: opened
jobs:
summary:
runs-on: ubuntu-latest
permissions:
issues: write
models: read
steps:
- name: Summarize issue
id: prompt
uses: op5dev/ai-inference-request@v2
with:
payload: |
model: openai/gpt-4.1-mini
messages:
- role: system
content: You are a helpful assistant running within GitHub CI.
- role: user
content: Concisely summarize this GitHub issue titled ${{ github.event.issue.title }}: ${{ github.event.issue.body }}
max_tokens: 100
temperature: 0.9
top_p: 0.9
- name: Comment summary
run: gh issue comment $NUMBER --body "$SUMMARY"
env:
GH_TOKEN: ${{ github.token }}
NUMBER: ${{ github.event.issue.number }}
SUMMARY: ${{ steps.prompt.outputs.response }}
Either payload
or payload-file
is required with at least model
and messages
parameters, per documentation.
Type | Name | Description |
---|---|---|
Data | payload |
Body parameters of the inference request in YAML format. Example: model… |
Data | payload-file |
Path to a file containing the body parameters of the inference request. Example: ./payload.{json,yml} |
Config | show-payload |
Whether to show the payload in the logs. Default: true |
Config | show-response |
Whether to show the response content in the logs. Default: true |
Admin | github-api-version |
GitHub API version. Default: 2022-11-28 |
Admin | github-token |
GitHub token. Default: github.token |
Admin | org |
Organization for request attribution. Example: github.repository_owner |
Name | Description |
---|---|
response |
Response content from the inference request. |
response-file |
File path containing the complete, raw response. |
payload |
Body parameters of the inference request in JSON format. |
View security policy and reporting instructions.
Tip
Pin your GitHub Action to a commit SHA to harden your CI/CD pipeline security against supply chain attacks.
View all notable changes to this project in Keep a Changelog format, which adheres to Semantic Versioning.
Tip
All forms of contribution are very welcome and deeply appreciated for fostering open-source projects.
- Create a PR to contribute changes you'd like to see.
- Raise an issue to propose changes or report unexpected behavior.
- Open a discussion to discuss broader topics or questions.
- Become a stargazer if you find this project useful.
- This project is licensed under the permissive Apache License 2.0.
- All works herein are my own, shared of my own volition, and contributors.
- Copyright 2016-present Rishav Dhar — All wrongs reserved.