Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Access Shuttle AI's API via an easy-to-use Python wrapper. Dashboard: https://shuttleai.com Discord: https://discord.gg/shuttleai
The ShuttleAI Python library provides easy access to the ShuttleAI REST API for Python 3.9+ applications. It includes type definitions for all request parameters and response fields, offering both synchronous and asynchronous clients powered by httpx and aiohttp, respectively.
We prioritize performance optimizations across the library. Beyond using orjson for near-instant JSON processing, we implement various techniques to reduce overhead and enhance speed, ensuring efficient and swift API interactions. These optimizations include minimizing built-in library usage, leveraging reusable aiohttp client sessions, and incorporating several small adjustments to streamline operations.
pip install shuttleai
We recommend using --upgrade
or -U
to ensure you have the latest version of the library.
This client uses poetry
as a dependency and virtual environment manager.
You can install poetry with
pip install poetry
poetry
will set up a virtual environment and install dependencies with the following command:
poetry install
Below is a non-streamed sync and async example for the ShuttleAI API. You can find more examples in the examples/
directory.
from shuttleai import ShuttleAI
shuttleai = ShuttleAI()
response = shuttleai.chat.completions.create(
model="shuttle-2.5",
messages=[{"role": "user", "content": "What day is today?"}],
internet=True
)
print(chunk.choices[0].message.content)
import asyncio
from shuttleai import AsyncShuttleAI
async def main():
shuttleai = AsyncShuttleAI()
response = await shuttleai.chat.completions.create(
model="shuttle-2.5",
messages=[{"role": "user", "content": "Imagine an AI like no other, its name is ShuttleAI."}],
)
print(response.choices[0].message.content)
asyncio.run(main())
Scroll down to the Scripts section for more information.
You can run the examples in the examples/
directory using poetry run
or by entering the virtual environment using poetry shell
.
cd examples
poetry run python chat_no_streaming.py
poetry shell
cd examples
>> python chat_no_streaming.py
To use the ShuttleAI API, you need to have an API key. You can get a FREE API key by signing up at shuttleai.com and heading to the key management page.
After you have an API key, you can set it as an environment variable:
setx SHUTTLEAI_API_KEY "<your_api_key>"
[!Note] This will only work in the current terminal session. To set it permanently, you can use the
setx
command with the/m
flag.
setx SHUTTLEAI_API_KEY "<your_api_key>" /m
export SHUTTLEAI_API_KEY=<your_api_key>
We welcome and appreciate contributions to the ShuttleAI API Python SDK. Please see the contribution guide for more information. Benefits may apply! :smile:
poetry run ruff check shuttleai
- Check ruffpoetry run black shuttleai --diff --color
- Check blackpoetry run black shuttleai
- Format codepoetry run mypy shuttleai
- Check for type errorspoetry run clean
- Clean up the project directorypoetry run key
- Display your default API key (if set by environment variable)poetry run contr
- Display contributorspoetry run shuttleai
or shuttleai
- Run the ShuttleAI CLI.
[!Important] We support auto TAB completion of commands and model names! Just press
TAB
!
FAQs
Access Shuttle AI's API via an easy-to-use Python wrapper. Dashboard: https://shuttleai.com Discord: https://discord.gg/shuttleai
We found that shuttleai demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.