Skip to main content
An interactive REPL chat application with multi-provider support and tool calling. Perfect for exploring what AI can do when given real capabilities.

Installation

Quick Start

Features

  • Multi-Provider: Switch between Google, OpenAI, and OpenRouter mid-conversation
  • Tool Calling: Built-in tools the AI can use to answer questions
  • Conversation Memory: Context persists across provider switches
  • Slash Commands: Control the app without leaving the chat

Slash Commands

Model Switching

Switch providers or models at any time:
Model formats:
  • provider - Uses provider’s default model
  • provider:model - Specific model
  • provider/model - Alternative notation

Filtering Models

Viewing History

The /messages command shows the full conversation including tool interactions:

Built-in Tools

The AI can autonomously use these tools to answer your questions:

current-time

Get the current time. Returns: ISO 8601 timestamp

current-date

Get the current date. Returns: ISO 8601 timestamp

weather

Get weather information for a US zipcode. Returns: JSON with current conditions, temperature, humidity, wind, UV index Data source: wttr.in API

location-lookup

Get geographic data for any location query. Returns: Array of location objects with coordinates, address details, place IDs Data source: OpenStreetMap Nominatim API

surf-web

Fetch the content of a web page. Returns: HTML content of the page

Multi-Step Tool Calling

Watch the AI chain tools together to solve complex questions:
The AI figured out it needed to:
  1. Look up the Moda Center’s location to get a zipcode
  2. Use that zipcode to fetch the weather
  3. Synthesize the results into a natural response
That’s agentic behavior in action.

Conversation Memory

Context persists across the entire session, including model switches:

Environment Setup

Create a .env file in the chatarang directory or set environment variables:

Required Keys

You only need keys for the providers you plan to use.

Supported Providers

Google (Gemini)

Default provider. Models include:
  • google:gemini-2.0-flash (default)
  • google:gemini-1.5-pro
  • google:gemini-1.5-flash

OpenAI

GPT models:
  • openai:gpt-4o
  • openai:gpt-4o-mini
  • openai:gpt-4

OpenRouter

Access to various models through OpenRouter:
  • openrouter:anthropic/claude-3-opus
  • openrouter:meta-llama/llama-3-70b
  • And many more

Output Colors

Chatarang uses colors to distinguish message types:

Sample Session

Adding Custom Tools

To add your own tools, edit lib/tools.dart:
Then add it to the tools list in the same file.