Skip to content

Add margin configuration via UI #788

Description

@luanpaschoal

AISIX currently does not support configuring provider margins directly through the interface. This improvement would allow administrators to set percentage or fixed margins on provider costs without editing configuration files, making the process more user‑friendly.

Reference: LiteLLM Proxy Provider Margins

Motivation

  • Simplify margin management for non‑technical users
  • Enable resellers to apply margins transparently
  • Improve cost control and pricing flexibility

Proposed Implementation

  • Add a Margin field in the provider settings screen
  • Support both percentage (e.g., 10%) and fixed values (e.g., +0.002)
  • Validate inputs to prevent formatting errors
  • Display applied margins in reports and metrics

Acceptance Criteria

  • Margin field available in provider configuration UI
  • Support for percentage and fixed values
  • Correct application of margins in cost calculations
  • Input validation and clear error messages
  • Documentation updated with usage instructions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions