mirror of
https://github.com/ollama/ollama.git
synced 2025-11-10 21:27:47 +01:00
Co-authored-by: A-Akhil <akhilrahul70@gmail.com> This PR introduces a new ollama embed command that allows users to generate embeddings directly from the command line. Added ollama embed MODEL [TEXT...] command for generating text embeddings Supports both direct text arguments and stdin piping for scripted workflows Outputs embeddings as JSON arrays (one per line)
104 lines
1.1 KiB
Plaintext
104 lines
1.1 KiB
Plaintext
---
|
|
title: CLI Reference
|
|
---
|
|
|
|
### Run a model
|
|
|
|
```
|
|
ollama run gemma3
|
|
```
|
|
|
|
#### Multiline input
|
|
|
|
For multiline input, you can wrap text with `"""`:
|
|
|
|
```
|
|
>>> """Hello,
|
|
... world!
|
|
... """
|
|
I'm a basic program that prints the famous "Hello, world!" message to the console.
|
|
```
|
|
|
|
#### Multimodal models
|
|
|
|
```
|
|
ollama run gemma3 "What's in this image? /Users/jmorgan/Desktop/smile.png"
|
|
```
|
|
|
|
### Generate embeddings
|
|
|
|
```
|
|
ollama run embeddinggemma "Hello world"
|
|
```
|
|
|
|
Output is a JSON array:
|
|
|
|
```
|
|
echo "Hello world" | ollama run nomic-embed-text
|
|
```
|
|
|
|
### Download a model
|
|
|
|
```
|
|
ollama pull gemma3
|
|
```
|
|
|
|
### Remove a model
|
|
|
|
```
|
|
ollama rm gemma3
|
|
```
|
|
|
|
### List models
|
|
|
|
```
|
|
ollama ls
|
|
```
|
|
|
|
### Sign in to Ollama
|
|
|
|
```
|
|
ollama signin
|
|
```
|
|
|
|
### Sign out of Ollama
|
|
|
|
```
|
|
ollama signout
|
|
```
|
|
|
|
### Create a customized model
|
|
|
|
First, create a `Modelfile`
|
|
|
|
```
|
|
FROM gemma3
|
|
SYSTEM """You are a happy cat."""
|
|
```
|
|
|
|
Then run `ollama create`:
|
|
|
|
```
|
|
ollama create -f Modelfile
|
|
```
|
|
|
|
### List running models
|
|
|
|
```
|
|
ollama ps
|
|
```
|
|
|
|
### Stop a running model
|
|
|
|
```
|
|
ollama stop gemma3
|
|
```
|
|
|
|
### Start Ollama
|
|
|
|
```
|
|
ollama serve
|
|
```
|
|
|
|
To view a list of environment variables that can be set run `ollama serve --help`
|