"git@developer.sourcefind.cn:OpenDAS/ollama.git" did not exist on "4de1370a9dcc88b79ddc2d4af2e8c954bdfa67a1"
Unverified Commit 753724d8 authored by Jeffrey Morgan's avatar Jeffrey Morgan Committed by GitHub
Browse files

Update api.md to include examples for reproducible outputs

parent e4576c2e
...@@ -247,6 +247,23 @@ curl http://localhost:11434/api/generate -d '{ ...@@ -247,6 +247,23 @@ curl http://localhost:11434/api/generate -d '{
}' }'
``` ```
#### Request (Reproducible outputs)
For reproducible outputs, set `temperature` to 0 and `seed` to a number:
##### Request
```shell
curl http://localhost:11434/api/generate -d '{
"model": "mistral",
"prompt": "[INST] why is the sky blue? [/INST]",
"options": {
"seed": 101,
"temperature": 0
}
}'
```
##### Response ##### Response
```json ```json
...@@ -570,6 +587,46 @@ curl http://localhost:11434/api/chat -d '{ ...@@ -570,6 +587,46 @@ curl http://localhost:11434/api/chat -d '{
} }
``` ```
#### Chat request (Reproducible outputs)
##### Request
```shell
curl http://localhost:11434/api/chat -d '{
"model": "llama2",
"messages": [
{
"role": "user",
"content": "Hello!"
}
],
"options": {
"seed": 101,
"temperature": 0
}
}'
```
##### Response
```json
{
"model": "registry.ollama.ai/library/llama2:latest",
"created_at": "2023-12-12T14:13:43.416799Z",
"message": {
"role": "assistant",
"content": "Hello! How are you today?"
},
"done": true,
"total_duration": 5191566416,
"load_duration": 2154458,
"prompt_eval_count": 26,
"prompt_eval_duration": 383809000,
"eval_count": 298,
"eval_duration": 4799921000
}
```
## Create a Model ## Create a Model
```shell ```shell
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment