Skip to main content

Build chatbots in minutes using open-source models and Gradio

Project description

ArielAI

Build chatbots in minutes using open-source models and Gradio.

ArielAI wraps HuggingFace Transformers, Ollama, and the HuggingFace Inference API into a single, clean interface — so you go from zero to a working chatbot in just a few lines of code.


Installation

pip install arielai

For local model inference with PyTorch:

pip install arielai[torch]

For Ollama support:

pip install arielai[ollama]

For HuggingFace Inference API (no GPU required):

pip install arielai[inference]

Quick Start

One-liner

import arielai
arielai.launch("microsoft/DialoGPT-medium")

Basic usage

from arielai import Chatbot

bot = Chatbot(
    model="microsoft/DialoGPT-medium",
    title="My Chatbot",
)
bot.launch()

Using a preset

from arielai import Chatbot

bot = Chatbot.from_preset("zephyr")
bot.launch()

Backends

ArielAI supports three backends:

Backend backend= Description
HuggingFace Transformers "transformers" Download and run models locally
Ollama "ollama" Local models via Ollama
HF Inference API "inference" Cloud-hosted, no GPU needed

Transformers (default)

bot = Chatbot(
    model="HuggingFaceH4/zephyr-7b-beta",
    backend="transformers",
    system_prompt="You are a helpful assistant.",
)
bot.launch()

Ollama

# First: install Ollama and pull a model
ollama pull llama3
bot = Chatbot(model="llama3", backend="ollama")
bot.launch()

HuggingFace Inference API

bot = Chatbot(
    model="HuggingFaceH4/zephyr-7b-beta",
    backend="inference",
    hf_token="hf_...",  # Optional for public models
)
bot.launch()

Presets

ArielAI ships with ready-to-use model presets:

Preset Model Backend
tiny facebook/blenderbot-400M-distill transformers
dialogue microsoft/DialoGPT-medium transformers
zephyr HuggingFaceH4/zephyr-7b-beta transformers
mistral mistralai/Mistral-7B-Instruct-v0.2 transformers
ollama-llama3 llama3 ollama
ollama-mistral mistral ollama
ollama-gemma gemma ollama
from arielai import list_presets

for name, description in list_presets().items():
    print(f"{name}: {description}")

Full API Reference

Chatbot()

Parameter Type Default Description
model str "microsoft/DialoGPT-medium" HuggingFace model ID or Ollama model name
backend str "transformers" "transformers", "ollama", or "inference"
title str "ArielAI Chatbot" Chatbot window title
description str "" Description shown below the title
system_prompt str "" System instruction for the model
placeholder str "Ask me anything..." Input box placeholder
max_new_tokens int 512 Max tokens per response
temperature float 0.7 Sampling temperature
examples list[str] None Example messages shown in the UI
theme str "soft" Gradio theme ("soft", "default", "monochrome", "glass")
streaming bool True Stream responses token-by-token
device str None Device for transformers ("cpu", "cuda", "mps")
load_in_8bit bool False 8-bit quantization (requires bitsandbytes)
load_in_4bit bool False 4-bit quantization (requires bitsandbytes)
hf_token str None HuggingFace API token
ollama_host str "http://localhost:11434" Ollama server URL

Chatbot.launch()

Parameter Type Default Description
share bool False Create a public Gradio share link
server_name str "0.0.0.0" Bind address
server_port int None Port (auto-selected if None)
inbrowser bool True Open browser automatically

Chatbot.build()

Returns the gr.ChatInterface object without launching. Use this to embed ArielAI in an existing Gradio app or deploy to Hugging Face Spaces.

demo = bot.build()
demo.launch(...)

ChatUI — Polished Frontend

ChatUI wraps your chatbot in a branded, styled interface with a custom header, color themes, dark mode, and a footer. Still powered by Gradio, zero extra dependencies.

from arielai import Chatbot, ChatUI

bot = Chatbot(
    model="microsoft/DialoGPT-medium",
    streaming=True,
    examples=["Tell me something interesting.", "Write a short poem."],
)

ui = ChatUI(
    bot,
    brand_name="My AI Assistant",
    tagline="Powered by open-source AI",
    accent="indigo",        # color theme
    dark_mode=False,        # or True for dark
    footer_text="Built with ArielAI",
)

ui.launch()

ChatUI options

Parameter Type Default Description
brand_name str "ArielAI" Name shown in the header
tagline str "Powered by open-source AI" Subtitle below the brand name
brand_logo str None Path or URL to a logo image
accent str "indigo" Color accent (see below)
dark_mode bool False Dark color scheme
show_footer bool True Show a footer below the chat
footer_text str "Built with ArielAI" Footer label
footer_link str ArielAI GitHub URL the footer text links to
extra_css str "" Extra raw CSS to inject

Available accents

indigo · emerald · rose · amber · blue · violet · cyan · slate

Or any hex color: accent="#ff6b6b"

from arielai import ChatUI
print(ChatUI.list_accents())

Advanced Usage

Embed in an existing Gradio app

import gradio as gr
from arielai import Chatbot

bot = Chatbot(model="microsoft/DialoGPT-medium")
chat_ui = bot.build()  # returns gr.ChatInterface

with gr.Blocks() as app:
    gr.Markdown("# My App")
    chat_ui.render()

app.launch()

Memory-efficient models (quantization)

bot = Chatbot(
    model="mistralai/Mistral-7B-Instruct-v0.2",
    load_in_4bit=True,  # Requires bitsandbytes + CUDA GPU
)
bot.launch()

Custom backend

from arielai import Chatbot
from arielai.backends import BaseBackend

class MyBackend(BaseBackend):
    def generate(self, message, history, **kwargs):
        return f"You said: {message}"

bot = Chatbot(backend_instance=MyBackend())
bot.launch()

Running Tests

pip install arielai[dev]
pytest

Contributing

Contributions are welcome! Please open an issue or pull request on GitHub.


License

MIT © ArielAI Contributors

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

arielai-0.2.1.tar.gz (16.0 kB view details)

Uploaded Source

Built Distribution

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

arielai-0.2.1-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

Details for the file arielai-0.2.1.tar.gz.

File metadata

  • Download URL: arielai-0.2.1.tar.gz
  • Upload date:
  • Size: 16.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for arielai-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a19df0455b411564fc1d8275c8715c468a94d1eb6e8d5e5c1de7157577234ed3
MD5 e62dc2c866dfa9cf11efff8111ea581d
BLAKE2b-256 b1428ce59bcbbacefdfd9af5c9f0af75f2c9adfb25470303f4ed15c99a659ccc

See more details on using hashes here.

File details

Details for the file arielai-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: arielai-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 15.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for arielai-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 24b490fd345bba8e44fb6926982fb509b6b40a1d5ac6bfe26456204897d924ba
MD5 053ea7325285a2c571ecfd3dcdef530a
BLAKE2b-256 700df937449aa6d7e4eeea4af015e6d8573b855f25abcf76d6ed697a095911d2

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