Skip to main content

AI token optimization SDK — reduce LLM API costs by 10-20%

Project description

Fortress Optimizer

Reduce your AI API costs by 10-20% with real-time prompt optimization.

Install

pip install fortress-optimizer

Quick Start

from fortress_optimizer import FortressClient

client = FortressClient(api_key="fk_your_key_here")

# Optimize a prompt
result = client.optimize("Can you please help me write a detailed analysis of this data")

print(result["optimization"]["optimized_prompt"])
# → "Write a detailed analysis of this data"

print(f"Saved {result['tokens']['savings_percentage']}% tokens")
# → "Saved 40.0% tokens"

Features

  • 10-20% token savings on casual and business prompts
  • 3 optimization levels: conservative, balanced, aggressive
  • All major LLM providers: OpenAI, Anthropic, Google, and more
  • Automatic retries with exponential backoff
  • Usage tracking per API key

API

# Optimize a prompt
result = client.optimize(prompt, level="balanced", provider="openai")

# Check usage
usage = client.get_usage()

# List providers
providers = client.get_providers()

# Health check
is_healthy = client.health_check()

Get an API Key

Sign up free at fortress-optimizer.com — 50,000 tokens/month, no credit card required.

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

fortress_optimizer-1.0.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

fortress_optimizer-1.0.0-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file fortress_optimizer-1.0.0.tar.gz.

File metadata

  • Download URL: fortress_optimizer-1.0.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for fortress_optimizer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2fc2fbdcbe6514f02cd1604807423c2cb001fe904928ee19a05628159de5939e
MD5 e1abeeae409ae808e79953f36c170b97
BLAKE2b-256 186e39f044855ed5da570a18ccf92e44925fa5baf438870cb23a0a28d60c59ba

See more details on using hashes here.

File details

Details for the file fortress_optimizer-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for fortress_optimizer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1f935816effd4119cad937db088e3e070c904af015ee6f2ff0d07ee95072cdd6
MD5 5cfb0042b88dd9cab75204dfd95e2082
BLAKE2b-256 98a67bf056dc24fdf66482f75540aa3eee14bd6e047387ef8ea6820f1a2e6ccc

See more details on using hashes here.

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