Skip to main content

AI Made Stupid Simple. Unified API for OpenAI, Groq, Google, and more.

Project description

askai-python 🚀

A minimal Python SDK to switch between LLM providers in one line.
No frameworks. No servers. No overengineering.

PyPI version License: MIT GitHub


⚡ Quick Start (5 seconds)

pip install askai-python
from ask_ai import OpenAI, Groq

# Auto-detects OPENAI_API_KEY from environment
print(OpenAI().ask("Explain black holes like I'm 5").text)

# Switch provider instantly
print(Groq().ask("Explain black holes like I'm 5").text)

🧐 Why ask-ai?

  • One function: Just call .ask()
  • Multiple providers: OpenAI, Anthropic, Google Gemini, Groq, Azure, OpenRouter
  • Zero config: Keys are pulled from the environment automatically
  • SDK-first, not a framework: It stays out of your way.

⚖️ How it compares

Feature ask-ai LangChain
Setup time 30 sec 1 hour
Learning curve ⭐⭐⭐⭐⭐
Async support (Coming soon) ⚠️ Complex
Retry/Timeout ✅ Built-in ❌ Manual
Gateway needed ❌ No ❌ No

🚫 What this project is NOT

❌ Not an AI framework
❌ Not an API gateway
❌ Not an agent memory system

It does one thing perfectly: Simplifying the API call to LLMs.


🚀 Built-in Resiliency (Retries & Timeouts)

Build reliable apps without writing your own loops. askai-python handles rate limits (429) and network drops via an internal exponential backoff.

from ask_ai import OpenAI

ai = OpenAI()

# Automatically retries up to 3 times on transient errors, with a 15-second timeout
response = ai.ask(
    "Write a complex python script", 
    retry=3, 
    timeout=15 
)

🔌 Supported Providers

Provider Class Capabilities
OpenAI OpenAI Text, Images (DALL-E), Vision
Anthropic Anthropic Text, Vision (Claude 3.5)
Google Google Text, Images, Video, Audio
Groq Groq Ultra-fast Llama 3 & Mixtral
Azure Azure Enterprise-grade OpenAI
OpenRouter OpenRouter 100+ community models

🗺️ Roadmap

  • Baseline multiple providers
  • Automated Retry & Timeout controls
  • Async API (await ask_async)
  • Provider Fallback (fallback=[Groq()])
  • Structured Outputs (Pydantic Support)

🔗 Important Links

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

askai_python-0.2.0.tar.gz (15.5 kB view details)

Uploaded Source

Built Distribution

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

askai_python-0.2.0-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file askai_python-0.2.0.tar.gz.

File metadata

  • Download URL: askai_python-0.2.0.tar.gz
  • Upload date:
  • Size: 15.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for askai_python-0.2.0.tar.gz
Algorithm Hash digest
SHA256 01bda31003beaad74edfe10db5ae962890d4c255723efde3fb311a7590780ece
MD5 ac7a1fbf934cab62b0fd54ce5247480f
BLAKE2b-256 31d42c692330438157a45ceb72491f0cbd285a7fc745321722134abed8242f38

See more details on using hashes here.

File details

Details for the file askai_python-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: askai_python-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.25

File hashes

Hashes for askai_python-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fffe6bbbc11a5c075bb3838b2a72255b6ffba9cbd46fdadb8f395c87411e9dd6
MD5 6180ec80b05d8cd63d3f7b4506d81d10
BLAKE2b-256 b3570c4929a52f1b12b8881edb9d582eeea015b78f15be6a11475fc904614362

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