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.1.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.1-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gptcmd_anthropic-1.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 36638eb174bd66e94758d89df197f6546c3a471d6c4183a672d4b02fff5e03f4
MD5 c8f567ea6382d210c674c8f9a24e825a
BLAKE2b-256 af0ad7f4d73216f8be622c53363c6abc80d72c0362472a0f56cec790b291399e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for gptcmd_anthropic-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 41e5bed0aae17849cb41c6a07ad936aaca8d1a4e50277ff47b878340ead5218b
MD5 77314118bff8f0f4390fd2732c52f418
BLAKE2b-256 94b9eef9fe5c02da21b9a3871228afc5b8c483d372569dc6e3dc2630b8f6f13e

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