Skip to content

Add AgentLenz — AI agent cost optimization #682

@AdelElo13

Description

@AdelElo13

AgentLenz

URL: https://github.com/AdelElo13/agentlenz
PyPI: pip install agentlenz

Description

Cut your AI agent costs across every provider. Not just observability — optimization. AgentLenz traces agent behavior, detects waste, recommends cheaper model routing, and enforces per-task budgets.

Key Features

  • Provider-agnostic: Works with Anthropic, OpenAI, and any LLM provider via SDK wrapping
  • Cost tracing: Automatic token/cost tracking per task, per agent, per session
  • Model routing optimization: Detects when expensive models are used for simple tasks and recommends cheaper alternatives
  • Budget enforcement: Set per-task cost limits that kill runaway agent loops
  • Dashboard: Next.js web UI for visualizing agent costs and optimization opportunities

Packages

  • sdk/ — Python SDK (open-source, PyPI: agentlenz)
  • backend/ — FastAPI API server
  • dashboard/ — Next.js web dashboard

Quick Start

import agentlenz
import anthropic

agentlenz.init(api_key="alz_...")
client = agentlenz.wrap(anthropic.Anthropic())
# Use client as normal — AgentLenz tracks costs automatically

Category suggestion

Developer tools / Observability & Cost optimization

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