Using PR-Agent with Sakura AI Engine
Programming
Published: 2025-09-24

This article explains how to build a PR-Agent using the “Sakura AI Engine” provided by Sakura Internet. As someone inside Sakura Internet, there’s no option not to use this for development.

What is Sakura AI Engine?

The “Sakura AI Engine,” a generative AI platform from Sakura Internet, is a service that allows you to utilize generative AI models offered by Sakura Internet.

The "Sakura AI Engine" is a pay-as-you-go platform service that allows you to use various generative AI models. 
All supported LLM models are hosted by Sakura Internet, ensuring that all data is exchanged solely between you and Sakura Internet. 
Data used for chat completion, etc., is not utilized for training LLM models, making it a highly secure service.

Being offered by a domestic company, one of its features is that data is not sent overseas, providing a sense of security.

What is PR-Agent?

PR-Agent is a tool that automatically reviews GitHub pull requests using LLM (Large Language Model). PR-Agent can understand code changes and point out potential issues or improvements. This allows developers to reduce the burden of code review and focus more on improving quality.

Using PR-Agent with Sakura AI Engine

Follow the manual to obtain your Sakura AI Engine account token.

Setting TOKEN for the Repository Using PR-Agent

Go to your GitHub repository’s Settings > Secrets and variables > Actions and add a secret named SAKURA_AI_ENGINE_API_KEY.

secret

secret token

Configuring GitHub Actions

PR-Agent operates using GitHub Actions. Create a YAML file in the repository’s .github/workflows directory as follows. In this case, the model used will be Qwen3-Coder-480B-A35B-Instruct-FP8:

name: PR-Agent
on:
  pull_request:
    types: [opened, reopened, synchronize, ready_for_review]
  issue_comment:
    types: [created, edited]
  workflow_dispatch:

permissions:
  issues: write
  pull-requests: write
  contents: write

jobs:
  pr_agent_job:
    runs-on: ubuntu-latest
    name: Run pr agent on every pull request
    steps:
      - name: PR Agent action step
        id: pragent
        uses: qodo-ai/pr-agent@main
        env:
          OPENAI_KEY: ${{ secrets.SAKURA_AI_ENGINE_API_KEY }}
          OPENAI__API_BASE: https://api.ai.sakura.ad.jp/v1
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          github_action_config.auto_review: "true"
          github_action_config.auto_describe: "true"
          github_action_config.auto_improve: "true"
          config.model: "openai/Qwen3-Coder-480B-A35B-Instruct-FP8"
          config.custom_model_max_tokens: "100000"
          config.fallback_models: '[ "openai/Qwen3-Coder-480B-A35B-Instruct-FP8" ]'
          pr_reviewer.extra_instructions: >-
            Please respond in Japanese.            
          pr_description.extra_instructions: >-
            Please respond in Japanese.            
          pr_code_suggestions.extra_instructions: >-
            Please respond in Japanese.            
          pr_code_suggestions.num_code_suggestions: "2"

Note: Do not forget to prefix the model name with openai/; otherwise, PR-Agent will not recognize it.

Try It Out

Once the PR-Agent’s GitHub Actions are triggered, automatic review comments will be added to the pull request. To demonstrate, let’s create a main.go file with potential issues and create a PR.

package main

import (
	"fmt"
	"io/ioutil"
	"net/http"
)

func main() {
	http.HandleFunc("/", handler)
	http.ListenAndServe(":8080", nil)
}

func handler(w http.ResponseWriter, r *http.Request) {
	name := r.URL.Query().Get("name")
	if name == "" {
		name = "World"
	}
	body, err := ioutil.ReadAll(r.Body)
	if err != nil {
		http.Error(w, "Unable to read body", http.StatusBadRequest)
		return
	}
	r.Body.Close()

	fmt.Fprintf(w, "Hello, %s!", name)
	fmt.Fprintf(w, "\nYou sent: %s", string(body))
}

func calculate(x int, y int) int {
	result := x + y
	return result
}

func processData(data []string) {
	for _, item := range data {
		fmt.Println(item)
	}
}

Upon creating the PR, the CI for PR-Agent will start working.

pr-agent-ci

After a while, a description and review comments will be added to the PR.

description

review

Conclusion

  • Test Repository
  • Automated code review achieved using PR-Agent + Sakura AI Engine
  • Sakura AI Engine is a domestic generative AI platform with high data security
  • Data is not sent overseas, providing more peace of mind compared to using OpenAI’s API (psychologically as well)