Skip to main content

Streamlit app for managing Windsurf credit caps

Project description

Windsurf Credit Throttle

A Streamlit application for managing Windsurf add-on credit caps.

Features

  • Verify Credit Caps: Check team-level and individual user credit configurations
  • Set Team Cap: Configure organization-wide add-on credit limits
  • Set Individual Caps: Set custom caps for specific users or bulk import from CSV

Installation

Using uvx (recommended)

# Run directly from GitHub
uvx --from git+https://github.com/rappdw/windsurf-throttle windsurf-throttle

# Or from PyPI (when published)
uvx windsurf-throttle

Using pip

pip install windsurf-throttle
windsurf-throttle

From source

git clone https://github.com/rappdw/windsurf-throttle.git
cd windsurf-throttle
uv sync
uv run windsurf-throttle

Configuration

Set your Windsurf service key as an environment variable:

export WINDSURF_SERVICE_KEY=your_service_key_here

Or create a .env file in your working directory:

WINDSURF_SERVICE_KEY=your_service_key_here

Optional Configuration

# Override the API base URL (default: https://server.codeium.com)
export WINDSURF_BASE_URL=https://custom.server.com

Usage

Running the App

# Using the CLI
windsurf-throttle

# Or run Streamlit directly
streamlit run src/windsurf_throttle/app.py

Credit Cap Strategy

The app implements the following strategy:

  1. Base Credits: Each user gets 500 base credits
  2. Organization Cap: Set a default add-on cap for all users (e.g., 1000)
  3. Individual Caps: For high-usage users, set individual caps = current add-on usage + buffer

Example:

  • User with 1200 total credits used → 700 add-on credits used
  • Individual cap = 700 + 500 buffer = 1200 add-on credits
  • Total available = 500 base + 1200 add-on = 1700 credits

Bulk CSV Import

Upload a CSV with these columns:

  • email (required): User email address
  • credits_used (required): Current total credit usage
  • name (optional): User display name

Development

# Clone and install dev dependencies
git clone https://github.com/rappdw/windsurf-throttle.git
cd windsurf-throttle
uv sync --all-extras

# Run tests
uv run pytest

# Run linting
uv run ruff check src tests
uv run mypy src

# Install pre-commit hooks
uv run pre-commit install

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

windsurf_throttle-1.0.3.tar.gz (102.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

windsurf_throttle-1.0.3-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file windsurf_throttle-1.0.3.tar.gz.

File metadata

  • Download URL: windsurf_throttle-1.0.3.tar.gz
  • Upload date:
  • Size: 102.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for windsurf_throttle-1.0.3.tar.gz
Algorithm Hash digest
SHA256 b834b637a38b11f177d2a36b8c2443d03408dbaa78d1f84a6c0831a345b1696c
MD5 261d778f49dc5c7412b7a57b4261b2c4
BLAKE2b-256 60b8b78564d75046b5d09849bc25ca4449b9c8a80ba91b8358795ee09a962c21

See more details on using hashes here.

Provenance

The following attestation bundles were made for windsurf_throttle-1.0.3.tar.gz:

Publisher: publish.yml on rappdw/windsurf-throttle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file windsurf_throttle-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for windsurf_throttle-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8b2a814c223154d8e28c0d9ab5cffd6d3367303acba6d06cbf35f8b4efff9b83
MD5 c46c95f87af551d9e8b1c26d399404e9
BLAKE2b-256 e1e069c503bc969ac780b9f6694b7662ac3ec175126b2502240e7781573a745a

See more details on using hashes here.

Provenance

The following attestation bundles were made for windsurf_throttle-1.0.3-py3-none-any.whl:

Publisher: publish.yml on rappdw/windsurf-throttle

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page