API Reference

The tcc_ironl package. The ROS nodes in tcc_ros wrap these classes and read their settings from the parameter server.

Parser

Parse the LLM’s Action N: ... into executable action dictionaries.

tcc_ironl.commands_parser.DEFAULT_SPEEDS = {'default_angular_speed': 0.5, 'default_linear_speed': 0.2, 'maximum_speed': 1.0, 'minimum_speed': 0.2}

Speeds used when a command names none (speeds/* in config.yaml).

tcc_ironl.commands_parser.load_patterns(path=None)[source]

Load the regex patterns from an action_dictionary.json.

Parameters:

path (str | None)

Return type:

Dict[str, str]

Destination resolver

Map a spoken named destination to the configuration in config.yaml.

DestinationResolver.resolve() returns (slug, how), e.g. ("kitchen", "exact"), or (None, "not_found").

LLM interface and providers

The prompt that turns a user’s request into Action N: ... lines.

LLMInterface builds the system message (robot status, the action vocabulary, the named destinations and few-shot examples) and classifies the LLM’s response as either a list of actions or a plain response.

One chat interface over the LLM providers TCC-IRoNL supports.

Every provider implements chat(system_message, user_prompt) -> str. On a request error the provider logs it and returns FALLBACK_REPLY, so the robot answers politely.

endpoint and timeout come from models/llm_endpoint and models/llm_timeout_seconds in config.yaml. An empty endpoint means the provider’s public API.

tcc_ironl.llm_provider.DEFAULT_MODELS = {'claude': 'claude-sonnet-5-5', 'deepseek': 'deepseek-v4-flash', 'gemini': 'gemini-3.5-flash', 'llama.cpp': '', 'openai': 'gpt-6-luna'}

Model used when models/llm_name is empty. Check each provider’s model list before relying on these: hosted model names are retired regularly.

class tcc_ironl.llm_provider.OpenAIProvider(*args, **kwargs)[source]

OpenAI Chat Completions, or any OpenAI-compatible server via endpoint.

class tcc_ironl.llm_provider.LlamaCppProvider(api_key, model_name, max_tokens=500, temperature=0, endpoint=None, timeout=30)[source]

A local llama.cpp server (llama-server) /completion endpoint.

Parameters:
  • api_key (str | None)

  • model_name (str | None)

  • max_tokens (int)

  • temperature (float | None)

  • endpoint (str | None)

  • timeout (float)

class tcc_ironl.llm_provider.ClaudeProvider(api_key, model_name, max_tokens=500, temperature=0, endpoint=None, timeout=30)[source]

Anthropic Messages API.

Parameters:
  • api_key (str | None)

  • model_name (str | None)

  • max_tokens (int)

  • temperature (float | None)

  • endpoint (str | None)

  • timeout (float)

class tcc_ironl.llm_provider.GeminiProvider(api_key, model_name, max_tokens=500, temperature=0, endpoint=None, timeout=30)[source]

Google Gemini generateContent; the API key is sent in the x-goog-api-key header.

Parameters:
  • api_key (str | None)

  • model_name (str | None)

  • max_tokens (int)

  • temperature (float | None)

  • endpoint (str | None)

  • timeout (float)

Configuration

Load config.yaml and read values with the same keys the ROS nodes use.

The ROS nodes read parameters such as models/llm_provider from the parameter server, which tcc_ros.launch fills from tcc_ros/config/config.yaml. get() reads the same slash-separated keys from dictionary, so the toolkit and the robot agree.

tcc_ironl.config.API_KEY_ENV = {'claude': 'ANTHROPIC_API_KEY', 'deepseek': 'DEEPSEEK_API_KEY', 'gemini': 'GEMINI_API_KEY', 'llama.cpp': None, 'openai': 'OPENAI_API_KEY'}

Environment variable that holds the API key for each provider.

tcc_ironl.config.data_path(name)[source]

Path of a file shipped in tcc_ironl/data.

Parameters:

name (str)

Return type:

str

tcc_ironl.config.default_config_path()[source]

Path of the config.yaml shipped with the package, identical to tcc_ros/config/config.yaml.

Return type:

str

tcc_ironl.config.load_config(path=None)[source]

Load a TCC-IRoNL config.yaml. Without path, load the bundled one.

Parameters:

path (str | None)

Return type:

Dict[str, Any]

tcc_ironl.config.get(cfg, key, default=None)[source]

Read a slash-separated key, e.g. get(cfg, "models/llm_name").

Parameters:
  • cfg (Dict[str, Any])

  • key (str)

  • default (Any)

Return type:

Any

tcc_ironl.config.resolve_api_key(provider, configured_key=None)[source]

Return the API key for provider.

A non-empty models/llm_api_key from the config wins; otherwise the provider’s environment variable (see API_KEY_ENV) is used. Returns None for providers that need no key, or when none is set.

Parameters:
  • provider (str)

  • configured_key (str | None)

Return type:

str | None

Model weights

Find or download the Segment Anything (SAM) checkpoint used by the VLM node.

The checkpoints are downloaded from Meta’s official release (https://github.com/facebookresearch/segment-anything#model-checkpoints).

Search order in resolve_sam_checkpoint():

  1. $SAM_MODEL_PATH if it points to an existing file;

  2. checkpoint itself if it is an existing (absolute or ~) path;

  3. the checkpoint file name in each directory of search_dirs;

  4. the toolkit cache, $TCC_IRONL_MODELS or ~/.cache/tcc_ironl.

tcc_ironl.weights.SAM_CHECKPOINTS = {'vit_b': 'sam_vit_b_01ec64.pth', 'vit_h': 'sam_vit_h_4b8939.pth', 'vit_l': 'sam_vit_l_0b3195.pth'}

model type -> official checkpoint file name

tcc_ironl.weights.resolve_sam_checkpoint(checkpoint='', model_type='vit_b', search_dirs=())[source]

Return the path of an existing SAM checkpoint, or None.

Parameters:
  • checkpoint (str)

  • model_type (str)

  • search_dirs (Iterable[str])

Return type:

str | None

tcc_ironl.weights.download_sam(model_type='vit_b', dest_dir=None, force=False, quiet=False)[source]

Download a SAM checkpoint into dest_dir (default: cache_dir()).

Parameters:
  • model_type (str)

  • dest_dir (str | None)

  • force (bool)

  • quiet (bool)

Return type:

str

Interaction log

CSV log of each interaction, in the format used for the HRI ‘24 evaluation.

Columns map to the paper’s notation: input command c_n, receive time t_n^r, response time t_n^s, true action sequence a_n, predicted sequence â_n and execution success s_n.