[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"\u002Fp\u002Fintegrate-mistral-codestral-vscode":3},{"id":4,"title":5,"aws":6,"body":7,"categories":566,"createdAt":568,"description":569,"difficulty":570,"extension":571,"image":572,"links":574,"meta":588,"navigation":589,"path":590,"seo":591,"sitemap":592,"stem":601,"tags":602,"toc":589,"type":606,"updatedAt":600,"__hash__":607},"p\u002Fp\u002Fintegrate-mistral-codestral-vscode.md","How to Use Mistral Codestral in Visual Studio Code",false,{"type":8,"value":9,"toc":561},"minimark",[10,14,19,22,99,103,106,364,368,376,557],[11,12,13],"p",{},"Mistral Codestral is a powerful code generation model designed by Mistral AI to assist developers in writing, debugging, and optimizing code. In this tutorial, you will learn two methods to integrate Mistral Codestral into Visual Studio Code: using the Mistral Studio API and running the model locally on your machine with LM Studio.",[15,16,18],"h2",{"id":17},"which-method-should-you-choose","Which Method Should You Choose?",[11,20,21],{},"For a quick, cloud-based setup, use Codestral via Mistral AI Studio, ideal for hassle-free coding with minimal configuration. If you prefer full control, offline access, or customization, LM Studio is the way to go, offering flexibility and hardware optimization.\nHere’s a detailed comparison to help you decide:",[23,24,25,40],"table",{},[26,27,28],"thead",{},[29,30,31,34,37],"tr",{},[32,33],"th",{},[32,35,36],{},"Mistral Studio API",[32,38,39],{},"LM Studio",[41,42,43,55,66,77,88],"tbody",{},[29,44,45,49,52],{},[46,47,48],"td",{},"Internet required",[46,50,51],{},"Yes",[46,53,54],{},"No (offline)",[29,56,57,60,63],{},[46,58,59],{},"Model version",[46,61,62],{},"Always latest",[46,64,65],{},"Manual updates",[29,67,68,71,74],{},[46,69,70],{},"Hardware requirements",[46,72,73],{},"Cloud based",[46,75,76],{},"A powerfull machine to run Codestral",[29,78,79,82,85],{},[46,80,81],{},"Privacy",[46,83,84],{},"Data sent to Mistral servers",[46,86,87],{},"Data stays on your machine",[29,89,90,93,96],{},[46,91,92],{},"Use case",[46,94,95],{},"Always up-to-date, low-maintenance",[46,97,98],{},"Offline, full control over model",[15,100,102],{"id":101},"using-codestral-via-mistral-ai-studio","Using Codestral via Mistral AI Studio",[11,104,105],{},"This first method will use Codestral from Mistral AI Studio to use on VS Code. The only requirement needed for this method is a valid Mistral AI account.",[107,108,110,115,131,138,145,149,158,170,174,185,207,228,351,355,358],"steps",{"level":109},"4",[111,112,114],"h4",{"id":113},"retrieve-your-codestral-api-key","Retrieve your Codestral API key",[11,116,117,118,125,126,130],{},"Use your Mistral AI account to access ",[119,120,124],"a",{"href":121,"rel":122},"https:\u002F\u002Fconsole.mistral.ai\u002F",[123],"nofollow","AI Studio"," page. In the left panel, select ",[127,128,129],"strong",{},"Codestral"," under Code section.",[11,132,133],{},[134,135],"img",{"alt":136,"src":137},"Mistral AI Studio Console","\u002Fp\u002Fintegrate-mistral-codestral-vscode\u002Fmistral-ai-studio.png",[11,139,140,141,144],{},"Click ",[127,142,143],{},"Request Access",", accept the Terms of Service and copy your API key.",[111,146,148],{"id":147},"install-the-continue-extension-in-vs-code","Install the Continue extension in VS Code",[11,150,151,152,157],{},"To use Codestral as a code assistant, install ",[119,153,156],{"href":154,"rel":155},"https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=Continue.continue",[123],"Continue"," extension from the VS Code marketplace. Let Auto Update enabled for seamless future updates.",[159,160,161],"note",{},[11,162,163,164,169],{},"If you would like to use other extension such as ",[119,165,168],{"href":166,"rel":167},"https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=saoudrizwan.claude-dev",[123],"Cline",", which required more setup, I will propose another tutorial soon.",[111,171,173],{"id":172},"configure-continue-for-codestral","Configure Continue for Codestral",[11,175,176,177,180,181,184],{},"To set up Codestral on Continue, click on Continue icon on the left bar of your VS Code. On the new panel that opened, click the ",[127,178,179],{},"Select model"," then ",[127,182,183],{},"Add Chat model",".",[186,187,188,199],"two-columns",{},[189,190,192],"template",{"v-slot:left":191},"",[11,193,194],{},[134,195],{"alt":196,"src":197,"width":198},"Continue Setup Screen","\u002Fp\u002Fintegrate-mistral-codestral-vscode\u002Fcontinue-setup.png",350,[189,200,201],{"v-slot:right":191},[11,202,203],{},[134,204],{"alt":205,"src":206,"width":198},"Add Model on Continue","\u002Fp\u002Fintegrate-mistral-codestral-vscode\u002Fcontinue-codestral-setup.png",[11,208,209,210,213,214,217,218,213,220,223,224,227],{},"On the new page, select ",[127,211,212],{},"Mistral"," as the ",[127,215,216],{},"Provider"," and ",[127,219,129],{},[127,221,222],{},"Model",", then paste the API key you recover in the earlier step. You can finally click ",[127,225,226],{},"Connect"," and voilà!",[229,230,232,235,341],"collapsible",{"name":231},"Continue config file",[11,233,234],{},"If you prefer to setup Continue via the config file directly, you can use the following code:",[236,237,242],"pre",{"className":238,"code":239,"filename":240,"language":241,"meta":191,"style":191},"language-yml shiki shiki-themes min-light min-light plastic","name: Local Config\nversion: 1.0.0\nschema: v1\nmodels:\n- name: Codestral\n  provider: mistral\n  model: codestral-latest\n  apiKey: \u003CCODESTRAL_API_KEY>\n","config.yaml","yml",[243,244,245,262,274,285,294,308,319,330],"code",{"__ignoreMap":191},[246,247,250,254,258],"span",{"class":248,"line":249},"line",1,[246,251,253],{"class":252},"s6W6U","name",[246,255,257],{"class":256},"siOgq",":",[246,259,261],{"class":260},"sw9Es"," Local Config\n",[246,263,265,268,270],{"class":248,"line":264},2,[246,266,267],{"class":252},"version",[246,269,257],{"class":256},[246,271,273],{"class":272},"sAhIg"," 1.0.0\n",[246,275,277,280,282],{"class":248,"line":276},3,[246,278,279],{"class":252},"schema",[246,281,257],{"class":256},[246,283,284],{"class":260}," v1\n",[246,286,288,291],{"class":248,"line":287},4,[246,289,290],{"class":252},"models",[246,292,293],{"class":256},":\n",[246,295,297,301,303,305],{"class":248,"line":296},5,[246,298,300],{"class":299},"slmz-","- ",[246,302,253],{"class":252},[246,304,257],{"class":256},[246,306,307],{"class":260}," Codestral\n",[246,309,311,314,316],{"class":248,"line":310},6,[246,312,313],{"class":252},"  provider",[246,315,257],{"class":256},[246,317,318],{"class":260}," mistral\n",[246,320,322,325,327],{"class":248,"line":321},7,[246,323,324],{"class":252},"  model",[246,326,257],{"class":256},[246,328,329],{"class":260}," codestral-latest\n",[246,331,333,336,338],{"class":248,"line":332},8,[246,334,335],{"class":252},"  apiKey",[246,337,257],{"class":256},[246,339,340],{"class":260}," \u003CCODESTRAL_API_KEY>\n",[342,343,344],"warning",{},[11,345,346,347,350],{},"Don't forget to replace ",[243,348,349],{},"\u003CCODESTRAL_API_KEY>"," with your API key retrieved in the previous step.",[111,352,354],{"id":353},"use-codestral-in-vs-code","Use Codestral in VS Code",[11,356,357],{},"You’re ready! Chat directly with Codestral in VS Code for real-time coding assistance.",[359,360],"centered-image",{"alt":361,"src":362,":height":363},"Continue Codestral Chat","\u002Fp\u002Fintegrate-mistral-codestral-vscode\u002Fcontinue-codestral-chat.png","420",[15,365,367],{"id":366},"running-codestral-locally-with-lm-studio","Running Codestral Locally with LM Studio",[11,369,370,371,375],{},"This second method walks you through hosting Codestral 22B locally using ",[119,372,39],{"href":373,"rel":374},"https:\u002F\u002Flmstudio.ai\u002F",[123]," and integrating it with VS Code.",[107,377,378,382,392,398,409,414,439,442,446,456,461,464,468,475,479,486,495,501,505,519,538,546,549,552],{"level":109},[111,379,381],{"id":380},"download-the-codestral-model","Download the Codestral model",[11,383,384,385,388,389,391],{},"Open LM Studio and click on the ",[127,386,387],{},"search icon"," on the left side. In the search bar, type ",[127,390,212],{}," to filter Mistral’s models.",[11,393,394],{},[134,395],{"alt":396,"src":397},"LM Studio Model Search","\u002Fp\u002Fintegrate-mistral-codestral-vscode\u002Flm-studio-codestral.png",[11,399,400,401,404,405,408],{},"Select ",[127,402,403],{},"Codestral 22B v0.1"," from the results. Click the small arrow in the ",[127,406,407],{},"Download Options"," panel to view available quantization options.",[359,410],{"alt":411,"src":412,":height":413},"Codestral Quantization List","\u002Fp\u002Fintegrate-mistral-codestral-vscode\u002Flm-studio-codestral-list.png","600",[159,415,416],{},[11,417,418,421,424,425,428,429,428,432,435,436,438],{},[127,419,420],{},"What is quantization?",[422,423],"br",{},"\nQuantization reduces the model’s precision to decrease its size and speed up inference. LM Studio labels these options with tags like ",[243,426,427],{},"Q2_K",", ",[243,430,431],{},"Q3_K_M",[243,433,434],{},"Q3_K_L",", etc...",[422,437],{},"\nLM Studio highlights the best option for your hardware with a thumbs-up icon.",[11,440,441],{},"Select the appropriate Codestral and click Download. Wait for the process to complete.",[111,443,445],{"id":444},"load-and-run-codestral-in-lm-studio","Load and Run Codestral in LM Studio",[11,447,448,449,452,453,455],{},"To start a model on LM Studio, click ",[127,450,451],{},"Select a model to load"," in the top bar. Select ",[127,454,403],{}," from your downloaded models. LM Studio will load it in order to run it.",[359,457],{"alt":458,"src":459,":width":460},"LM Studio Codestral Quantization List","\u002Fp\u002Fintegrate-mistral-codestral-vscode\u002Flm-studio-load-model.png","700",[11,462,463],{},"Once the model is loaded you will need to start LM Studio server to expose it. To do it, click on the terminal icon on the left sidebar. On the new window, click on the toggle button.",[359,465],{"alt":466,"src":467,":width":460},"LM Studio Server Start","\u002Fp\u002Fintegrate-mistral-codestral-vscode\u002Flm-studio-server.png",[11,469,470,471,184],{},"By default, LM Studio will expose your models on ",[119,472,473],{"href":473,"rel":474},"http:\u002F\u002F127.0.0.1:1234",[123],[111,476,478],{"id":477},"install-the-cline-extension-in-vs-code","Install the Cline extension in VS Code",[11,480,481,482,485],{},"To use Codestral in VS Code, install ",[119,483,168],{"href":166,"rel":484},[123],", a free extension that supports multiple LLM provider (LM Studio, Ollama, Amazon Bedrock, etc...).",[159,487,488],{},[11,489,490,491,494],{},"Cline does not natively support CodeStral from Mistral AI Studio, this is the reason why we used ",[119,492,156],{"href":154,"rel":493},[123]," in the first method. I will propose another tutorial soon to cover the use of Cline with Mistral AI Studio.",[11,496,497,498,500],{},"To install it, search for ",[127,499,168],{}," in the VS Code marketplace and click Install (I recommend you to keep enabled Auto Update).",[111,502,504],{"id":503},"set-up-lm-studio-in-vs-code","Set Up LM Studio in VS Code",[11,506,507,508,511,512,514,515,518],{},"Once installed, open Cline from the left sidebar. On the new panel, select ",[127,509,510],{},"Bring my own API key"," and click Continue. On the next page, select ",[127,513,39],{}," as API Provider and ",[243,516,517],{},"mistralai\u002Fcodestral-22b-v0.1"," as Model.",[186,520,521,530],{},[189,522,523],{"v-slot:left":191},[11,524,525],{},[134,526],{"alt":527,"src":528,"height":529},"Cline Setup Screen","\u002Fp\u002Fintegrate-mistral-codestral-vscode\u002Fcline-setup.png",400,[189,531,532],{"v-slot:right":191},[11,533,534],{},[134,535],{"alt":536,"src":537,"height":529},"Cline Setup LM Studio","\u002Fp\u002Fintegrate-mistral-codestral-vscode\u002Fcline-setup-lm-studio.png",[159,539,540],{},[11,541,542,543,184],{},"For better performance on mid-range machines, enable ",[127,544,545],{},"Use compact prompt",[111,547,354],{"id":548},"use-codestral-in-vs-code-1",[11,550,551],{},"You’re all set! Start chatting with your locally hosted Codestral model directly in VS Code.",[359,553],{"alt":554,"src":555,":height":556},"Cline Chat","\u002Fp\u002Fintegrate-mistral-codestral-vscode\u002Fcline-chat.png","500",[558,559,560],"style",{},"html pre.shiki code .s6W6U, html code.shiki .s6W6U{--shiki-light:#D32F2F;--shiki-default:#D32F2F;--shiki-dark:#E5C07B}html pre.shiki code .siOgq, html code.shiki .siOgq{--shiki-light:#D32F2F;--shiki-default:#D32F2F;--shiki-dark:#A9B2C3}html pre.shiki code .sw9Es, html code.shiki .sw9Es{--shiki-light:#22863A;--shiki-default:#22863A;--shiki-dark:#98C379}html pre.shiki code .sAhIg, html code.shiki .sAhIg{--shiki-light:#1976D2;--shiki-default:#1976D2;--shiki-dark:#56B6C2}html pre.shiki code .slmz-, html code.shiki .slmz-{--shiki-light:#24292EFF;--shiki-default:#24292EFF;--shiki-dark:#A9B2C3}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":191,"searchDepth":264,"depth":264,"links":562},[563,564,565],{"id":17,"depth":264,"text":18},{"id":101,"depth":264,"text":102},{"id":366,"depth":264,"text":367},[567],"AI","2025-11-22","Learn how to integrate Mistral Codestral in Visual Studio Code using the Mistral Studio API for cloud-based access or LM Studio for offline use.","L200","md",{"src":573},"\u002Fcovers\u002Fintegrate-mistral-codestral-vscode.jpg",{"tools":575,"models":583},[576,580],{"label":577,"icon":578,"to":579},"VS Code","logos:visual-studio-code","\u002Fr\u002Fvs-code",{"label":39,"icon":581,"to":582},"icon:lm-studio","\u002Fr\u002Flm-studio",[584],{"label":585,"icon":586,"to":587},"Mistral AI Codestral","icon:mistral","\u002Fr\u002Fmistral",{},true,"\u002Fp\u002Fintegrate-mistral-codestral-vscode",{"title":5,"description":569},{"loc":590,"images":593,"lastmod":600},[594,595,596,597,598,599],{"loc":137},{"loc":197},{"loc":206},{"loc":397},{"loc":528},{"loc":537},"2026-01-26","p\u002Fintegrate-mistral-codestral-vscode",[603,168,604,156,605],"API","Code","LLM","Tutorial","-K4fLQIf_xRZ7QWK-yQ3olFORLmRuTeUDRes5D4lX3k"]