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
| Command | Arguments | Description |
|---|---|---|
/help | Show available commands | |
/model | [name] | View current model or switch to new model |
/models | [filter] | List available models (optionally filtered) |
/tools | Show all available tools | |
/messages | Display full conversation history | |
/clear | Clear conversation and reset to system prompt | |
/exit | Quit the application |
Model Switching
Switch providers or models at any time:provider- Uses provider’s default modelprovider:model- Specific modelprovider/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.| Parameter | Type | Required | Description |
|---|---|---|---|
| (none) |
current-date
Get the current date.| Parameter | Type | Required | Description |
|---|---|---|---|
| (none) |
weather
Get weather information for a US zipcode.| Parameter | Type | Required | Description |
|---|---|---|---|
zipcode | string | Yes | US zipcode |
location-lookup
Get geographic data for any location query.| Parameter | Type | Required | Description |
|---|---|---|---|
location | string | Yes | Location to search for |
surf-web
Fetch the content of a web page.| Parameter | Type | Required | Description |
|---|---|---|---|
link | string | Yes | URL of the web page |
Multi-Step Tool Calling
Watch the AI chain tools together to solve complex questions:- Look up the Moda Center’s location to get a zipcode
- Use that zipcode to fetch the weather
- Synthesize the results into a natural response
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
| Provider | Environment Variable | Required |
|---|---|---|
GEMINI_API_KEY | For Google models | |
| OpenAI | OPENAI_API_KEY | For OpenAI models |
| OpenRouter | OPENROUTER_API_KEY | For OpenRouter models |
Supported Providers
Google (Gemini)
Default provider. Models include:google:gemini-2.0-flash(default)google:gemini-1.5-progoogle:gemini-1.5-flash
OpenAI
GPT models:openai:gpt-4oopenai:gpt-4o-miniopenai:gpt-4
OpenRouter
Access to various models through OpenRouter:openrouter:anthropic/claude-3-opusopenrouter:meta-llama/llama-3-70b- And many more
Output Colors
Chatarang uses colors to distinguish message types:| Color | Meaning |
|---|---|
| Blue | Your input (You:) |
| Yellow | Model response |
| Magenta | Tool calls |
| Cyan | Tool results |
| Red | System messages |
Sample Session
Adding Custom Tools
To add your own tools, editlib/tools.dart:
tools list in the same file.
