Skip to main content

Safyan SDK — The first human-to-AI language. Make every AI prompt better with one line of code.

Project description

safyan

The first human-to-AI language. Make every AI prompt better with one line of code.

Install

pip install safyan

Quick Start — OpenAI Drop-in

Change your base URL. That's it. Every prompt gets optimized automatically.

from openai import OpenAI

client = OpenAI(
    base_url="https://api.safyan.ai/v1",
    api_key="sfk_your_key_here"
)

response = client.chat.completions.create(
    model="safyan-auto",
    messages=[{"role": "user", "content": "explain recursion"}]
)

print(response.choices[0].message.content)

Direct SDK Usage

from safyan import Safyan

client = Safyan(api_key="sfk_your_key_here")

# Optimize a prompt
result = client.optimize("make my code faster", mode="code")
print(result["translation"])

# Score a prompt (0-100)
score = client.score("help me with something")
print(score["total"], score["grade"])  # 22 "F"

# Compile only (no AI call, instant)
compiled = client.compile("write tests for my API")
print(compiled["compiled"])

Anthropic Drop-in

from safyan.anthropic import SafyanAnthropic

client = SafyanAnthropic(safyan_api_key="sfk_your_key_here")

message = client.messages.create(
    model="safyan-auto",
    max_tokens=1024,
    messages=[{"role": "user", "content": "explain recursion"}]
)

print(message.content[0].text)

Models

  • safyan-auto — full optimization + smart model routing
  • safyan-fast — compile only, half the cost

Get Your API Key

  1. Sign up at safyan.ai
  2. Go to safyan.ai/console
  3. Create a key (starts with sfk_)

Links

License

MIT — AQ Holdings Inc.

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

safyan-1.0.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

safyan-1.0.0-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for safyan-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4e662a6c7efdaa64bcc68be6ba54c216c6350d19ff5a0642f7adb2f659057f1c
MD5 487034414180217afcae432ad1c0f24d
BLAKE2b-256 cf22e4cc1e03f96b075f503edbccc844108cede8f574b9060b5998313d578f0b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: safyan-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for safyan-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 582156ef48e5b1b929bed7ccf04ff55d704ca7693698b2f9f81e29d59698c2c3
MD5 772c7e6d9439a1b9b47e298bd9909095
BLAKE2b-256 c1dcb009ee126209e1fcf44d98e6932ff9242d8d412ca5dc1448111ecf534913

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