MaruOpsInfrastructure and AI notes

About (Korean)Contact (Korean)

[Local LLM 07] Use GGUF Models and the API in LM Studio

Wooden desk with laptop and mug

Reference photo · Wooden desk with laptop and mug · Photo: Ryan Riggins ryan_riggins / Source / CC0 · Resized for listings; illustrative photo, not the tested environment

Building a Local LLM · 07/30 · Introduction

Full series and learning sequence · Practice code ZIP

LM Studio provides a graphical way to choose model files and quantization variants. Follow the download, loading and response checks used earlier with Ollama, then compare how the two tools manage those steps. Choose the workflow that suits the project; the exercise does not require keeping both runtimes.

Prepare space to store LM Studio for Windows and the model. Proceed separately between opening the chat screen and turning on the API server.

Select GGUF file

Install the Windows version from LM Studio official site. Search for model name or Hugging Face repository address in Discover. Qwen/Qwen3-8B-GGUF is an example of a GGUF repository distributed by the Qwen organization. If 8B is too much for your memory, look for the smaller official model first.

Search results also include files quantized by the community. If you write down the original developer, base model, and quantization creator separately, it will be easier to find the same file later. Initially, review files with 4 bits or more that will fit into memory, but execution is not guaranteed just by the app’s suitability instructions.

Model loading and context setting

Select the downloaded model in Chat and first limit the context length to around 4096. If your Ollama model is on the same GPU, take it down first. Loading may fail because the two models share VRAM. If a separate thinking output is generated from the Qwen3 basic model, a comparison record is also recorded.

ollama ps
ollama stop qwen3:4b-instruct

Reuse the note from Part 1 and save the response. If Ollama uses the 4B Instruct model while LM Studio uses the 8B base model, the model weights differ as well as the runtime. To compare runtimes, match the weights, quantization, prompt template and sampling settings.

Start local API server

To use the API, start the server from the Developer screen. Read the actual address and port on the screen. The command below is an example using the default port 1234. If you have token authentication turned on, you must also include an authentication header in your request.

Invoke-RestMethod http://127.0.0.1:1234/v1/models

The id under data in the response is the model identifier for the API. It is not assumed to be the same as your app’s display name or Ollama tag. The Ollama example in Part 13 uses /api/chat on port 11434, so when using it, you must match not only the address but also the JSON format.

When practicing only on the same PC, there is no reason to set the server to be open to an external network. Connecting from a mobile phone is the next step, requiring separate authentication and network design.

Classification of download, loading, and server errors

statusJudgment criteria
Model download completeFile exists in My Models
Memory loading completedChat can be answered by selected model
Run API serverNormal response to /v1/models
API inference successReceive a response to a chat request with the selected ID

It is easy to find errors by checking each download, model loading, and server startup. Even if you receive all the files, loading may fail if RAM or VRAM is insufficient, and even if you turn on the server, chatting may not be possible depending on the automatic loading settings. The management structure is different from Ollama, so there is no need to force the two model repositories to be merged.

reference material

Documentation and model tags checked: October 18, 2026. Primary lab environment: Windows 11 x64.