> ## Documentation Index
> Fetch the complete documentation index at: https://docs.salad.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Run Ollama

*Last Updated: September 24, 2024*

Ollama is a toolkit for deploying and service Large Language Models (LLMs). Ollama enables local operation of
open-source large language models like Llama 2, simplifying setup and configuration, including GPU usage, and providing
a library of supported models.

[Learn More Here](https://ollama.com/)

## Ollama API

Ollama can be used as an API that can:

* Generate text completions using different language models and tags.
* Stream responses in JSON format or receive them as single objects.
* Include optional parameters such as images, formatting options, and system messages.
* Maintain conversational memory using the context parameter.
* Control response streaming and model memory retention.

For detailed instructions and examples, refer to the
[Ollama documentation](https://github.com/ollama/ollama/blob/main/docs/api.md)

# Deploying Ollama on Salad

## Container

Ollama provides a pre-built docker available via the Docker Container registry :
[https://hub.docker.com/r/ollama/ollama](https://hub.docker.com/r/ollama/ollama)

In order to deploy the container on Salad, you will need to specify the image:

<img src="https://mintcdn.com/salad/8o1ParSgmJGbpSYb/container-engine/images/a48be4d-image.png?fit=max&auto=format&n=8o1ParSgmJGbpSYb&q=85&s=af859d86712d7b7aaabfa34cd5ca018e" width="506" height="467" data-path="container-engine/images/a48be4d-image.png" />

All the other options can be specified using api requests.

## Required - Container Gateway Setup

In addition you need to specify the port your api will be available through. Default port for Ollama is 11434

<img src="https://mintcdn.com/salad/8o1ParSgmJGbpSYb/container-engine/images/af91390-image.png?fit=max&auto=format&n=8o1ParSgmJGbpSYb&q=85&s=9a36c1e9c5607a3da189ad75b25c4cb1" width="529" height="498" data-path="container-engine/images/af91390-image.png" />
