The model name format is `site/namespace/model:tag`. **Site** and **namespace** are optional, but will default to `registry.ollama.ai/library`.
### Durations
All durations are in nanoseconds.
## Generate a Prompt
## Generate a Prompt
**POST /api/generate**
**POST /api/generate**
### Description
### Description
**Generate** is the main endpoint that you will use when working with Ollama. This is used to generate a response to a prompt sent to a model.
**Generate** is the main endpoint that you will use when working with Ollama. This is used to generate a response to a prompt sent to a model. This is a streaming endpoint, so will be a series of responses. The final response will include the context and what is usually seen in the output from verbose mode.
### Request
### Request
...
@@ -23,7 +35,7 @@ The **Generate** endpoint takes a JSON object with the following fields:
...
@@ -23,7 +35,7 @@ The **Generate** endpoint takes a JSON object with the following fields:
```JSON
```JSON
{
{
"model": "modelname",
"model": "site/namespace/model:tag",
"prompt": "You are a software engineer working on building docs for Ollama.",
"prompt": "You are a software engineer working on building docs for Ollama.",