Skip to main content

Chat with LangChain LLM models, with tool calling and multimodal support

Project description

ChainChat - Chat with LangChain

CLI to chat with any LangChain model, also supports tool calling and multimodality.

Chat Models

ChainChat will introspect any installed langchain_* packages and make any BaseChatModel subclasses available as commands with the models attributes as options - chainchat <model-command> --<option> <value>.

Just pip install any model packages you want to use, and they will be available as model commands to chat with:

$ chainchat chat
...
Commands:
  preset  Load a preset model from YAML.
$ pip install langchain_openai langchain_anthropic
$ chainchat chat
...
Commands:
  preset                          Load a preset model from YAML.
  anthropic                       See...
  anthropic-messages              See...
  azure-open-ai                   See...
...

API Keys

API keys are accessed via environment variables. By default they are loaded from a .env file located in the current directory. You can specify a different file using the chainchat --dotenv option.

OpenAI Compatible Models

You can use any OpenAI compatible model with ChainChat. For example to use xAI Grok put your XAI_API_KEY in your .env file and alias it to OPENAI_API_KEY:

$ chainchat --alias-env OPENAI_API_KEY XAI_API_KEY chat --tool read_file --prompt "Read and summarize the file ./LICENSE.txt" open-ai --model-name grok-beta --openai-api-base https://api.x.ai/v1
I am reading the file ./LICENSE.txt to summarize its contents.
...

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

chainchat-0.1a1.tar.gz (106.9 kB view details)

Uploaded Source

Built Distribution

chainchat-0.1a1-py3-none-any.whl (28.0 kB view details)

Uploaded Python 3

File details

Details for the file chainchat-0.1a1.tar.gz.

File metadata

  • Download URL: chainchat-0.1a1.tar.gz
  • Upload date:
  • Size: 106.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for chainchat-0.1a1.tar.gz
Algorithm Hash digest
SHA256 34ce10b021b71cfd0ad5474036bad5e5ca2b4177241a12d5200fb5756aa2cfeb
MD5 470443420bbc61ffb36cb3899304fe85
BLAKE2b-256 87c3851c143029dc7a56d424732b9428074a81155c9f4ae7751935439bf7e22a

See more details on using hashes here.

Provenance

The following attestation bundles were made for chainchat-0.1a1.tar.gz:

Publisher: publish.yml on rectalogic/chainchat

Attestations:

File details

Details for the file chainchat-0.1a1-py3-none-any.whl.

File metadata

  • Download URL: chainchat-0.1a1-py3-none-any.whl
  • Upload date:
  • Size: 28.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for chainchat-0.1a1-py3-none-any.whl
Algorithm Hash digest
SHA256 4f5ccd453336f7783fd09ad637d3a3c0662198e7076cf7da86efef121cc1f96f
MD5 4ef88cdea17d2a4f26a8d393efb799a7
BLAKE2b-256 140c9aa50defa491b226513600b8d203c8f59a47e8844838595bd53ed93d7475

See more details on using hashes here.

Provenance

The following attestation bundles were made for chainchat-0.1a1-py3-none-any.whl:

Publisher: publish.yml on rectalogic/chainchat

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page