Skip to main content

A unified CLI for AI providers like OpenAI and Ollama

Project description

askora

askora is a unified Python CLI for interacting with multiple AI providers like OpenAI and Ollama. Send prompts, get responses, and switch between providers seamlessly, all from the command line.


Features

  • Single CLI to interact with multiple AI providers
  • Supports OpenAI, Ollama, and more in the future
  • Returns structured responses with tokens used and execution time
  • Supports sync and async execution
  • Clean error handling for missing models, invalid API keys, etc.

Installation

Clone the repo and install dependencies:

git clone https://github.com/jetroni/askora.git
cd askora
python -m venv .venv
source .venv/bin/activate   # On Windows: .venv\Scripts\activate
pip install -r requirements.txt

(Optional) Make the CLI globally executable:

pip install --editable .

Usage

Basic usage:

askora --type openai --prompt "Hello AI"

Run with async mode:

askora --type openai --prompt "Hello AI" --async-mode

Ollama example (with base URL):

askora --type ollama --base-url http://localhost:11434.com --model codellama --prompt "Hello"

CLI Options

Option Description
--type AI provider type (openai, ollama)
--prompt Text prompt to send to the AI
--key API key for providers that require authentication
--model Model name to use (defaults vary per provider)
--base-url Base URL for self-hosted providers like Ollama
--async-mode Run asynchronously (flag, no value needed)

Response Structure

All responses are returned as a structured JSON object:

{
  "provider": "openai",
  "model": "gpt-4o-mini",
  "output": "Hello! How can I assist you today?",
  "raw": {
    ...
  },
  "tokens_used": 17,
  "duration_ms": 543
}

Contributing

We welcome contributions!

  • Add support for new AI providers
  • Improve error handling
  • Enhance async execution and CLI experience

Please fork the repo and submit a pull request.


License

MIT License. Free to use and modify.

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

askora-0.0.1.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

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

askora-0.0.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file askora-0.0.1.tar.gz.

File metadata

  • Download URL: askora-0.0.1.tar.gz
  • Upload date:
  • Size: 4.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for askora-0.0.1.tar.gz
Algorithm Hash digest
SHA256 70f024a67540ce0d8e69482d09e77b79ada1b0a563a894fcfa7856e6d3e7ca67
MD5 a7f7074530d7a29cfe909e61964bf0c6
BLAKE2b-256 dd6c91f53362fd70db9d2f4f95b33016f2f84b5ad90532738d048b318257050c

See more details on using hashes here.

File details

Details for the file askora-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: askora-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.13

File hashes

Hashes for askora-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6c7f6219e4d422ba8a7ea346edb8ab429b8d71ad024aa36df26db695fef6d59f
MD5 f5b0a669e426bc5907399e093bb4eb93
BLAKE2b-256 577eacb5862cb673ae9ad563962e7f5eadc2a37456c1185381602b909e73f45c

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