Provider Setup
sharur supports five LLM providers. All configuration lives in config.json files or environment variables; environment variables take priority over config file values.
Model Naming
Models can be specified as provider/model shorthand or with separate flags:
Both forms are equivalent. The shorthand is convenient for one-off overrides; the config file form is better for persistent defaults.
Environment Variables
API keys set via environment variable take priority over values in config.json. The env var names use the SHARUR_ prefix:
| Provider | Environment Variable |
|---|---|
| Anthropic | SHARUR_ANTHROPIC_API_KEY |
| OpenAI | SHARUR_OPENAI_API_KEY |
SHARUR_GOOGLE_API_KEY |
Ollama and llama.cpp are local servers and do not use API keys.
Ollama
Ollama runs models locally. It is the default provider.
Notes:
- Default base URL is
http://localhost:11434. Override withollamaBaseURL. - Ollama models support tools and images (vision models).
- Use
shr --list-modelsto see all locally available models. - Thinking is supported on models that emit
<think>tokens (e.g.qwq,deepseek-r1).
llama.cpp
llama.cpp exposes an OpenAI-compatible HTTP server.
Notes:
- Default base URL is
http://localhost:8080. Override withllamaCppBaseURL. - The model name passed to
shris forwarded to the server as-is. - Image attachments are not supported.
- The server’s own context window size is used;
sharurqueries/v1/modelsto detect it.
OpenAI
OpenAI-compatible endpoints:
Any server that implements the OpenAI chat completions API can be used by pointing openAIBaseURL at it:
This works with vLLM, LM Studio, and others.
Notes:
- Reasoning models (o3, o4-mini) emit thinking deltas that appear in the TUI and JSON event stream.
- Supports tools and vision (images) for compatible models.
Anthropic
Notes:
- Extended thinking is supported for models that enable it (e.g.
claude-3-7-sonnet). Use--thinking mediumor--thinking high. mediumthinking uses a 10,000-token budget;highuses 20,000 tokens. Temperature is automatically set to the required value.anthropicApiVersionoverrides theanthropic-versionrequest header; leave empty to use the library default.
Google Gemini
Notes:
- Gemini 1.5 Pro and later have a 1M+ token context window.
- Supports tools and vision (images).
- Use
shr --list-modelsto see available Gemini models.
Listing Available Models
All five providers implement model listing. Use --list-models to query the active provider:
The output is a plain list of model names, suitable for piping:
Provider Feature Matrix
| Provider | Tools | Images | Thinking | Model Listing |
|---|---|---|---|---|
ollama | ✓ | ✓ | model-dependent | ✓ |
llamacpp | ✓ | ✗ | ✗ | ✓ |
openai | ✓ | ✓ | reasoning models | ✓ |
anthropic | ✓ | ✓ | ✓ extended | ✓ |
google | ✓ | ✓ | ✗ | ✓ |