This guide will help you connect the language models available on the Lehmus AI: Secure Generative AI Platform to Visual Studio Code. The guide will help you add Lehmus AI’s language to the Language Models settings in Visual Studio Code and enable them, for example, in the chat in Visual Studio Code.
What you need before you start
- Visual Studio Code installed
- Access rights to Lehmus AI platform, see instructions on Lehmus AI: Secure Generative AI Platform
- API key created in the Lehmus AI portal
- The Public Model IDs of the language models that you want to add to Visual Studio Code
You can find a list of available language models and their most important, supported features in the guide: Lehmus AI: Available LLM Models
How to connect language models
Open the Language Models settings in Visual Studio Code
Open Language Models editor. You can open it in two ways:
- Select View > Command Palette… > Chat: Manage Language Models
- Open the chat > click on the language model’s selection in the chat window > select Manage Language Models from the gear icon next to Other Models
Add new Custom Endpoint
When the Language Models editor has been opened, select Add Models and then Custom Endpoint from the list that opens.
Define the group name and API key
Next, enter the Group Name. The name will appear later when selecting language models and in the Language Models editor. The Lehmus AI platform language models that you enable in Visual Studio Code will be listed under this group name. You can give the group a name such as Lehmus AI. You can edit the name later in the Language Models editor if necessary.
Next, enter the API key that you have created in the Lehmus AI portal. Instructions for creating an API key are described in the Welcome to Lehmus AI: Quick Start Guide section, Setting Up Endpoints & API Keys.
Select API-type
Next, select the type of API. The options are Chat Completions, Responses and Messages. For Lehmus AI, it is recommended to select Chat Completions.
Define language models in the chatLanguageModels.json file
Visual Studio Code will then open the chatLanguageModels.json file. In this file, you define the language models that you want to use in Visual Studio Code.
- Add the Public Model ID of the language model to the id field, which you can find in the information for each model on the Lehmus AI portal.
- Add the name of the language model whose id you added in the previous field to the name field
- Add the API address to the url field: https://api.lehmus-ai.oulu.fi
- You can check other values related to defining models on the Lehmus AI: Available LLM models page. The page describes typical uses for each Lehmus AI platform model and the most important, supported features, such as Max model length, which is helpful in determining the maxTokens value, for example.
You can find the Public Model ID of each language model in the Lehmus AI portal by going to the Models page and opening the information for each language model. Please add only those language models that are included in the API key you created earlier to the chatLanguageModels.json file.