This file contains a full list of all functions available in the Ollama Bash Lib, along with their usage and descriptions.
| Function Alias |
About | Usage | Output | Return |
|---|---|---|---|---|
ollama_api_getoag |
GET request to the Ollama API | ollama_api_get -P "/api/path" |
API call result to stdout |
0 API call success1 API call error |
ollama_api_postoap |
POST request to the Ollama API | ollama_api_post -P "/api/path" -d "{...}" |
API call result to stdout |
0 API call success1 API call error |
ollama_api_pingoapi |
Ping the Ollama API | ollama_api_ping |
none | 0 API is reachable1 API is not reachable |
| Function Alias |
About | Usage | Output | Return |
|---|---|---|---|---|
ollama_generateog |
Generate completion | ollama_generate -m "model" -p "prompt" |
text to stdout |
0/1 |
ollama_generate_jsonogj |
Generate completion, in json | ollama_generate_json -m "model" -p "prompt" |
json to stdout |
0/1 |
ollama_generate_streamogs |
Generate completion stream | ollama_generate_stream -m "model" -p "prompt" |
streaming text to stdout |
0/1 |
ollama_generate_stream_jsonogsj |
Generate completion stream, in json | ollama_generate_stream_json -m "model" -p "prompt" |
streaming json to stdout |
0/1 |
| Function Alias |
About | Usage | Output | Return |
|---|---|---|---|---|
ollama_chatoc |
Chat completion | ollama_chat -m "model" |
text to stdout |
0/1 |
ollama_chat_jsonocj |
Chat completion, in json | ollama_chat_json -m "model" |
json to stdout |
0/1 |
ollama_chat_streamocs |
Chat completion stream | ollama_chat_stream -m "model" |
streaming text to stdout |
0/1 |
ollama_chat_stream_jsonocsj |
Chat completion stream, in json | ollama_chat_stream_json -m "model" |
streaming json to stdout |
0/1 |
ollama_messagesom |
Get messages in chat context | ollama_messages |
json message list, 1 per line, to stdout |
0/1 |
ollama_messages_addoma |
Add a message to chat context | ollama_messages_add -r "role" -c "message" |
none | 0/1 |
ollama_messages_countomco |
Count of messages in chat context | ollama_messages_count |
number of messages to stdout |
0/1 |
ollama_messages_clearomc |
Clear all messages in chat context | ollama_messages_clear |
none | 0/1 |
ollama_messages_last |
Get content of the last message as a string | ollama_messages_last |
string to stdout |
0/1 |
ollama_messages_last_json |
Get the last message as JSON | ollama_messages_last_json |
json to stdout |
0/1 |
| Function Alias |
About | Usage | Output | Return |
|---|---|---|---|---|
ollama_model_randomomr |
Get a random model | ollama_model_random |
1 model name to stdout |
0/1 |
ollama_model_unloadomu |
Unload a model from memory (Clear context for a model) |
ollama_model_unload -m "model" |
none | 0/1 |
ollama_showos |
Show model information | ollama_show -m "model" |
text to stdout |
0/1 |
ollama_show_jsonosj |
Show model information, in json | ollama_show_json -m "model" |
json to stdout |
0/1 |
ollama_listol |
List all available models | ollama_list |
text to stdout |
0/1 |
ollama_list_jsonolj |
List all available models, in json | ollama_list_json |
json to stdout |
0/1 |
ollama_list_arrayola |
List all available models, for bash array | models=($(ollama_list_array)) |
space separated list of model names to stdout |
0/1 |
_is_valid_model |
Validate a model name (or get random model if name is empty) |
_is_valid_model "model" |
valid model name, or empty string, to stdout |
0 if model name is valid1 if invalid |
| Function Alias |
About | Usage | Output | Return |
|---|---|---|---|---|
ollama_app_installedoai |
Is Ollama installed? | if ollama_app_installed; then ...; fi |
none | 0 installed1 not installed |
ollama_app_turbooat |
Turn Turbo Mode on/off | ollama_app_turbo -m on or ollama_app_turbo -m off |
Prompts for api key | 0/1 |
ollama_app_versionoave |
Ollama version | ollama_app_version |
text to stdout |
0/1 |
ollama_app_version_jsonoavj |
Ollama version, in json | ollama_app_version_json |
json to stdout |
0/1 |
ollama_app_version_clioavc |
Ollama version, from cli | ollama_app_version_cli |
text to stdout |
0/1 |
ollama_psop |
Running model processes | ollama_ps |
text to stdout |
0/1 |
ollama_ps_jsonopj |
Running model processes, in json | ollama_ps_json |
json to stdout |
0/1 |
| Function Alias |
About | Usage | Output | Return |
|---|---|---|---|---|
ollama_lib_aboutolab |
About Ollama Bash Lib, lists vars and functions | ollama_lib_about |
text to stdout |
0/1 |
ollama_lib_versionolv |
Ollama Bash Lib version | ollama_lib_version |
text to stdout |
0/1 |
ollama_thinkingot |
Configure thinking mode | `ollama_thinking [on | off | hide]` |
| Function | About | Usage | Output | Return |
|---|---|---|---|---|
_is_valid_json |
Is a string valid JSON? | _is_valid_json "string" |
none | 0 if valid json1 or higher if invalid |
_debug |
Debug message (if OBL_DEBUG=1) |
_debug "message" |
message to stderr |
0/1 |
_error |
Error message | _error "message" |
message to stderr |
0/1 |