Skip to content

LLM Commands

Manage LLM projects and chat sessions.

Commands

bash
tdx llm projects [pattern]          # List projects
tdx llm project list [pattern]      # Same as projects
tdx llm agents [pattern]            # List agents (alias for tdx agent list)

Agent Commands

Agent management commands have moved to tdx agent. See Agent Commands for:

  • tdx agent list - List agents
  • tdx agent show - Show agent details
  • tdx agent create - Create a new agent
  • tdx agent update - Update an existing agent
  • tdx agent delete - Delete an agent

Project Management

Set Project Context

bash
# Set current project context (session-only)
tdx llm use "MyProject"

# Now all agent commands use "MyProject" by default
tdx agent list
tdx agent show "Data Analyst"

Set Default Agent for Chat

Set a default agent for chat operations using tdx use agent, so you don't need to specify --agent each time:

bash
# Set default agent (use "Project/Agent" format)
tdx use agent "MyProject/My Agent"

# Now new chats use this agent by default
tdx chat --new "Your question here"
tdx chat "Another question"  # Continues the chat

# Override with --agent for a specific new chat
tdx chat --new "Question" --agent "OtherProject/OtherAgent"

The default agent preference is:

  • Stored in session context (same as tdx use database, etc.)
  • Used automatically by tdx chat --new when no --agent flag is specified
  • Overridden by explicit --agent flag

List and Create Projects

bash
# List available models
tdx llm models

# List all projects
tdx llm projects

# List projects matching pattern
tdx llm projects "data*"
tdx llm projects "*_prod"

# Create a new project
tdx llm project create "MyProject" --description "Data analysis project"

# Delete a project
tdx llm project delete "OldProject"

Backup and Restore Projects (Deprecated)

DEPRECATED

The backup and restore commands are deprecated. Use the new tdx agent commands instead:

  • tdx agent pull - Export project to Git-friendly YAML/Markdown format
  • tdx agent push - Import local files to project
  • tdx agent clone - Clone a project to a new project

See Agent Commands for full documentation.

Legacy backup/restore commands (click to expand)

Backup an entire LLM project to a folder, including all agents, knowledge bases, prompts, and integrations:

bash
# Backup project to default folder ({project_name}.llm)
tdx llm project backup "MyProject"

# Backup to custom folder
tdx llm project backup "MyProject" -o ./backups/myproject

# Preview what would be backed up (dry-run)
tdx llm project backup "MyProject" --dry-run

# Overwrite existing backup without confirmation
tdx llm project backup "MyProject" -y

Restore a project from a backup:

bash
# Restore project with original name
tdx llm project restore ./MyProject.llm

# Restore with a new name
tdx llm project restore ./MyProject.llm --name "MyProject-restored"

# Preview what would be restored (dry-run)
tdx llm project restore ./MyProject.llm --dry-run

# Skip confirmation if project exists
tdx llm project restore ./MyProject.llm -y

Backup Contents

The backup folder contains:

  • project.json - Project metadata and backup info
  • agents.json - All agents with full configuration
  • knowledgebases.json - All knowledge bases
  • prompts.json - All prompts
  • integrations.json - All integrations

Agent Management

Agent commands have moved to tdx agent. See Agent Commands for full documentation.

bash
# List agents (alias kept for convenience)
tdx llm agents

# Or use the new commands
tdx agent list
tdx agent show "My Agent"
tdx agent create "New Agent"
tdx agent update "My Agent" --prompt "..."
tdx agent delete "Old Agent"

Chat History

bash
# List recent chat sessions
tdx llm history

# Show specific chat messages
tdx llm history chat456

Project Resolution

Agent commands resolve projects in this order:

  1. --llm-project global option (highest priority)
  2. tdx llm use <project> context (session-only)
  3. Default project tdx_default_<username> (auto-created)

Claude Code Integration

See tdx claude for launching Claude Code with TD LLM backend.

LLM Proxy Server

Experimental

This feature is experimental and may have limitations.

Start a local HTTP server providing Anthropic-compatible API endpoints:

bash
# Start proxy with defaults (port 4000)
tdx llm proxy

# Custom port
tdx llm proxy --port 8000

# Use specific project and agent
tdx llm proxy --project "MyProject" --agent "MyAgent"

# Enable debug mode
tdx llm proxy --debug

Proxy Configuration for Claude Code

Create .claude/settings.local.json:

json
{
  "env": {
    "ANTHROPIC_BASE_URL": "http://127.0.0.1:4000",
    "ANTHROPIC_MODEL": "sonnet"
  }
}

Known Limitations

  • Tool calls rely on prompt engineering
  • Non-streaming responses not implemented
  • Image inputs not supported
  • TD's built-in tools not directly accessible

Options Reference

Backup Options (Deprecated)

OptionDescriptionDefault
-o, --output <folder>Output folder{project_name}.llm
--dry-runPreview without creating filesfalse
-y, --yesSkip confirmation promptfalse

Restore Options (Deprecated)

OptionDescriptionDefault
--name <text>New project nameOriginal name from backup
--dry-runPreview without making changesfalse
-y, --yesSkip confirmation promptfalse