Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/onenot8/issueLoop/llms.txt

Use this file to discover all available pages before exploring further.

When create_tickets runs, IssueLoop sends each test failure block to an LLM with a triage prompt asking it to identify distinct, independent problems and write a summary for each one. The result is the set of tickets written to your database. Getting the provider configuration right matters — a slow or unavailable model means the triage step blocks. IssueLoop solves this with a fallback chain: you declare a priority-ordered list of providers, and IssueLoop tries them in order, automatically moving to the next one if any exception occurs.

Ollama (default)

Out of the box, IssueLoop uses a local Ollama instance with no configuration required. If you call issueloop.use() without an llm argument — or skip use() entirely — these defaults apply:
SettingDefault
provider"ollama"
model"qwen2.5-coder:7b"
base_url"http://localhost:11434"
token_size1024
import issueloop

# No use() call needed — Ollama is the default.
issueloop.create_tickets("myrepo")
If a config/provider_config.yaml file exists, IssueLoop reads it and overrides the defaults when the active provider is still the unmodified Ollama default. This lets you change the model without touching your code. See the provider_config.yaml section below. A setup script for Ollama is included in the repository at setup/setup_ollama.sh.

Anthropic

Anthropic requires an API key. Pass it via issueloop.use():
import issueloop

issueloop.use(
    llm={
        "provider": "anthropic",
        "model": "claude-sonnet-4-6",
        "api_key": "sk-ant-...",
        "token_size": 1024,
    }
)
Both api_key and apiKey are accepted — see the camelCase / snake_case note below. If api_key is missing when the Anthropic provider is called, create_tickets raises ValueError: llm.apiKey required for provider='anthropic'.

OpenAI

OpenAI also requires an API key:
import issueloop

issueloop.use(
    llm={
        "provider": "openai",
        "model": "gpt-4o",
        "api_key": "sk-...",
        "token_size": 1024,
    }
)
IssueLoop calls POST https://api.openai.com/v1/chat/completions directly using the requests library — no OpenAI SDK required.

Multi-provider fallback chain

Wrap multiple provider dicts in a "providers" list to build a fallback chain. IssueLoop tries each provider in the order listed. If any exception occurs — network error, rate limit, invalid API key — it logs the error, moves to the next provider, and only re-raises if the last provider also fails.
import issueloop

issueloop.use(
    database="local",
    llm={
        "providers": [
            {
                "provider": "anthropic",
                "model": "claude-sonnet-4-6",
                "api_key": "sk-ant-...",
            },
            {
                "provider": "ollama",
                "model": "qwen2.5-coder:7b",
            },
        ]
    },
)
In this configuration, IssueLoop tries Anthropic first. If Anthropic is unavailable or returns an error, it falls back to the local Ollama instance automatically — no code change required and no manual retry logic needed. You can check the current provider priority order at runtime:
status = issueloop.get_llm_provider_status()
print(status)
# {
#   "priority_order": [
#     {"provider": "anthropic", "model": "claude-sonnet-4-6", "has_api_key": true},
#     {"provider": "ollama", "model": "qwen2.5-coder:7b", "has_api_key": false}
#   ],
#   "primary": "anthropic",
#   "fallback_count": 1
# }

Token size

token_size (or tokenSize) sets the max_tokens parameter sent to the LLM. It applies to Anthropic and OpenAI; Ollama does not use it. The default is 1024.
issueloop.use(
    llm={
        "provider": "anthropic",
        "model": "claude-sonnet-4-6",
        "api_key": "sk-ant-...",
        "token_size": 2048,   # or tokenSize=2048
    }
)
Increase token_size if you find that triage responses are being cut off when test failure output is long.

Token usage tracking

IssueLoop records every LLM call to data/logs/llm_usage.jsonl. Three functions read this log:
# Total consumption across all providers (or filtered to one)
totals = issueloop.get_token_consumption()
# {"prompt_tokens": 4200, "completion_tokens": 890, "total_tokens": 5090, "calls": 12}

totals_anthropic = issueloop.get_token_consumption("anthropic")

# Breakdown by provider
by_provider = issueloop.get_token_consumption_by_provider()
# {"anthropic": {"prompt_tokens": 3100, ...}, "ollama": {"prompt_tokens": 1100, ...}}

# Raw call history (most recent N entries)
history = issueloop.get_llm_call_history(limit=10)
# [{"ts": "...", "provider": "anthropic", "model": "claude-sonnet-4-6",
#   "prompt_tokens": 350, "completion_tokens": 74, "total_tokens": 424}, ...]
Each entry in the usage log has ts, provider, model, prompt_tokens, completion_tokens, and total_tokens.

provider_config.yaml

For setups where you do not want to call issueloop.use() in code — for example, a shared environment where the model is configured at deployment time — you can place a config/provider_config.yaml file in your working directory. IssueLoop reads this file automatically when the active provider is still the unmodified Ollama default (no explicit use() call has been made). The structure mirrors the config fields:
reasoning:
  provider: ollama
  model: qwen2.5-coder:7b
  base_url: http://localhost:11434
To switch to a different Ollama model without touching code:
reasoning:
  provider: ollama
  model: deepseek-coder-v2:16b
  base_url: http://localhost:11434
The file is resolved in priority order: ISSUELOOP_PROVIDER_CONFIG_PATH env var → ./config/provider_config.yamlconfig/ in the IssueLoop checkout → bundled package default.
camelCase / snake_case — both spellings work everywhere. api_key and apiKey are equivalent, as are token_size and tokenSize, and base_url and baseUrl. IssueLoop normalises both forms when it builds the internal LLMConfig object, so you can use whichever convention fits your codebase.

Build docs developers (and LLMs) love