Using Claude 3.7 Locally – KDnuggets



Image by Author

 

You might be wondering: why would I want to run a proprietary model like Claude 3.7 locally, especially when my data still needs to be sent to Anthropic’s servers? And why go through all the hassle of integrating it locally? Well, there are two major reasons for this.

First, cost. Running the model locally allows you to pay only for what you use, rather than committing to a flat $20 per month. This can be much more economical, especially if your usage is sporadic or limited.

Second, flexibility. By using the API locally, you can seamlessly integrate the model into your code editor, build custom applications tailored to your workspace, and have greater control over how the model interacts with your projects.

In this tutorial, we will explore how to use Anthropic’s latest model, Claude 3.7 Sonnet, locally with the help of the Msty application and Anthropic’s API. We will also demonstrate how to integrate it into VSCode, enabling you to incorporate the model into your workspace effortlessly and at a lower cost. 

 

Setting Up Your Anthropic Account

 

  1. Go to the Anthropic Console and create your account. After that, navigate to the settings and click on “Billing” to add a 5 USD credit using your credit card. This 5 USD credit will last you a long time if you are just experimenting with the model.
  2. Next, go to the Settings and click on the “API Keys” tab to generate a new API key. Copy this API key and save it somewhere safe, as you will need it multiple times.

 

Using Claude 3.7 Locally

 

Using Claude 3.7 Sonnet with Msty ChatBot

 
To use the Anthropic API locally with a proper chatbot application, we will download and install Msty. It is currently my favorite application because it provides a lot of features and easy integrations.

Once Msty is installed, launch the application and go to Settings. Click on the “Remote Model Providers.”

 

Using Claude 3.7 Locally

 

  1. Click on “+ Add Remote Model Provider,” select Claude as the provider, add your API key, and choose the Claude 3.7 Sonnet model. Then press Add.
     
    Using Claude 3.7 Locally

     
  2. Go to the Chat menu and select the Claude 3.7 model.
     
    Using Claude 3.7 Locally

     

You can now start asking questions of Claude as if you were using it in a browser.

 

Using Claude 3.7 Locally

 

Using Claude 3.7 Sonnet as Coding Assistant in VSCode

 
We can also integrate Claude 3.7 in VSCode using the Continue extension.

 

Using Claude 3.7 Locally

 

  1. Install the extension and then click on the Continue tab in the left panel. You might notice that there is no option to directly add Claude 3.7.

 

Using Claude 3.7 Locally

 

  1. Instead, click on the “config file” link at the bottom to add the model manually with the API key:
{
"model": "claude-3-7-sonnet-20250219",
"provider": "anthropic",
"apiKey": "XXXXXXXXX",
"title": "Claude 3.7 Sonnet"
},

 

Here is how it looks. 

 

Using Claude 3.7 Locally

 

Once you save the config file, that model will start showing up on your side. Select the model and start using it.

 

Using Claude 3.7 Locally

 

It is fast and understands the code context perfectly.

 

Using Claude 3.7 Locally

 

Final Thoughts

 
The total cost of our experiment was $0.10, meaning that if you are not a regular user, you can save a lot. 

The most important aspect is that you can integrate this API into your code editor, build your own custom applications, and also integrate it into your existing projects. Doing all of this will not cost you more than $20 USD.

So, give Anthropic’s API a try and start experiencing the magic of the new Claude 3.7 model!
 
 

Abid Ali Awan (@1abidaliawan) is a certified data scientist professional who loves building machine learning models. Currently, he is focusing on content creation and writing technical blogs on machine learning and data science technologies. Abid holds a Master’s degree in technology management and a bachelor’s degree in telecommunication engineering. His vision is to build an AI product using a graph neural network for students struggling with mental illness.

Recent Articles

Related Stories

Leave A Reply

Please enter your comment!
Please enter your name here