Introduction

The Tinfoil Private Inference API can be used with the Cline AI assistant and VS Code to obtain a fully-private coding assistant. Cline can be used for code completions, explanations, creating and editing files, running commands in the terminal, and more. Tinfoil makes all the AI inference requests private, so your code and files are never exposed to third parties.

In this tutorial, you’ll first install Cline and configure Cline to use the Tinfoil API. Then, you’ll instruct Cline to perform two tasks using the private API:

  1. Create a Python program for the Tinfoil Inference API.
  2. Create a README with instructions for using the program.

Prerequisites

For this tutorial, you’ll need a Tinfoil API key, which you can obtain for free by creating an account on tinfoil.sh.

You’re billed for all usage of the Tinfoil Inference API. See the Tinfoil Inference for current pricing information.

Security Warning Never share your API key, be careful to not include it in version control systems, and never bundle it in with front-end client code.

Install Cline in VS Code

First, install Cline in VS Code:

  1. Open VS Code.
  2. Click on the Extensions icon in the sidebar and search for ‘Cline’.
  3. Click Install next to the Cline extension.
  4. Reload VS Code when prompted.

Configure Cline to use the Tinfoil API

Next, configure Cline to use the Tinfoil Inference API:

  1. In the Activity Bar, click the Cline icon.
  2. Click the Settings (⚙) button.
  3. For API Provider, choose OpenAI Compatible.

Enter the values below. Replace <API-KEY> with your Tinfoil API key:

  • Base URL: https://deepseek-r1-70b-p.tinfoil.sh/v1/
  • API Key: <API-KEY>
  • Model ID: deepseek-r1-70b

Tip You can use any of the models that the Tinfoil Inference API supports instead of deepseek-r1-70b. See the latest available models running on Tinfoil.

  1. Click Done.

Instruct Cline to perform tasks

Finally, instruct Cline to create a:

  • Python program for the Tinfoil Inference API
  • README that explains how to use the program
  1. In the “Type your task here” field, enter the following prompt:

    In one file, create a Python program based on the following command. The program should prompt for the values of <API-KEY> and <MODEL>.
    
    curl -sS https://deepseek-r1-70b-p.tinfoil.sh/v1/chat/completions \
    -H "Authorization: Bearer <API-KEY>" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "<MODEL>",
      "prompt": "Computers are",
      "temperature": 0
    }'
    
    In another file, create a README that explains how to use the program.
    
  2. Press Enter to run the task. Cline explains the specific steps it will take to complete the task, and then begins creating the requested Python program and the README.

  3. Cline outputs a message confirming that your task has been completed. The process should look something like this: