Skip to main content

ask-llm — LLM CLI Wrappers

A collection of lightweight Python wrappers for calling different LLM providers from the command line or from other scripts.

Providers

CLI Command Provider API Key env var Model env var
ask-gemini Google Gemini GEMINI_API_KEY GEMINI_MODEL
ask-claude Anthropic Claude ANTHROPIC_API_KEY CLAUDE_MODEL
ask-openai OpenAI OPENAI_API_KEY OPENAI_MODEL
ask-qwen Alibaba Qwen (DashScope) DASHSCOPE_API_KEY —

Installation

pip install ask-llm-help

For development:

pip install -e .

Configuration

Copy the example env file and fill in your API keys:

cp .env.example .env
# Edit .env with your actual API keys

CLI Usage

ask-gemini "Explain photosynthesis" --system "You are a biology teacher"
ask-claude "Explain photosynthesis" --temp 0.3
ask-openai "Explain photosynthesis" --model gpt-4o
ask-qwen "Explain photosynthesis"

All CLI commands accept --system, --model, and --temp flags (except ask-qwen which uses positional args).

Import Usage

from ask_llm.ask_gemini import ask_gemini
from ask_llm.ask_claude import ask_claude
from ask_llm.ask_openai import ask_openai
from ask_llm.ask_qwen import ask_qwen_text  # non-streaming, returns str | None

result = ask_gemini("Summarise this text", system_instruction="Be concise.")
result = ask_qwen_text("Summarise this text", enable_thinking=True)  # thinking off by default

Shared function signature (Gemini, Claude, OpenAI)

ask_<provider>(
    prompt: str,
    system_instruction: str | None = None,
    model: str | None = None,
    temperature: float = 0.7,
    max_tokens: int = 4096–8192,
    json_mode: bool = False,       # not available on Claude
) -> str | None

Qwen — two functions

  • ask_qwen_text(...) — non-streaming, returns str | None. Use in scripts. enable_thinking defaults to False to avoid billing thinking tokens that are never returned.
  • ask_qwen(...) — streaming, prints to stdout. Use from CLI. enable_thinking defaults to True to show reasoning.

Notes

  • All wrappers return None on failure and log errors via the standard logging module.
  • HTTP requests have a timeout=60s (120s for Qwen streaming).
  • Gemini passes the API key as an x-goog-api-key header (not in the URL) for security.

Metadata

Release files for ask-llm-help 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ask-llm-help 0.3.2
File Size Uploaded Provenance Actions
ask_llm_help-0.3.2.tar.gz 9.2 kB Without provenance Details for ask_llm_help-0.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ask-llm-help 0.3.2
File Interpreter ABI Platform Actions
ask_llm_help-0.3.2-py3-none-any.whl Python 3 none any Details for ask_llm_help-0.3.2-py3-none-any.whl

Total release size: 21.3 kB

Release files / ask_llm_help-0.3.2.tar.gz

Download URL ask_llm_help-0.3.2.tar.gz
Size 9.2 kB
Tags Source
SHA-256 checksum
How to use checksums
cfd0e5747cbe7143c0eac35897cbadd098ca43a0e62adc4d0eb1d145a9383b77
BLAKE2b-256 checksum
How to use checksums
358482f9b5d46f5abae24945a1392398df1a42fb62006cad0a40a16e8ef87c79
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.5

Release files / ask_llm_help-0.3.2-py3-none-any.whl

Download URL ask_llm_help-0.3.2-py3-none-any.whl
Size 12.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b7898db93d32370946211f2024376ece49ee7b7b3002894db3a6f55c33821831
BLAKE2b-256 checksum
How to use checksums
e7724c7cb3ca552212245c166112d1072ff6ca4124e3e82878d2a9c03552b8b7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.5

Security for ask-llm-help 0.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page