Discover Packages
github.com/ktsoator/or
example
llm
directory
Version:
v0.5.3
Opens a new window with list of versions in this module.
Published: Jun 29, 2026
License: MIT
Opens a new window with license information.
README
README
¶
LLM examples
These programs demonstrate focused features of github.com/ktsoator/or/llm.
They call live model APIs and may incur provider charges.
Set the environment variables required by each example before running it. The
programs intentionally use the process environment directly so applications
can choose their own configuration or secret-management library.
Example
What it demonstrates
Required environment variables
complete
A minimal non-streaming completion
DEEPSEEK_API_KEY
stream
Text, reasoning, terminal events, and usage
DEEPSEEK_API_KEY
tool
Typed tools, validation, diagnostics, and a tool loop
DEEPSEEK_API_KEY
image
Sending a local image to a multimodal model
XIAOMI_API_KEY
model-switching
Reusing one history across two protocols
DEEPSEEK_API_KEY, MINIMAX_CN_API_KEY
For example:
export DEEPSEEK_API_KEY=your-deepseek-api-key
go run ./example/llm/complete
The image example also expects a local file path:
export XIAOMI_API_KEY=your-xiaomi-api-key
go run ./example/llm/image ./screenshot.png
See the LLM documentation for detailed guides and
API behavior.
Expand ▾
Collapse ▴
Directories
¶
Command complete demonstrates the smallest non-streaming model request.
Command complete demonstrates the smallest non-streaming model request.
Command image sends a local image to a multimodal model.
Command image sends a local image to a multimodal model.
Command model-switching reuses one provider-neutral conversation across two models that speak different wire protocols.
Command model-switching reuses one provider-neutral conversation across two models that speak different wire protocols.
Command stream demonstrates incremental reasoning and text events.
Command stream demonstrates incremental reasoning and text events.
Command tool demonstrates a complete typed-tool execution loop.
Command tool demonstrates a complete typed-tool execution loop.
Click to show internal directories.
Click to hide internal directories.