Anthropic
In this section, we present how to bring Anthropic models to MindsDB.
Anthropic is an AI safety and research company based in San Francisco. Their interdisciplinary team has experience across ML, physics, policy, and product. Together, they generate research and create reliable, beneficial AI systems.
Read on to find out how to use Anthropic models within MinsdDB.
Setup
MindsDB provides the Anthropic handler that enables you to create Anthropic models within MindsDB.
AI Engine
Before creating a model, it is required to create an AI engine based on the provided handler.
If you installed MindsDB locally, make sure to install all Anthropic dependencies by running pip install .[anthropic]
or from the requirements.txt file.
You can create an Anthropic engine using this command:
Please note that you need to provide your Anthropic API key. See Anthropic’s documentation on how to get access.
The name of the engine (here, anthropic_engine
) should be used as a value for the engine
parameter in the USING
clause of the CREATE MODEL
statement.
AI Model
The CREATE MODEL
statement is used to create, train, and deploy models within MindsDB.
Where:
Name | Description |
---|---|
column | It defines the prompt to the model. |
engine | It defines the Anthropic engine. |
api_key | It is used to provide your Anthropic API key to gain access to the model. |
max_tokens | It defines the maximum number of tokens to generate before stopping. |
model | It defines model that will complete your prompt. |
Default Model
When you create an Anthropic model in MindsDB, it uses the claude-2
model by default. But you can use the claude-1
model as well by passing it to the model
parameter in the USING
clause of the CREATE MODEL
statement.
Default Max Tokens
When you create an Anthropic model in MindsDB, it uses 100 tokens as the maximum by default. But you can adjust this value by passing it to the max_tokens
parameter in the USING
clause of the CREATE MODEL
statement.
Usage
Once you have created an Anthropic model, you can use it to make predictions.
On execution, we get: