Visual Studio IntelliCode Team Model Training
Visual Studio IntelliCode Team Model Training is an Azure Pipelines task that creates and updates team models.
IntelliCode team models allow you to get AI-assisted IntelliSense recommendations based on your C# and C++ codebases and are useful when working with your own types or domain-specific libraries that aren’t commonly used in open source code.
Add this task to your CI/CD pipeline to create a team model for your solution and keep it up to date when your codebase changes.
When code changes are pushed to your repository and this build task runs, the team model for completions is retrained and then made available to everyone that you've shared the model with. Visual Studio periodically checks for updates to team models and will download updates to your team model automatically.
Before you start, make sure that:
- You have permission to create and edit pipelines for the project.
- Your project uses Git source control.
- The build agent has the minimum required version of Visual Studio installed.
- For C# repositories: Visual Studio 2017 or higher
- For C++ repositories: Visual Studio 2019 Update 4 or higher
- To acquire the team completions you must be on at least Visual Studio 2019 version 16.4 preview 4 or higher.
- The IntelliCode task must be completed within 1 hour of the start of the pipeline.
- We recommend setting up a simpler pipeline for the IntelliCode task if you have a lengthy build process.
- You have enabled acquisition of team models. You can verify this setting in Tools > Options > IntelliCode > Acquire team models for completions.
- Install this task to your Azure DevOps organization.
- Set up a service connection for IntelliCode. This connection is used to upload the training data to create the model. You only need to do this once, the same connection can be reused for multiple pipelines.
Set up team model creation and retraining using the YAML editor:
- Search for and add the IntelliCode task in the assistant pane.
- In the task configuration pane, type the branch that you want to train the model on.
- We recommend using any persistent branch such as master or a release branch.
- Select the IntelliCode service connection you'd like to use for this task from the dropdown.
- If you don't have an available service connection, you'll need to create one before you can proceed.
- Ensure the IntelliCode Model Training task occurs after your build step.
- Save and run your pipeline to create your model.
- Open the corresponding repository from your pipeline in Visual Studio to download the created team model via the automatic team model acquisition feature after your pipeline completes.
- Your model will be automatically updated and shared with each CI build.
Set up team model creation and retraining in Azure Pipelines using the classic editor:
- Add the IntelliCode Build task to your pipeline. Place it after any build tasks.
- In the task configuration pane, select the branch that you want to train the model on. We recommend using any persistent branch such as master or a release branch.
- Select an existing IntelliCode connection from the dropdown or select New to create a new OAuth 2.0 connection to the IntelliCode service. This connection is used to upload the training data to create the model.
- Save and run your pipeline to create your team model.
- Open the corresponding repository to your pipeline in Visual Studio to automatically download the created team model via the automatic team model acquisition feature after your pipeline completes.
- Your model will be automatically updated with each CI build.
Team Models in Visual Studio
When you have successfully configured your pipeline to run this task, the model will be created or updated for your specified solution every time the build completes. Visual Studio will periodically check for updates to the model. When the model is downloaded to Visual Studio, you will see starred recommendations for your custom types.
Learn more about Visual Studio IntelliCode and Team Models:
How do I report feedback and issues?
Report an issue with the Visual Studio IntelliCode Team Model Training task
There is much more to come -- sign up here for future news and updates!