[0:00] One of the editors I use is Zed editor, [0:02] and most of the time I use it together [0:04] with local models. So today I want to [0:06] show you how I connect it to local [0:08] LLM's, both models running on the same [0:10] computer as the editor, and models [0:12] running on another computer in the local [0:14] network that can be very convenient when [0:16] you want to run models on a more [0:17] powerful machine with a stronger GPU. [0:20] And since I usually use Ollama and LM [0:21] Studio to run models, I'll use those as [0:23] examples today. But before that, I want [0:26] to congratulate the Zed editor team on [0:28] the release of version 1.0. I've been [0:30] using this editor since the closed beta [0:31] days, and the progress over the last few [0:33] years has been truly impressive. So [0:35] let's start with Ollama. First, I'll [0:37] check in the console that Ollama is [0:39] working properly, so if anything goes [0:41] wrong later, I know the issue is not [0:42] there. First, let's look at the list of [0:44] models available on this computer. I [0:46] already have several downloaded. Let me [0:48] choose Gemma 4. Now I'll launch it and [0:50] ask it to answer something, just to make [0:51] sure it works correctly. Yes, the model [0:54] loaded into memory successfully, thought [0:55] for a moment, and then gave me a [0:57] response. So everything looks good. Now [0:59] I know that both Ollama and the selected [1:01] model are working. Now let's go to Zed [1:03] editor and open the agent panel. In the [1:05] settings for this panel, there is a [1:06] section for LLM providers. That's [1:09] exactly what we need. There we can find [1:11] an option called Ollama. By default, the [1:13] local URL with the correct port is [1:15] already filled in here. That is the [1:17] default Ollama address, and if you [1:19] didn't change anything when setting up [1:20] Ollama, then you don't need to change [1:22] anything here either. I will only [1:23] increase the context window size because [1:25] when the model uses tools, 8,000 tokens [1:28] may be too little. I'll increase it to [1:30] 60,000 for now. That should be enough to [1:32] start with. Now we press the connect [1:33] button so Zed editor can verify that [1:35] Ollama is available at that URL and load [1:38] the list of available models. As you can [1:40] see, a green check mark appeared along [1:42] with the word connected, which means Zed [1:44] successfully connected to Ollama, and [1:46] everything is working properly. All [1:47] right, now let's close the settings [1:49] window and look at the list of available [1:51] models. We can see a new section called [1:53] Ollama, and inside it are the models [1:55] available to us. As you can see, they [1:57] are the same models that were shown in [1:58] the console earlier when we launched [2:00] Ollama. Let me also choose the same [2:02] model here that I used in the console, [2:04] Gemma 4. And again, just to verify that [2:06] everything is definitely working, I'll [2:08] type something to it. It doesn't really [2:09] matter what. The important thing is to [2:11] confirm that I can interact with my [2:13] local model directly from the editor. [2:15] Okay, the model thought for a moment and [2:17] then replied. Great, that means [2:19] everything is configured and working [2:20] exactly as it should. Let me also show [2:22] you a couple of important things you [2:24] should pay attention to. The first one [2:25] is the agent profile. To simplify it a [2:27] lot, this determines what the agent is [2:29] allowed to do. There are three built-in [2:31] profiles, and if you want the model to [2:33] be able to edit and create files inside [2:35] your project, choose the right profile. [2:37] The second thing I want to point out is [2:39] the thinking mode switch. If the LLM you [2:42] selected supports reasoning before [2:43] answering, you can enable or disable it [2:45] here. It can be useful to experiment [2:47] with turning it on or off, especially if [2:49] the model responds very slowly and you [2:51] want to speed things up a bit. All [2:53] right, now that we've covered Ollama, [2:55] let's do the same thing with LM Studio. [2:57] Just like with Ollama, I'll first check [2:58] in the console that LM Studio starts [3:00] without any problems. I'll also launch a [3:02] model to make sure everything is working [3:04] properly there as well. Since I [3:05] currently have only one model loaded in [3:07] LM Studio, that's the one I'll use. Yes, [3:10] everything works here too. The model [3:11] responds to my requests. Okay, now let's [3:14] go back to Zed editor and once again [3:16] open the agent panel settings section [3:18] with LLM providers. This time we look [3:20] for the option called LM Studio. Here [3:22] again, just like with Ollama, the [3:24] correct default URL is already entered, [3:26] so there is nothing to change. We simply [3:28] click connect, and Zed editor checks [3:30] that everything is working, connects to [3:31] LM Studio, and retrieves the list of [3:33] available models. As you can see, [3:35] everything went successfully. The editor [3:37] connected to LM Studio. Now let me open [3:39] a new chat and then choose a new model [3:41] for that chat provided by LM Studio. As [3:44] you can see, a new section dedicated to [3:45] LM Studio has appeared, and since I only [3:48] have one model loaded in LM Studio, [3:49] there is not much to choose from. So we [3:51] simply select that one. Okay, this time [3:53] I'll ask the model to do something [3:55] useful, and as you can see, it [3:56] successfully processed my request and [3:58] wrote "Hello world" in several [4:00] languages. Excellent. The combination of [4:02] Zed editor and LM Studio works as well. [4:05] So, as you can see, connecting local [4:07] models to Zed editor is quite simple. It [4:09] only takes a few clicks, and by the way, [4:12] you can switch between them at any time. [4:14] Now let me show you a slightly more [4:15] advanced case, when the LLM's are [4:17] running on another computer inside your [4:19] local network. To do that, we go into [4:21] the model settings. The simplest way [4:23] would be to just change the URL for the [4:25] existing Ollama and LM Studio entries. [4:28] If you only plan to use models running [4:30] on another computer, then that is [4:31] exactly what you should do. But I want [4:33] to be able to switch dynamically between [4:35] smaller models running on my laptop and [4:37] larger models running on my desktop [4:39] machine. So I'll use a different [4:40] approach. In the header of the LLM [4:42] providers section, there is a button for [4:44] adding a new provider. We click it and [4:46] choose the option OpenAI compatible. [4:49] Then we enter a name. In my case, I'll [4:51] call it Ollama desktop, so I always know [4:53] what these models are. And then I enter [4:55] the address of the other computer where [4:57] Ollama is running. [4:58] In the API key field, you can enter any [5:01] text. By default, Ollama does not [5:03] require a key. After that, we save it. [5:05] Oh, wait, it won't let me save without [5:07] specifying the default model name. All [5:09] right, let me enter one of the models I [5:11] already have loaded on my desktop. Okay, [5:13] now that everything is filled in and [5:14] saved, we can finally test it. I'll type [5:17] a test message in the chat. [5:19] Oops, it doesn't work. Looks like I made [5:21] a mistake somewhere. But that's fine, [5:23] we'll figure it out. Let's close the [5:25] agent panel for a moment and open the [5:26] settings file so it's easier to see [5:28] where I went wrong. By the way, this is [5:30] a very convenient feature in Zed editor. [5:32] Every change you make through the UI is [5:34] reflected directly in the config files. [5:37] All right, here is the section for the [5:38] provider I just added. So what's wrong [5:40] here? Ah, I see it. In the API URL [5:43] field, when adding your own LLM [5:45] provider, you need to specify the full [5:47] path including the port number and the [5:49] protocol version. All right, I'll save [5:51] the settings and try again. Success. Now [5:54] it works. I was able to access an LLM [5:56] running on my desktop from the editor [5:58] running on my laptop. Excellent. I'm not [6:00] going to demonstrate connecting to LM [6:02] Studio on the desktop because the [6:04] process is identical to Ollama, only the [6:06] URL is slightly different. So as you can [6:08] see, using local models in Zed editor is [6:11] very simple. And on top of that, you can [6:13] configure everything in whatever way [6:15] works best for you. That's exactly why I [6:17] like Zed so much. That's all for today. [6:19] If you enjoyed this video, give it a [6:21] like and subscribe so you don't miss the [6:23] next episodes. See you soon. Take care.