Skip to content

Commit 97b1c15

Browse files
committed
add remaining v3 docs
1 parent c64dc5d commit 97b1c15

21 files changed

Lines changed: 742 additions & 68 deletions

content/docs/extensions/ui.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,10 +392,10 @@ This makes a standard chat completion request that doesn't return until the full
392392
To start a new Chat Thread use:
393393
394394
```js
395-
await ctx.threads.startNewThread({ title, model })
395+
await ctx.threads.startNewThread({ title, model, redirect })
396396
```
397397
398-
Which creates and returns a new empty Thread in the Server then navigates the UI to the new thread page.
398+
Which creates and returns a new empty Thread in the Server, if `redirect:true` also navigates the UI to the new thread page.
399399
400400
Then to begin processing an asynchronous chat completion request use:
401401

content/docs/features/analytics.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
title: Analytics & Monitoring
3-
description: Track costs, tokens, and usage across all providers
2+
title: Analytics
3+
description: Track costs, tokens, and monitor usage across all providers
44
---
55

66
## Overview
Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,37 @@
11
---
22
title: Calculator UI
3-
description: Display mathematical expressions in your conversations using KaTeX.
3+
description: A powerful and safe mathematical expression evaluator with a rich web interface.
44
---
55

6-
The [katex](https://github.com/ServiceStack/llms/tree/main/llms/extensions/katex) extension enables beautiful rendering of LaTeX math expressions in AI responses using [KaTeX](https://katex.org/). It integrates automatically with the markdown parser to render math equations in both inline and block formats.
6+
A dedicated UI has been added for the `calc` tool with support for evaluating mathematical python expressions, including arithmetic, comparison, boolean operators, `math.*` functions & constants and python list comprehensions:
77

8-
### Features
8+
<Screenshot src="/img/run-calc.webp"/>
99

10-
- **Fast Rendering**: Uses KaTeX for high-performance rendering of math expressions.
11-
- **Inline Math**: Renders math within text using `$` or `$$` delimiters.
12-
- **Block Math**: Renders complex equations in their own block using `$` or `$$` delimiters across multiple lines.
13-
- **Auto-Integration**: Automatically extends the `marked` parser used in the application.
10+
## Features
1411

15-
### Popular math expressions
12+
### 🖥️ UX Friendly Interface
13+
Experience a clean, modern interface designed for efficiency. The UI is fully responsive and supports dark mode, seamlessly integrating with the rest of the application.
1614

17-
<Screenshot src="/img/rendering-katex.webp" />
15+
### 💾 Persistent History
16+
Never lose track of your calculations. The Calculator automatically saves your history to `localStorage`, ensuring your previous expressions and results are preserved between sessions.
1817

19-
### Basic math expressions
18+
### ⚡ 1-Click Interaction
19+
Streamline your workflow with interactive history items:
20+
- **Load & Copy**: Click on any past expression or answer to instantly load it into the input field and copy it to your clipboard.
21+
- **Visual Feedback**: Temporary checkmarks confirm successful copy actions.
2022

21-
<Screenshot src="/img/rendering-katex2.webp"/>
23+
### ⌨️ Keyboard-Free Access
24+
While full keyboard support is available, you can perform complex calculations entirely via the UI:
25+
- **Numbers & Constants**: Quick access to digits and mathematical constants like `pi`, `e`, `inf`.
26+
- **Operators**: Comprehensive set of buttons for arithmetic (`+`, `-`, `*`, `/`, `%`, `^`) and boolean logic (`and`, `or`, `not`).
27+
- **Functions**: One-click insertion or wrapping of selection for all supported math functions.
28+
29+
### 🐍 Python Math Support
30+
Unlock the power of Python's math library:
31+
- **Math Functions**: Support for `sin`, `cos`, `tan`, `sqrt`, `log`, `factorial`, and many more.
32+
- **Statistics**: Built-in functions for `mean`, `median`, `stdev`, and `variance`.
33+
34+
### 🛡️ Safe Evaluation
35+
Security is a priority. Instead of using Python's unsafe `eval()`, the Calculator uses a robust **AST (Abstract Syntax Tree) evaluator**.
36+
- **Restricted Environment**: Only allowed mathematical operations and functions are executed.
37+
- **No Side Effects**: Prevents arbitrary code execution, making it safe to evaluate expressions from untrusted sources.

content/docs/features/cli.mdx

Lines changed: 199 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ llms --audio recording.mp3 "Transcribe this audio"
2727
llms --file document.pdf "Summarize this PDF"
2828
```
2929

30-
## 5. Configure Default Model
30+
## Configure Default Model
3131

3232
Set your preferred default model:
3333

@@ -51,6 +51,21 @@ llms -s "You are a quantum expert" "Explain quantum computing"
5151
llms "Hello" --raw
5252
```
5353

54+
### Tool Calling & Function Calling
55+
56+
All registered tools are automatically available in CLI mode:
57+
58+
```bash
59+
# Use all available tools (default)
60+
llms "Read the file data.txt and calculate the sum"
61+
62+
# Use specific tools
63+
llms --tools calc,get_current_time "What time is it in Tokyo and what's 15% of 230?"
64+
65+
# Disable all tools
66+
llms --tools none "Tell me a joke"
67+
```
68+
5469
### Image Analysis
5570

5671
```bash
@@ -84,6 +99,36 @@ llms --file report.pdf "Summarize the key points"
8499
llms -m gemini-flash-latest --file policy.pdf "Extract action items"
85100
```
86101

102+
### Image Generation
103+
104+
Generate images directly from the CLI:
105+
106+
```bash
107+
# Generate image with default model
108+
llms --out image "A serene mountain landscape at sunset"
109+
110+
# Generate with specific model
111+
llms -m "gemini-2.5-flash-image" --out image "Logo for a tech startup"
112+
113+
# All generated images are saved to ~/.llms/cache
114+
llms -m "Gemini 2.5 Flash Image" --out image "cat in a hat"
115+
```
116+
117+
### Audio Generation
118+
119+
Generate audio with Text-to-Speech models:
120+
121+
```bash
122+
# Generate audio with default TTS model
123+
llms --out audio "Welcome to our podcast"
124+
125+
# With specific TTS model
126+
llms -m gemini-2.5-pro-preview-tts --out audio "Merry Christmas"
127+
128+
# All generated audio is saved to ~/.llms/cache
129+
llms -m gemini-2.5-flash-preview-tts --out audio "Hello world"
130+
```
131+
87132

88133
## CLI Reference
89134

@@ -135,6 +180,28 @@ llms --default grok-4-fast
135180

136181
# Check provider status
137182
llms --check groq
183+
184+
# Update provider definitions from models.dev
185+
llms --update-providers
186+
```
187+
188+
### Extensions Management
189+
190+
```bash
191+
# List available extensions
192+
llms --add
193+
194+
# Install an extension
195+
llms --add duckduckgo
196+
197+
# Install from GitHub
198+
llms --add github-user/repo-name
199+
200+
# List installed extensions
201+
llms --remove
202+
203+
# Uninstall an extension
204+
llms --remove duckduckgo
138205
```
139206

140207
## Options Reference
@@ -317,6 +384,68 @@ llms --check groq
317384
llms --check groq kimi-k2 llama4:400b
318385
```
319386

387+
#### `--update-providers`
388+
389+
Update provider definitions from models.dev:
390+
391+
```bash
392+
llms --update-providers
393+
```
394+
395+
#### `--tools TOOLS`
396+
397+
Enable specific tools for function calling:
398+
399+
```bash
400+
# Use all tools (default)
401+
llms --tools all "What time is it and calculate 15% of 230?"
402+
403+
# Use specific tools
404+
llms --tools calc,get_current_time "What time is it in Tokyo?"
405+
406+
# Disable all tools
407+
llms --tools none "Tell me a joke"
408+
```
409+
410+
#### `--out OUTPUT_TYPE`
411+
412+
Generate media output (image or audio):
413+
414+
```bash
415+
# Generate images
416+
llms --out image "A serene mountain landscape"
417+
418+
# Generate audio
419+
llms --out audio "Welcome message"
420+
```
421+
422+
#### `--add [EXTENSION]`
423+
424+
Install or list available extensions:
425+
426+
```bash
427+
# List available extensions
428+
llms --add
429+
430+
# Install an extension
431+
llms --add duckduckgo
432+
433+
# Install from GitHub
434+
llms --add github-user/repo-name
435+
```
436+
437+
#### `--remove [EXTENSION]`
438+
439+
Uninstall or list installed extensions:
440+
441+
```bash
442+
# List installed extensions
443+
llms --remove
444+
445+
# Uninstall an extension
446+
llms --remove duckduckgo
447+
```
448+
320449
### Help
321450

322451
#### `-h, --help`
@@ -443,6 +572,74 @@ llms --default grok-4-fast
443572
# Check provider status
444573
llms --check groq
445574
llms --check groq kimi-k2 llama4:400b gpt-oss:120b
575+
576+
# Update provider definitions from models.dev (auto-updated daily)
577+
llms --update-providers
578+
```
579+
580+
### Extensions Management
581+
582+
```bash
583+
# List available extensions from github.com/llmspy
584+
llms --add
585+
586+
# Install an extension
587+
llms --add duckduckgo
588+
589+
# Install a 3rd-party extension from GitHub
590+
llms --add github-user/repo-name
591+
592+
# List installed extensions
593+
llms --remove
594+
595+
# Uninstall an extension
596+
llms --remove duckduckgo
597+
```
598+
599+
### Tool Calling & Function Calling
600+
601+
```bash
602+
# Use all available tools (default)
603+
llms "Read the file data.txt and calculate the sum"
604+
605+
# Use specific tools
606+
llms --tools calc,get_current_time "What time is it in Tokyo and what's 15% of 230?"
607+
608+
# Disable all tools
609+
llms --tools none "Tell me a joke"
610+
611+
# Tools work with any model that supports function calling
612+
llms -m gpt-4o --tools calc "Calculate the area of a circle with radius 5"
613+
```
614+
615+
### Image Generation
616+
617+
```bash
618+
# Generate image with default model
619+
llms --out image "A serene mountain landscape at sunset"
620+
621+
# Generate with specific model by ID
622+
llms -m "gemini-2.5-flash-image" --out image "Logo for a tech startup"
623+
624+
# Generate with specific model by name
625+
llms -m "Gemini 2.5 Flash Image" --out image "cat in a hat"
626+
627+
# Images are saved to ~/.llms/cache with local path and HTTP URL
628+
```
629+
630+
### Audio Generation
631+
632+
```bash
633+
# Generate audio with default TTS model
634+
llms --out audio "Welcome to our podcast"
635+
636+
# With specific TTS model
637+
llms -m gemini-2.5-pro-preview-tts --out audio "Merry Christmas"
638+
639+
# Generate with Flash TTS
640+
llms -m gemini-2.5-flash-preview-tts --out audio "Hello world"
641+
642+
# Audio files are saved to ~/.llms/cache with local path and HTTP URL
446643
```
447644

448645
## Environment Variables
@@ -466,6 +663,7 @@ DEEPSEEK_API_KEY # DeepSeek
466663
CHUTES_API_KEY # chutes.ai OSS LLM and Image Models
467664
HF_TOKEN # Hugging Face
468665
FIREWORKS_API_KEY # fireworks.ai OSS Models
666+
CODESTRAL_API_KEY # Codestral (Mistral)
469667
LMSTUDIO_API_KEY # Placeholder for local LM Studio
470668
```
471669

content/docs/features/core-tools.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ description: Built-in essential tools for memory persistence, file operations, m
55

66
These tools defined in the [core_tools](https://github.com/ServiceStack/llms/blob/main/llms/extensions/core_tools/__init__.py) extension provide essential functionality for LLMs to interact with their environment, perform calculations, and manage persistent data.
77

8+
See [Tools Docs](/docs/extensions/tools) for details on registering and using your own tools.
9+
810
## Memory Tools
911

1012
Functions for persistent key-value storage.

content/docs/features/meta.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
"web-ui",
77
"analytics",
88
"core-tools",
9+
"calculator-ui",
10+
"run-code-ui",
911
"katex",
1012
"model-selector",
1113
"system-prompts"

0 commit comments

Comments
 (0)