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 routingsafyan-fast— compile only, half the cost
Get Your API Key
- Sign up at safyan.ai
- Go to safyan.ai/console
- Create a key (starts with
sfk_)
Links
License
MIT — AQ Holdings Inc.
Project details
Release history Release notifications | RSS feed
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)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4e662a6c7efdaa64bcc68be6ba54c216c6350d19ff5a0642f7adb2f659057f1c
|
|
| MD5 |
487034414180217afcae432ad1c0f24d
|
|
| BLAKE2b-256 |
cf22e4cc1e03f96b075f503edbccc844108cede8f574b9060b5998313d578f0b
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
582156ef48e5b1b929bed7ccf04ff55d704ca7693698b2f9f81e29d59698c2c3
|
|
| MD5 |
772c7e6d9439a1b9b47e298bd9909095
|
|
| BLAKE2b-256 |
c1dcb009ee126209e1fcf44d98e6932ff9242d8d412ca5dc1448111ecf534913
|