AI cost optimization library - Save up to 61% on OpenAI API costs
Project description
WOOSAILibrary
๐ AI ๋น์ฉ ์ต์ ํ ๋ผ์ด๋ธ๋ฌ๋ฆฌ - OpenAI API ๋น์ฉ์ ์ต๋ 61% ์ ๊ฐ
๐ฏ ์ฃผ์ ๊ธฐ๋ฅ
- ๐ ๋ฌด๋ฃ ํ๋: ๊ธฐ๋ณธ ์ต์ ํ๋ก 17% ๋น์ฉ ์ ๊ฐ
- โญ ํ๋ฆฌ๋ฏธ์ ํ๋: ์์ AUTO ์ต์ ํ๋ก ์ต๋ 43% ๋น์ฉ ์ ๊ฐ
- ๐ค ์๋ ์ ๋ต ์ ํ: ์ง๋ฌธ ๊ธธ์ด์ ๋ฐ๋ผ ์ต์ ์ ๋ต ์๋ ์ ํ
- ๐ ๊ฐ๋จํ ๋ผ์ด์ ์ค: ๋ผ์ด์ ์ค ํค๋ก ์ฆ์ ํ๋ฆฌ๋ฏธ์ ํ์ฑํ
- ๐ ์์ธ ํต๊ณ: ํ ํฐ ์ฌ์ฉ๋, ๋น์ฉ, ์ ๊ฐ๋ฅ ์ค์๊ฐ ํ์ธ
๐ฐ ๋น์ฉ ์ ๊ฐ ์์
# ์ผ๋ฐ OpenAI API ์ฌ์ฉ
์ 10,000๊ฐ ์์ฒญ ร $0.001/์์ฒญ = $10.00
# WOOSAILibrary ๋ฌด๋ฃ ํ๋
์ 10,000๊ฐ ์์ฒญ ร $0.00083/์์ฒญ = $8.30 (17% ์ ๊ฐ)
# WOOSAILibrary ํ๋ฆฌ๋ฏธ์ ํ๋
์ 10,000๊ฐ ์์ฒญ ร $0.00057/์์ฒญ = $5.70 (43% ์ ๊ฐ)
โ ์ $4.30 ์ ์ฝ! ์ฐ๊ฐ $51.60 ์ ์ฝ!
๐ฆ ์ค์น
pip install woosailibrary
๐ ๋น ๋ฅธ ์์
๋ฌด๋ฃ ํ๋
from woosailibrary import WoosAI
ai = WoosAI(api_key="sk-your-openai-key")
response = ai.chat("AI๋ ๋ฌด์์ธ๊ฐ์?")
print(response["content"])
# ์ถ๋ ฅ: AI(์ธ๊ณต์ง๋ฅ)๋ ์ธ๊ฐ์ ์ง๋ฅ์ ๋ชจ๋ฐฉํ์ฌ...
print(f"์ ๊ฐ: {response['stats']['savings']}")
# ์ถ๋ ฅ: ์ ๊ฐ: 17%
ํ๋ฆฌ๋ฏธ์ ํ๋
from woosailibrary import WoosAI
ai = WoosAI(
api_key="sk-your-openai-key",
license_key="WOOSAI-PREMIUM-20251119-ABC123"
)
response = ai.chat("์ธ๊ณต์ง๋ฅ ๊ธฐ์ ์ ๋ฐ์ ์ญ์ฌ๋ฅผ ์ค๋ช
ํด์ฃผ์ธ์")
print(f"์ ๋ต: {response['stats']['strategy_used']}")
# ์ถ๋ ฅ: ์ ๋ต: pro
print(f"์ ๊ฐ: {response['stats']['savings']}")
# ์ถ๋ ฅ: ์ ๊ฐ: 43%
ํ๊ฒฝ ๋ณ์ ์ฌ์ฉ (์ถ์ฒ)
# .env ํ์ผ
OPENAI_API_KEY=sk-your-key
WOOSAI_LICENSE=WOOSAI-PREMIUM-20251119-ABC123
from woosailibrary import WoosAI
ai = WoosAI() # ์๋์ผ๋ก ํ๊ฒฝ ๋ณ์์์ ๋ก๋!
response = ai.chat("์ง๋ฌธ")
๐ ํ๋ ๋น๊ต
| ๊ธฐ๋ฅ | ๋ฌด๋ฃ | ํ๋ฆฌ๋ฏธ์ |
|---|---|---|
| ๋น์ฉ ์ ๊ฐ | 17% | ์ต๋ 43% |
| ์ ์์ฒญ ์ | 1,000๊ฐ | 50,000๊ฐ |
| ์ต์ ํ ๋ฐฉ์ | ๊ธฐ๋ณธ (STARTER) | ์์ AUTO |
| ์ ๋ต ์๋ ์ ํ | โ | โ |
| ์์ธ ํต๊ณ | โ | โ |
| ๊ฐ๊ฒฉ | ๋ฌด๋ฃ | $20/์ |
๐ฏ ํ๋ฆฌ๋ฏธ์ AUTO ์ต์ ํ
ํ๋ฆฌ๋ฏธ์ ํ๋์ ์ง๋ฌธ ๊ธธ์ด์ ๋ฐ๋ผ ์๋์ผ๋ก ์ต์ ์ ๋ต์ ์ ํํฉ๋๋ค:
- ์งง์ ์ง๋ฌธ (< 18ํ ํฐ): STARTER ์ ๋ต โ 17% ์ ๊ฐ
- ์ค๊ฐ ์ง๋ฌธ (18-60ํ ํฐ): PRO ์ ๋ต โ 43% ์ ๊ฐ
- ๊ธด ์ง๋ฌธ (> 60ํ ํฐ): PREMIUM ์ ๋ต โ 61% ์ ๊ฐ
ai = WoosAI(license_key="WOOSAI-PREMIUM-...")
# ์งง์ ์ง๋ฌธ
response = ai.chat("AI๋?")
# โ STARTER ์ ๋ต, 17% ์ ๊ฐ
# ๊ธด ์ง๋ฌธ
response = ai.chat("์ธ๊ณต์ง๋ฅ ๊ธฐ์ ์ ๋ฐ์ ์ญ์ฌ์ ํ์ฌ ํ์ฉ ์ฌ๋ก๋ฅผ ์์ธํ ์ค๋ช
ํด์ฃผ์ธ์")
# โ PRO ์ ๋ต, 43% ์ ๊ฐ
๐ ๋ผ์ด์ ์ค ๋ฐ๊ธ
ํ๋ฆฌ๋ฏธ์ ๋ผ์ด์ ์ค๋ WoosAI ํํ์ด์ง์์ ๊ตฌ๋งคํ์ธ์.
๊ฐ๋ฐ/ํ ์คํธ์ฉ ๋ผ์ด์ ์ค ์์ฑ:
python tools/license_generator.py --plan PREMIUM --days 30
๐ API ๋ฌธ์
WoosAI ํด๋์ค
WoosAI(api_key=None, license_key=None)
Parameters:
api_key(str): OpenAI API ํค (๋๋ OPENAI_API_KEY ํ๊ฒฝ ๋ณ์)license_key(str): ํ๋ฆฌ๋ฏธ์ ๋ผ์ด์ ์ค ํค (๋๋ WOOSAI_LICENSE ํ๊ฒฝ ๋ณ์)
chat() ๋ฉ์๋
ai.chat(message, compress=True)
Parameters:
message(str): ์ง๋ฌธ ๋๋ ๋ฉ์์งcompress(bool): ์ ๋ ฅ ์์ถ ์ฌ์ฉ (๊ธฐ๋ณธ๊ฐ: True)
Returns:
{
"content": "AI ๋ต๋ณ ๋ด์ฉ...",
"stats": {
"plan": "๋ฌด๋ฃ ํ๋",
"strategy_used": "starter",
"savings": "17%",
"tokens": {
"input": 11,
"output": 115,
"total": 126,
"saved": 0
},
"cost": {
"input": "$0.000002",
"output": "$0.000069",
"total": "$0.000071"
},
"usage": "1/1000"
},
"error": None
}
๊ธฐํ ๋ฉ์๋
# ํ๋ ์ ๋ณด ํ์ธ
info = ai.get_plan_info()
# ํ๋ ๋น๊ต
ai.compare_plans()
# ์ฌ์ฉ๋ ํ์ธ
usage = ai.get_usage()
๐ ๏ธ ๊ฐ๋ฐ ๋๊ตฌ
๋ผ์ด์ ์ค ์์ฑ
# ํ๋ฆฌ๋ฏธ์ ๋ผ์ด์ ์ค (30์ผ)
python tools/license_generator.py --plan PREMIUM --days 30
# ์ฌ๋ฌ ๊ฐ ์์ฑ
python tools/license_generator.py --plan PREMIUM --days 30 --batch 5
# ๋ผ์ด์ ์ค ๊ฒ์ฆ
python tools/license_generator.py --verify WOOSAI-PREMIUM-20251119-ABC123
๐งช ํ ์คํธ
# ๋ผ์ด์ ์ค ์์คํ
ํ
์คํธ
python tests/test_license.py
# ์ฌ์ฉ ์์ ์คํ
python example_license.py
๐ ๋ผ์ด์ ์ค
MIT License
๐ฅ ์ ์
WoosAI Team
๐ ๋งํฌ
- ํํ์ด์ง: https://woosai.com
- ๋ฌธ์: https://woosai.com/docs
- ํ๋ฆฌ๋ฏธ์ ๊ตฌ๋งค: https://woosai.com/premium
- ์ด์: https://github.com/woosai/woosailibrary/issues
๐ก ๊ธฐ์ฌ
๊ธฐ์ฌ๋ฅผ ํ์ํฉ๋๋ค! Pull Request๋ฅผ ๋ณด๋ด์ฃผ์ธ์.
๐ง ๋ฌธ์
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
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 woosailibrary-1.0.0.tar.gz.
File metadata
- Download URL: woosailibrary-1.0.0.tar.gz
- Upload date:
- Size: 34.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c77d7daac79973e6944d8f495a053291f13db1a2acc8a90559850ee1cbf48a0b
|
|
| MD5 |
9faf2e279fdfc1751ea35db6a7851b5e
|
|
| BLAKE2b-256 |
8d39f857d08e17f07d267a8334becf0fd25e6a1df0456f34e6c8a904ff15585b
|
File details
Details for the file woosailibrary-1.0.0-py3-none-any.whl.
File metadata
- Download URL: woosailibrary-1.0.0-py3-none-any.whl
- Upload date:
- Size: 36.8 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 |
6d106681839a8a407393857bdc7927c6061b94168276ea305065186243aa1bbe
|
|
| MD5 |
09b187e29cc8134fe56f02c0320f196a
|
|
| BLAKE2b-256 |
5a2066608b26febca550b4db709d0563d6253e6156b1b382b6a58664c6706b0e
|