Code Assistants with Tinfoil
Learn how to use the Cline AI assistant with the Tinfoil Private Inference API to assist with your software development tasks.
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:
- Create a Python program for the Tinfoil Inference API.
- 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:
- Open VS Code.
- Click on the Extensions icon in the sidebar and search for ‘Cline’.
- Click Install next to the Cline extension.
- Reload VS Code when prompted.
Configure Cline to use the Tinfoil API
Next, configure Cline to use the Tinfoil Inference API:
- In the Activity Bar, click the Cline icon.
- Click the Settings (⚙) button.
- 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.
- 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
-
In the “Type your task here” field, enter the following prompt:
-
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.
-
Cline outputs a message confirming that your task has been completed. The process should look something like this: