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.1.1.tar.gz (15.4 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.1.1-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for arielai-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d3ddf3ced5660253fbf4f91fa8c842c5e5dc715c56ecb498980398d3d84efd24
MD5 a994553f8563e8ee2ae0a9e3af49082d
BLAKE2b-256 6ebfe352307f5b089dc9b49337a68f29127ddb4eb1730c525ca9931c9d3dbf44

See more details on using hashes here.

File details

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

File metadata

  • Download URL: arielai-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 15.3 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 591506b73511086177d37166d778b5d73b835b53a1bd5f6a2f981448e1918115
MD5 d75cf9f90cb393705fcf753500bdd1b6
BLAKE2b-256 4f77b45fc65187444c55128dc17b9ac379eacbfe28dbaef6d175eff7472a7ed7

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