llm
curl https://api.openai.com/v1/responses/resp_123 \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $OPENAI_API_KEY"
import os from openai import OpenAI client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY")) response = client.responses.create( model="gpt-4o", input=prompt, )
Vasvani et al. (2017)
https://transformer-circuits.pub/2021/framework/index.html
Expect the output of every program to become the input to another, as yet unknown, program. Don't clutter output with extraneous information. Avoid stringently columnar or binary input formats. Don't insist on interactive input.
https://www.linkedin.com/in/simonwillison/
https://simonwillison.net/
https://pypi.org/project/llm/
$ llm keys set openai # vložte OpenAI API klíč
$ llm models OpenAI Chat: gpt-4o (aliases: 4o) OpenAI Chat: chatgpt-4o-latest (aliases: chatgpt-4o) OpenAI Chat: gpt-4o-mini (aliases: 4o-mini) OpenAI Chat: gpt-4o-audio-preview (...)
https://openwebui.com
OpenAI-kompatibilní (např. OpenWebUI)
- model_id: llama3.3 model_name: LLM3-AMD-MI210.llama3.3:latest api_base: "https://ai.ufal.mff.cuni.cz/api" api_key_name: "ufal"
A další:
llm install [llm-gemini|llm-anthropic|...]
https://ollama.com
# instalace frameworku Ollama $ curl -fsSL https://ollama.com/install.sh | sh $ ollama pull llama3.2:1b # instalace Ollama pluginu do llm $ llm install llm-ollama
$ llm models Ollama: llama3.2:1b
# Nastavíme defaultní model llm models default [MODEL_ID] # Spustíme příkaz s konkrétním modelem podle id llm -m [MODEL_ID] prompt # Spustíme příkaz s konkrétním modelem podle vzoru (pro zapomnětlivce) llm -q [MODEL_ID_PATTERN]
llm-cmd
name: translate system: | You are a translation assistant. Do no use any headings or introduction, start immediately with the required output. Do not use any markdown. Below, provide several examples of usage of the phrase in the target language. prompt: | Translate the following from the language '$from' to the language '$to': $input defaults: from: English to: Czech
# Stáhnout aktuální data o počasí z OpenWeatherMap curl -s "https://api.openweathermap.org/data/2.5/weather?q=Prague&appid=${OPENWEATHER_API_KEY}&units=metric" | \ \ # Naformátovat odpověď jq -r '(.main.temp|tostring) + "°C", .weather[0].description, "wind " + (.wind.speed|tostring) + " m/s"' | \ \ # Zeptat se LLM na doporučení llm "Napiš jednu větu s doporučením co si vzít na sebe na základě aktuálních dat o počasí."
git-commit.yaml
system: | You are an expert programmer writing a git commit message. Write a message for the following diff. - Use the Conventional Commits specification (e.g., 'feat:', 'fix:', 'docs:'). - The message should be a short, one-line summary (under 50 chars) followed by a blank line and a more detailed, but concise, description in bullet points. - Do NOT include file names or the diff itself in the final message.
git-commit-llm
GIT_DIFF=$(git diff --staged) if [ -z "$GIT_DIFF" ]; then echo "No staged changes." return 1 fi printf "%s" "$GIT_DIFF" | llm -t git-commit
git-commit-inline
INITIAL_MESSAGE=$(git-commit-llm) read -e -p "" -i "$INITIAL_MESSAGE" FINAL_MESSAGE if [ -n "$FINAL_MESSAGE" ]; then git commit -m "$FINAL_MESSAGE" else echo "Commit aborted." fi
https://llm.datasette.io/en/stable/index.html
llm -m [MODEL_id] chat
llm embed -c 'Text input' -m 3-small # výstup: [0.123, 0.456, 0.789...]
llm-fragments-pdf
llm-fragments-site-text
llm-profile
šablona plain.yaml
plain.yaml
system: | Output only what is requested. No yapping, no backticks.
slidy ️