-
Input from stdin
- ollama run llama3.1 "prompt"
-
Multiline input
- Using """
-
Input from file
- Using the pipe | operator:
- cat fox.txt | ollama run llama3.1 "Please translate the provided text to German"
- Using the redirection operator < :
- ollama run llama3.1 "Please translate the provided text to German" < fox.txt
- Consuming Web Pages:
- curl https://lite.cnn.com/travel/tourism-why-it-went-wrong/index.html | ollama run llama3.1 "Summarize the contents of this HTML page"
- curl https://lite.cnn.com/travel/tourism-why-it-went-wrong/index.html | ollama run llama3.1 "Find all the people names mentioned in this HTML page"
- Using the pipe | operator:
-
More fun with the pipe | operator
- Passing the output of one LLM to another
- ollama run llama3.1 "How do you make scrambled eggs?" | ollama run llama3.1 "Translate to german"
- Passing the output of one LLM to another
-
Output to a file
- Output to a JSON file:
- ollama run llama3.1 "Countries of Europe" --format json > europe.json
- Appending to a file:
- ollama run llama3 "Tell me a joke about programming" > jokes.md
- ollama run llama3 "Tell me a joke about programming" >> jokes.md
- Output to a JSON file:
-
Verbose output:
- ollama run llama3.1 --verbose "What is the capital of Iceland?"
Created
August 24, 2024 21:50
-
-
Save kostasx/ef38a3a9642f343538000a080a5f3ee2 to your computer and use it in GitHub Desktop.
Ollama Command Line Tricks (YouTube: https://youtu.be/7mw792o1sSg)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment