Skip to content

Ragbits CLI#

Ragbits comes with a command-line interface (CLI) that provides several commands for working with the Ragbits platform. It can be accessed by running the ragbits command in your terminal.

Commands that operate on Ragbits components, such as ragbits vector-store, use the project's preferred component implementations if a component configuration is not explicitly provided. To learn how to set component preferences in your project, see the How-To: Set preferred components in Ragbits project guide.

ragbits#

Common CLI arguments for all ragbits commands.

Usage:

ragbits [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--output, -o choice (text | json) Set the output type (text or json) text
--verbose, -v boolean Print additional information False
--install-completion boolean Install completion for the current shell. None
--show-completion boolean Show completion for the current shell, to copy it or customize the installation. None
--help boolean Show this message and exit. False

Subcommands

  • api: Commands for running API service
  • document-search: Commands for interacting with the document search
  • evaluate: Commands for interacting with ragbits evaluate module
  • prompts: Commands for managing prompts
  • vector-store: Commands for managing vector stores

ragbits api#

Commands for running API service

Usage:

ragbits api [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--help boolean Show this message and exit. False

Subcommands

  • run: Run API service with UI demo

ragbits api run#

Run API service with UI demo

Usage:

ragbits api run [OPTIONS] CHAT_INTERFACE

Options:

Name Type Description Default
--host text Host to bind the API server to 127.0.0.1
--port integer Port to bind the API server to 8000
--cors-origin text Allowed CORS origins. Can be specified multiple times. None
--ui-build-dir text Path to a custom UI build directory. If not specified, uses the default package UI. None
--help boolean Show this message and exit. False

Commands for interacting with the document search

Usage:

ragbits document-search [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--factory-path text Python path to a function that creates a document search object, in a 'module.submodule:function' format None
--yaml-path path Path to a YAML configuration file for the document search None
--help boolean Show this message and exit. False

Subcommands

  • ingest: Ingest the elements from a given source to vector store.
  • search: Query the chosen vector store.

ragbits document-search ingest#

Ingest the elements from a given source to vector store.

Usage:

ragbits document-search ingest [OPTIONS] SOURCE

Options:

Name Type Description Default
--help boolean Show this message and exit. False

Query the chosen vector store.

Usage:

ragbits document-search search [OPTIONS] QUERY

Options:

Name Type Description Default
--k integer Number of entries to retrieve 5
--columns text Comma-separated list of columns to display, available: id, element_type, key, location, text_representation, document_meta element_type,key
--help boolean Show this message and exit. False

ragbits evaluate#

Commands for interacting with ragbits evaluate module

Usage:

ragbits evaluate [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--dataloader-factory-path text A path to evaluation data loader factory in format python.path:function_name None
--dataloader-yaml-path path A path to evaluation data loader configuration None
--target-factory-path text A path to a factory of the evaluation target class in format: python.path:function_name None
--target-yaml-path path A path to a YAML configuration file of the evaluation target class None
--metrics-factory-path text A path to metrics factory in format python.path:function_name None
--metrics-yaml-path path A path to metrics configuration None
--help boolean Show this message and exit. False

Subcommands

  • run: Evaluate the pipeline.

ragbits evaluate run#

Evaluate the pipeline.

Usage:

ragbits evaluate run [OPTIONS]

Options:

Name Type Description Default
--help boolean Show this message and exit. False

ragbits prompts#

Commands for managing prompts

Usage:

ragbits prompts [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--help boolean Show this message and exit. False

Subcommands

  • exec: Executes a prompt using the specified prompt class and LLM factory.
  • generate-promptfoo-configs: Generates the configuration files for the PromptFoo prompts.
  • lab: Launches the interactive application for listing, rendering, and testing prompts
  • render: Renders a prompt by loading a class from a module and initializing it with a given payload.

ragbits prompts exec#

Executes a prompt using the specified prompt class and LLM factory.

For an example of how to use this command, see the Quickstart guide.

Usage:

ragbits prompts exec [OPTIONS] PROMPT_PATH

Options:

Name Type Description Default
--payload text N/A None
--llm-factory text N/A ragbits.core.llms.factory:simple_litellm_factory
--help boolean Show this message and exit. False

ragbits prompts generate-promptfoo-configs#

Generates the configuration files for the PromptFoo prompts.

For more information, see the Promptfoo integration documentation.

Usage:

ragbits prompts generate-promptfoo-configs [OPTIONS]

Options:

Name Type Description Default
--file-pattern text N/A **/prompt_*.py
--root-path path N/A /__w/ragbits/ragbits
--target-path path N/A promptfooconfigs
--help boolean Show this message and exit. False

ragbits prompts lab#

Launches the interactive application for listing, rendering, and testing prompts defined within the current project.

For more information, see the Prompts Lab documentation.

Usage:

ragbits prompts lab [OPTIONS]

Options:

Name Type Description Default
--file-pattern text N/A **/prompt_*.py
--llm-factory text N/A ragbits.core.llms.factory:simple_litellm_factory
--help boolean Show this message and exit. False

ragbits prompts render#

Renders a prompt by loading a class from a module and initializing it with a given payload.

Usage:

ragbits prompts render [OPTIONS] PROMPT_PATH

Options:

Name Type Description Default
--payload text N/A None
--help boolean Show this message and exit. False

ragbits vector-store#

Commands for managing vector stores

Usage:

ragbits vector-store [OPTIONS] COMMAND [ARGS]...

Options:

Name Type Description Default
--factory-path text Python path to a function that creates a vector store, in a 'module.submodule:function' format None
--yaml-path path Path to a YAML configuration file for the vector store None
--help boolean Show this message and exit. False

Subcommands

  • list: List all objects in the chosen vector store.
  • query: Query the chosen vector store.
  • remove: Remove objects from the chosen vector store.

ragbits vector-store list#

List all objects in the chosen vector store.

Usage:

ragbits vector-store list [OPTIONS]

Options:

Name Type Description Default
--limit integer Maximum number of entries to list 10
--offset integer How many entries to skip 0
--columns text Comma-separated list of columns to display, aviailable: id, text, image_bytes, metadata id,text,metadata
--help boolean Show this message and exit. False

ragbits vector-store query#

Query the chosen vector store.

Usage:

ragbits vector-store query [OPTIONS] TEXT

Options:

Name Type Description Default
--k integer Number of entries to retrieve 5
--score-threshold float Minimum score for result to be returned None
--columns text Comma-separated list of columns to display, aviailable: score, entry.id, entry.text, entry.image_bytes, entry.metadata score,entry.id,entry.text,entry.metadata
--help boolean Show this message and exit. False

ragbits vector-store remove#

Remove objects from the chosen vector store.

Usage:

ragbits vector-store remove [OPTIONS] IDS...

Options:

Name Type Description Default
--help boolean Show this message and exit. False