feat(ollama): added streaming & tool call support for ollama, updated docs (#884)

This commit is contained in:
Waleed Latif
2025-08-05 15:04:50 -07:00
committed by GitHub
parent be65bf795f
commit 746b87743a
14 changed files with 893 additions and 332 deletions

View File

@@ -1,25 +0,0 @@
#!/bin/bash
set -e
# Check that at least one argument is provided. If not, display the usage help.
if [ "$#" -eq 0 ]; then
echo "Usage: $(basename "$0") <ollama command> [args...]"
echo "Example: $(basename "$0") ps # This will run 'ollama ps' inside the container"
exit 1
fi
# Start a detached container from the ollama/ollama image,
# mounting the host's ~/.ollama directory directly into the container.
# Here we mount it to /root/.ollama, assuming that's where the image expects it.
CONTAINER_ID=$(docker run -d -v ~/.ollama:/root/.ollama -p 11434:11434 ollama/ollama
)
# Define a cleanup function to stop the container regardless of how the script exits.
cleanup() {
docker stop "$CONTAINER_ID" >/dev/null
}
trap cleanup EXIT
# Execute the command provided by the user within the running container.
# The command runs as: "ollama <user-arguments>"
docker exec -it "$CONTAINER_ID" ollama "$@"