Skip to main content

multiai

multiai is a Python library and command-line tool designed to interact with text-based generative AI models from the following providers:

AI Provider Web Service Models Available
OpenAI ChatGPT GPT Models
Anthropic Claude Claude Models
Google Gemini Gemini Models
Perplexity Perplexity Perplexity Models
Mistral Mistral Mistral Models
DeepSeek DeepSeek DeepSeek Models
xAI xAI xAI Models
Local LLM Ollama Ollama Models

Key Features

  • Interactive Chat: Communicate with AI directly from your terminal.
  • Multi-Line Input: Supports multi-line prompts for complex queries.
  • Pager for Long Responses: View lengthy responses conveniently using a pager.
  • Continuation Handling: Automatically handle and request continuations if responses are cut off.
  • Automatic Chat Logging: Automatically save your chat history for future reference.
  • File Attachments: Attach files as additional context.

Usage

Install multiai, then configure your API keys for your chosen AI providers as environment variables or in a user-setting file. Once that's done, you can start interacting with the AI.

  • To send a simple query:

    ai hi
    

    You should see a response like:

    gpt-4o-mini>
    Hello! How can I assist you today?
    
  • For an interactive session, enter interactive mode:

    ai
    

    In this mode, you can continue the conversation:

    user> hi
    gpt-4o-mini>
    Hello! How can I assist you today?
    user> how are you
    gpt-4o-mini>
    I'm just a program, so I don't have feelings, but I'm here and ready to help you! How about you? How are you doing?
    user>
    

To see a list of all command-line options, use:

ai -h

For more detailed documentation, please refer to the manual.

Using multiai as a Python Library

multiai can also be used as a Python library. Here’s a simple example:

import multiai

# Initialize the client
client = multiai.Prompt()
client.set_model('openai', 'gpt-4o')  # Set model
client.temperature = 0.5  # Set temperature

# Send a prompt and get a response
answer = client.ask('hi')
print(answer)

# Continue the conversation with context
answer = client.ask('how are you')
print(answer)

# Clear the conversation context
client.clear()

The manual includes the following sample codes:

  • A script that translates a text file into English.
  • A local chat app that allows you to easily select from various AI models provided by different providers and engage in conversations with them.

Ask DeepWiki

Metadata

Release files for multiai 1.6.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 multiai 1.6.2
File Size Uploaded
multiai-1.6.2.tar.gz 23.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for multiai 1.6.2
File Interpreter ABI Platform
multiai-1.6.2-py3-none-any.whl Python 3 none any Details

Total release size: 45.0 kB

Release files / multiai-1.6.2.tar.gz

Download URL multiai-1.6.2.tar.gz
Size 23.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2b9c4ad904d1327c787fa5bf9b50338fde61dc61da6a907a39ad2c355e002e75
BLAKE2b-256 checksum
How to use checksums
efa2daa10ed885d702ebf9c7c5d61208349017490f7f7c0197cd779ef22425ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release files / multiai-1.6.2-py3-none-any.whl

Download URL multiai-1.6.2-py3-none-any.whl
Size 21.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
87f176242ef366fd611d5e8397475e668ffecb3ab2512c2afae336f052797365
BLAKE2b-256 checksum
How to use checksums
09adbd7ac104aecbf1a43d7de683bf79724954ee451a10511ba81e9c2574c736
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.6

Release history Release notifications | RSS feed

This release

1.6.2 This release

2 release files

1.6.1

2 release files

1.6.0

2 release files

1.5.2

2 release files

1.5.1

2 release files

1.5.0

2 release files

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.2

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.8

2 release files

0.7

2 release files

0.6

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1

1 release file

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