Skip to content

Documentation

  • Torch Functions


    LangTorch integrates with many Torch functions, allowing TextTensors and TextModules to utilize PyTorch utilities and autograd.

    Torch Functions

  • Text Objects


    Text objects are the structured (markup) text entries used in TextTensors and Modules. They enable the formatting multiplication operation in TextTensors and provide support for convenient workflow with markup languages like markdown.

    Text Objects

  • TextTensors


    TextTensors is the main data structure for prompt templating, embeddings and tokens, over which we perform LLM calls.

    TextTensors

  • TextModules


    TextModules are the building blocks for creating sequences of operations on text data, including both operations on text and embeddings. Their use is governed by similar rules as PyTorch nn.Modules with composability and support for torch utilities.

    TextModules

  • Activations


    Activations are TextModules used to call LLMs on the input TextTensor entries. Currently they support convenient parallel calls to OpenAI, but a custom implementation can be used for local models and other APIs.

    Activations