Metadata-Version: 2.4
Name: chatlas
Version: 0.13.2
Summary: A simple and consistent interface for chatting with LLMs
Project-URL: Homepage, https://posit-dev.github.io/chatlas
Project-URL: Documentation, https://posit-dev.github.io/chatlas
Project-URL: Repository, https://github.com/posit-dev/chatlas
Project-URL: Issues, https://github.com/posit-dev/chatlas/issues/
Project-URL: Changelog, https://github.com/posit-dev/chatlas/blob/main/CHANGELOG.md
Author-email: Carson Sievert <carson@posit.co>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.9
Requires-Dist: jinja2
Requires-Dist: openai
Requires-Dist: orjson
Requires-Dist: pydantic>=2.0
Requires-Dist: requests
Requires-Dist: rich
Provides-Extra: anthropic
Requires-Dist: anthropic; extra == 'anthropic'
Provides-Extra: azure-openai
Provides-Extra: bedrock-anthropic
Requires-Dist: anthropic[bedrock]; extra == 'bedrock-anthropic'
Provides-Extra: databricks
Requires-Dist: databricks-sdk; extra == 'databricks'
Provides-Extra: dev
Requires-Dist: anthropic[bedrock]; extra == 'dev'
Requires-Dist: databricks-sdk; extra == 'dev'
Requires-Dist: google-genai>=1.14.0; extra == 'dev'
Requires-Dist: htmltools; extra == 'dev'
Requires-Dist: matplotlib; extra == 'dev'
Requires-Dist: narwhals; extra == 'dev'
Requires-Dist: numpy>1.24.4; extra == 'dev'
Requires-Dist: openai; extra == 'dev'
Requires-Dist: pandas; extra == 'dev'
Requires-Dist: pillow; extra == 'dev'
Requires-Dist: polars; extra == 'dev'
Requires-Dist: python-dotenv; extra == 'dev'
Requires-Dist: ruff>=0.6.5; extra == 'dev'
Requires-Dist: shiny; extra == 'dev'
Requires-Dist: shinychat; extra == 'dev'
Requires-Dist: snowflake-ml-python>=1.8.4; extra == 'dev'
Requires-Dist: tenacity; extra == 'dev'
Requires-Dist: tiktoken; extra == 'dev'
Requires-Dist: torch; (python_version <= '3.11') and extra == 'dev'
Provides-Extra: docs
Requires-Dist: griffe>=1; extra == 'docs'
Requires-Dist: ipykernel; extra == 'docs'
Requires-Dist: ipywidgets; extra == 'docs'
Requires-Dist: nbclient; extra == 'docs'
Requires-Dist: nbformat; extra == 'docs'
Requires-Dist: numpy; extra == 'docs'
Requires-Dist: pandas; extra == 'docs'
Requires-Dist: pyyaml; extra == 'docs'
Requires-Dist: quartodoc>=0.7; extra == 'docs'
Requires-Dist: sentence-transformers; extra == 'docs'
Provides-Extra: github
Provides-Extra: google
Requires-Dist: google-genai>=1.14.0; extra == 'google'
Provides-Extra: groq
Provides-Extra: mcp
Requires-Dist: mcp>=1.4.0; (python_version >= '3.10') and extra == 'mcp'
Provides-Extra: ollama
Provides-Extra: openai
Provides-Extra: perplexity
Provides-Extra: snowflake
Requires-Dist: snowflake-ml-python<=1.9.0; extra == 'snowflake'
Provides-Extra: test
Requires-Dist: pyright>=1.1.379; extra == 'test'
Requires-Dist: pytest-asyncio; extra == 'test'
Requires-Dist: pytest>=8.3.2; extra == 'test'
Requires-Dist: syrupy>=4; extra == 'test'
Provides-Extra: vertex
Requires-Dist: google-genai>=1.14.0; extra == 'vertex'
Description-Content-Type: text/markdown

# chatlas <a href="https://posit-dev.github.io/chatlas"><img src="https://posit-dev.github.io/chatlas/logos/hex/logo.png" align="right" height="138" alt="chatlas website" /></a>

<p>
<!-- badges start -->
<a href="https://pypi.org/project/chatlas/"><img alt="PyPI" src="https://img.shields.io/pypi/v/chatlas?logo=python&logoColor=white&color=orange"></a>
<a href="https://choosealicense.com/licenses/mit/"><img src="https://img.shields.io/badge/License-MIT-blue.svg" alt="MIT License"></a>
<a href="https://pypi.org/project/chatlas"><img src="https://img.shields.io/pypi/pyversions/chatlas.svg" alt="versions"></a>
<a href="https://github.com/posit-dev/chatlas"><img src="https://github.com/posit-dev/chatlas/actions/workflows/test.yml/badge.svg?branch=main" alt="Python Tests"></a>
<!-- badges end -->
</p>

Your friendly guide to building LLM chat apps in Python with less effort and more clarity.

## Install

Install the latest stable release [from PyPI](https://pypi.org/project/chatlas/):

```bash
pip install -U chatlas
```

Or, install the latest development version from GitHub:

```bash
pip install -U git+https://github.com/posit-dev/chatlas
```

## Quick start

Get started in 3 simple steps:

1. Choose a model provider, such as [ChatOpenAI](https://posit-dev.github.io/chatlas/reference/ChatOpenAI.html) or [ChatAnthropic](https://posit-dev.github.io/chatlas/reference/ChatAnthropic.html).
2. Visit the provider's [reference](https://posit-dev.github.io/chatlas/reference) page to get setup with necessary credentials.
3. Create the relevant `Chat` client and start chatting!

```python
from chatlas import ChatOpenAI

# Optional (but recommended) model and system_prompt
chat = ChatOpenAI(
    model="gpt-4.1-mini",
    system_prompt="You are a helpful assistant.",
)

# Optional tool registration
def get_current_weather(lat: float, lng: float):
    "Get the current weather for a given location."
    return "sunny"

chat.register_tool(get_current_weather)

# Send user prompt to the model for a response.
chat.chat("How's the weather in San Francisco?")
```


<img src="https://posit-dev.github.io/chatlas/images/chatlas-hello.png" alt="Model response output to the user query: 'How's the weather in San Francisco?'" width="67%" style="display: block; margin-left: auto; margin-right: auto">


Learn more at <https://posit-dev.github.io/chatlas>