You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description = "Learn how to install, configure, and manage models in LocalAI"
6
7
+++
7
8
8
-
To install models with LocalAI, you can:
9
+
This section covers everything you need to know about installing and configuring models in LocalAI. You'll learn multiple methods to get models running.
9
10
10
-
- Browse the Model Gallery from the Web Interface and install models with a couple of clicks. For more details, refer to the [Gallery Documentation]({{% relref "features/model-gallery" %}}).
11
-
- Specify a model from the LocalAI gallery during startup, e.g., `local-ai run <model_gallery_name>`.
12
-
- Use a URI to specify a model file (e.g., `huggingface://...`, `oci://`, or `ollama://`) when starting LocalAI, e.g., `local-ai run huggingface://TheBloke/phi-2-GGUF/phi-2.Q8_0.gguf`.
13
-
- Specify a URL to a model configuration file when starting LocalAI, e.g., `local-ai run https://gist.githubusercontent.com/.../phi-2.yaml`.
14
-
- Manually install the models by copying the files into the models directory (`--models`).
11
+
## Prerequisites
15
12
16
-
## Run and Install Models via the Gallery
13
+
- LocalAI installed and running (see [Quickstart]({{% relref "getting-started/quickstart" %}}) if you haven't set it up yet)
14
+
- Basic understanding of command line usage
17
15
18
-
To run models available in the LocalAI gallery, you can use the WebUI or specify the model name when starting LocalAI. Models can be found in the gallery via the Web interface, the [model gallery](https://models.localai.io), or the CLI with: `local-ai models list`.
16
+
## Method 1: Using the Model Gallery (Easiest)
19
17
20
-
To install a model from the gallery, use the model name as the URI. For example, to run LocalAI with the Hermes model, execute:
18
+
The Model Gallery is the simplest way to install models. It provides pre-configured models ready to use.
19
+
20
+
### Via WebUI
21
+
22
+
1. Open the LocalAI WebUI at `http://localhost:8080`
23
+
2. Navigate to the "Models" tab
24
+
3. Browse available models
25
+
4. Click "Install" on any model you want
26
+
5. Wait for installation to complete
27
+
28
+
For more details, refer to the [Gallery Documentation]({{% relref "features/model-gallery" %}}).
Note: The galleries available in LocalAI can be customized to point to a different URL or a local directory. For more information on how to setup your own gallery, see the [Gallery Documentation]({{% relref "features/model-gallery" %}}).
33
56
34
-
## Run Models via URI
57
+
### Browse Online
58
+
59
+
Visit [models.localai.io](https://models.localai.io) to browse all available models in your browser.
60
+
61
+
## Method 1.5: Import Models via WebUI
62
+
63
+
The WebUI provides a powerful model import interface that supports both simple and advanced configuration:
64
+
65
+
### Simple Import Mode
66
+
67
+
1. Open the LocalAI WebUI at `http://localhost:8080`
68
+
2. Click "Import Model"
69
+
3. Enter the model URI (e.g., `https://huggingface.co/Qwen/Qwen3-VL-8B-Instruct-GGUF`)
70
+
4. Optionally configure preferences:
71
+
- Backend selection
72
+
- Model name
73
+
- Description
74
+
- Quantizations
75
+
- Embeddings support
76
+
- Custom preferences
77
+
5. Click "Import Model" to start the import process
78
+
79
+
### Advanced Import Mode
80
+
81
+
For full control over model configuration:
82
+
83
+
1. In the WebUI, click "Import Model"
84
+
2. Toggle to "Advanced Mode"
85
+
3. Edit the YAML configuration directly in the code editor
86
+
4. Use the "Validate" button to check your configuration
87
+
5. Click "Create" or "Update" to save
88
+
89
+
The advanced editor includes:
90
+
- Syntax highlighting
91
+
- YAML validation
92
+
- Format and copy tools
93
+
- Full configuration options
94
+
95
+
This is especially useful for:
96
+
- Custom model configurations
97
+
- Fine-tuning model parameters
98
+
- Setting up complex model setups
99
+
- Editing existing model configurations
100
+
101
+
## Method 2: Installing from Hugging Face
102
+
103
+
LocalAI can directly install models from Hugging Face:
104
+
105
+
```bash
106
+
# Install and run a model from Hugging Face
107
+
local-ai run huggingface://TheBloke/phi-2-GGUF
108
+
```
109
+
110
+
The format is: `huggingface://<repository>/<model-file>` (<model-file> is optional)
111
+
112
+
### Examples
113
+
114
+
```bash
115
+
local-ai run huggingface://TheBloke/phi-2-GGUF/phi-2.Q8_0.gguf
116
+
```
117
+
118
+
## Method 3: Installing from OCI Registries
119
+
120
+
### Ollama Registry
121
+
122
+
```bash
123
+
local-ai run ollama://gemma:2b
124
+
```
125
+
126
+
### Standard OCI Registry
127
+
128
+
```bash
129
+
local-ai run oci://localai/phi-2:latest
130
+
```
131
+
132
+
### Run Models via URI
35
133
36
134
To run models via URI, specify a URI to a model file or a configuration file when starting LocalAI. Valid syntax includes:
37
135
@@ -51,18 +149,45 @@ local-ai run https://gist.githubusercontent.com/.../phi-2.yaml
51
149
local-ai run oci://localai/phi-2:latest
52
150
```
53
151
54
-
## Run Models Manually
152
+
## Method 4: Manual Installation
55
153
56
-
Follow these steps to manually run models using LocalAI:
154
+
For full control, you can manually download and configure models.
57
155
58
-
1.**Prepare Your Model and Configuration Files**:
59
-
Ensure you have a model file and, if necessary, a configuration YAML file. Customize model defaults and settings with a configuration file. For advanced configurations, refer to the [Advanced Documentation]({{% relref "advanced" %}}).
156
+
### Step 1: Download a Model
60
157
61
-
2.**GPU Acceleration**:
62
-
For instructions on GPU acceleration, visit the [GPU Acceleration]({{% relref "features/gpu-acceleration" %}}) page.
158
+
Download a GGUF model file. Popular sources:
63
159
64
-
3.**Run LocalAI**:
65
-
Choose one of the following methods to run LocalAI:
### Step 2: Create a Configuration File (Optional)
172
+
173
+
Create a YAML file to configure the model:
174
+
175
+
```yaml
176
+
# models/phi-2.yaml
177
+
name: phi-2
178
+
parameters:
179
+
model: phi-2.Q4_K_M.gguf
180
+
temperature: 0.7
181
+
context_size: 2048
182
+
threads: 4
183
+
backend: llama-cpp
184
+
```
185
+
186
+
Customize model defaults and settings with a configuration file. For advanced configurations, refer to the [Advanced Documentation]({{% relref "advanced" %}}).
187
+
188
+
### Step 3: Run LocalAI
189
+
190
+
Choose one of the following methods to run LocalAI:
0 commit comments