> For the complete documentation index, see [llms.txt](https://docs.loci-dev.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.loci-dev.net/ai-binary-analysis-in-your-ci-cd/quick-start-loci-github-integration.md).

# Quick-Start LOCI GitHub Integration

LOCI Quick-Start User Flow

The **LOCI AI Agent** GitHub integration enables developers and engineering teams to automate performance analysis directly within their existing GitHub CI/CD workflows. By connecting LOCI's hardware-aware optimization engine with GitHub Actions and the LOCI GitHub App, teams gain immediate visibility into the performance impact of every commit, build, and pull request.

***

### User Flow Overview

<figure><img src="https://449949240-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FS2ZTr9umTUpVzGSJHbuR%2Fuploads%2FLZqVbAjVd21awYv0j6Ud%2Floci-github-user-flow.png?alt=media&amp;token=3748bae4-63d5-467a-8f02-bc49371d1372" alt=""><figcaption></figcaption></figure>

**Setup steps (1–3)** are performed once per repository.&#x20;

**Usage steps (4–5)** repeat automatically on every pull request.

***

### Step-by-Step Guide

#### Step 1 — Install the LOCI GitHub App

Go to <https://github.com/marketplace/loci-agentic-ai> and install the app on your repository. This enables LOCI to post automated performance analysis comments directly on your pull requests. An active LOCI license is required (free plans available).

***

#### Step 2 — Add Your Credentials to GitHub

In your repository settings, add two values:

* `LOCI_API_KEY` — as a GitHub Secret
* `LOCI_BACKEND_URL` — as a GitHub Variable

Optionally add `LOCI_GITHUB_TOKEN` to enable workflow summary integration. These credentials connect the LOCI Action to your licensed backend.

***

#### Step 3 — Add the LOCI Action to Your CI Workflow

Add the [LOCI Action](https://github.com/marketplace/actions/loci-action) to your existing `.github/workflows` file. The action runs in two steps: **upload** (build and ship your binary after compilation) and **summary** (wait for analysis and attach the Agent Report to the workflow run).

This snippet is a single step — add it to the `steps:` list of a job in your existing `.github/workflows` file, after your build step.

<pre class="language-yaml"><code class="lang-yaml"><strong>- name: Upload to LOCI
</strong>  uses: auroralabs-loci/loci-action@v1
  env:
    LOCI_BACKEND_URL: '${{ vars.LOCI_BACKEND_URL }}'
    LOCI_API_KEY: '${{ secrets.LOCI_API_KEY }}'
  with:
    mode: upload
    project: my-project
</code></pre>

***

#### Step 4 — Open a Pull Request

Push a branch and open a PR as normal. LOCI automatically detects the changed functions, compiles the before/after binaries, and runs hardware-aware analysis — no manual trigger needed.

***

#### Step 5 — Review the LOCI Report

LOCI posts its findings directly in the PR as a comment from the `loci-review` \[Bot]. The report includes:

* Execution timing and energy deltas per changed function
* Flame graph comparison between base and target versions (when relevant)
* Control-flow analysis highlighting call-depth changes
* Agent Summary with optimization recommendations and a pass/fail performance check

***

### Next Steps

* [Explore the full PR Insights Report in LOCI Inspector](/loci-inspector.md)
* [Explore the full GitHub Actions reference](https://github.com/marketplace/actions/loci-action)
* [View a live example PR](https://github.com/auroralabs-loci/llama.cpp/pull/1361)
