Skip to content

Collection of scripts leveraging Ollama models for automation and productivity

License

Notifications You must be signed in to change notification settings

vdemeester/ollama-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

Ollama Scripts

A collection of scripts leveraging Ollama models for automation and productivity.

Scripts

propose-labels.py

Automatically suggest and apply labels to GitHub issues using Ollama LLMs.

Features:

  • 🤖 AI-powered label suggestions with confidence scores
  • 🎯 Multi-model consensus for validation
  • 💬 Analyzes issue title, body, and comments
  • 🎨 Color-coded terminal output
  • 🔍 Smart filtering (unlabeled, needs triage)
  • ✨ Configurable confidence thresholds
  • 🚀 Can automatically apply labels

Requirements:

  • Python 3.11+
  • uv (automatically installs dependencies)
  • Access to an Ollama server

Quick Start:

# Make script executable
chmod +x propose-labels.py

# List available models
./propose-labels.py --list-models

# Analyze issues (dry-run, no changes)
./propose-labels.py owner/repo --limit 5

# Process unlabeled issues
./propose-labels.py owner/repo --unlabeled --limit 10

# Use multiple models for consensus
./propose-labels.py owner/repo --models "phi3.5:3.8b,llama3.1:8b"

# Apply labels (requires GitHub token with write access)
./propose-labels.py owner/repo --apply --github-token $GITHUB_TOKEN

Options:

usage: propose-labels.py [-h] [--github-token GITHUB_TOKEN] [--model MODEL]
                         [--models MODELS] [--no-comments]
                         [--ollama-url OLLAMA_URL] [--issue-number ISSUE_NUMBER]
                         [--limit LIMIT] [--unlabeled] [--needs-triage]
                         [--confidence CONFIDENCE] [--ignore-labels IGNORE_LABELS]
                         [--apply] [--existing-boost EXISTING_BOOST]
                         [--verbose] [--list-models]
                         repo

Propose GitHub issue labels using Ollama

positional arguments:
  repo                  GitHub repository in format owner/name

optional arguments:
  --github-token        GitHub personal access token
  --model               Ollama model name (default: phi3.5:3.8b)
  --models              Comma-separated list of models for consensus
  --no-comments         Exclude issue comments (included by default)
  --ollama-url          Ollama server URL (default: https://llm.sbr.pm)
  --issue-number        Process only a specific issue number
  --limit               Number of issues to process (default: 5)
  --unlabeled           Only process issues with no labels
  --needs-triage        Only process issues missing area/ or kind/ labels
  --confidence          Minimum confidence threshold 0-100 (default: 75)
  --ignore-labels       Patterns of labels to ignore (default: priority/*,size/*,etc.)
  --apply               Actually apply labels (requires --github-token)
  --existing-boost      Confidence boost for existing labels (default: 20)
  -v, --verbose         Show verbose output
  --list-models         List available models from Ollama server

Examples:

# Triage workflow: find unlabeled issues and suggest labels
./propose-labels.py tektoncd/pipeline --unlabeled -v

# High-confidence only
./propose-labels.py tektoncd/pipeline --confidence 90

# Multi-model validation before applying
./propose-labels.py myorg/myrepo \
  --models "phi3.5:3.8b,llama3.1:8b,qwen2.5-coder:7b" \
  --needs-triage \
  --apply \
  --github-token $GITHUB_TOKEN

Default Ignored Labels:

The script automatically ignores automation and process labels:

  • priority/* - Priority decisions (human)
  • size/* - Size labels (automation)
  • approved, lgtm - PR approval
  • needs-ok-to-test - PR automation
  • release-note* - Release notes
  • cla* - CLA labels
  • lifecycle/* - Lifecycle management
  • do-not-merge/* - Merge control

License

MIT License - see LICENSE file for details

Contributing

Contributions welcome! Feel free to open issues or pull requests.

About

Collection of scripts leveraging Ollama models for automation and productivity

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages