Skip to main content

Anthropic model support for Gptcmd

Project description

Gptcmd-anthropic

Gptcmd-anthropic adds support for Anthropic's Claude models to Gptcmd.

Python 3.8.6 or later, Gptcmd 2.0.0 or later, and an Anthropic API key are required to use this package. Gptcmd-anthropic is available on PyPI, and can, for instance, be installed with pip install gptcmd-anthropic at a command line shell.

Configuration

To use Gptcmd-anthropic, you'll need to add a new account to your Gptcmd configuration or modify your default account. If no api_key is specified in your configuration, Gptcmd-anthropic uses the API key in the ANTHROPIC_API_KEY environment variable. An example configuration follows:

[accounts.claude]
provider = "anthropic"
api_key = "sk-ant-xxxxx"  # Replace with your API key
# Though not required, specifying a model in your configuration, similar to
# openai and azure accounts, will use that model by default
model = "claude-3-5-sonnet-latest"
# Any additional options are passed directly to the Python Anthropic client's
# constructor for this account.

Usage

If you've configured multiple accounts, the account command in Gptcmd can be used to switch between them:

(gpt-4o) account claude
Switched to account 'claude'
(claude-3-5-sonnet-latest) account default
Switched to account 'default'
(gpt-4o)

Consult Gptcmd's readme for additional usage instructions.

Prompt caching

To save costs, Gptcmd-anthropic dynamically inserts cache breakpoints on the system message (if present), the final user message, and the largest messages of a conversation based on content length and number of attachments. This feature is currently not user configurable.

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

gptcmd_anthropic-1.2.0.tar.gz (23.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gptcmd_anthropic-1.2.0-py3-none-any.whl (23.8 kB view details)

Uploaded Python 3

File details

Details for the file gptcmd_anthropic-1.2.0.tar.gz.

File metadata

  • Download URL: gptcmd_anthropic-1.2.0.tar.gz
  • Upload date:
  • Size: 23.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.6

File hashes

Hashes for gptcmd_anthropic-1.2.0.tar.gz
Algorithm Hash digest
SHA256 671ce37577dfd0733466f30490ba191d78e45045928e2eda64e16dc900a779f7
MD5 339a41514392cb6b5f25babb71e44229
BLAKE2b-256 d4597e8173f542d9f250486be2e24a103be0f4a0c9819b1f17ac1fd972039d6e

See more details on using hashes here.

File details

Details for the file gptcmd_anthropic-1.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for gptcmd_anthropic-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3200c170f2711eb029193963e0f2852d1e8375fcb4d2a3499e9d4ab67dfbd989
MD5 1b8745628a89b28b715509e3b5d15c5a
BLAKE2b-256 1ba83979cad3f34afd31ba84854667b334fdda31518cfea0555ec1fa70298b95

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