---
title: "pipeline"
sidebar_label: "pipeline"
description: "Kotlin binding reference: pipeline."
---

<!-- Generated by tools/api_reference/generate_api_docs.py. Do not edit. -->

//[clika-runtime](../../../index.md)/[io.clika.modelverse](../index.md)/[Modelverse](index.md)/[pipeline](pipeline.md)

# pipeline

[common]\
fun [pipeline](pipeline.md)(task: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), source: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), options: [LoadOptions](../LoadOptions/index.md) = LoadOptions(), stageObserver: [StageObserver](../StageObserver/index.md)? = null): [Pipeline](../Pipeline/index.md)

The pipeline of [task](pipeline.md) (transformers' task strings: `text-generation`, `automatic-speech-recognition`, `text-to-speech`, `translation`, `image-to-text`, `object-detection`, `depth-estimation`, `image-feature-extraction`, `zero-shot-image-classification`, `feature-extraction`, `text-ranking`, `voice-activity-detection`, `text-to-image`, `text-to-video`, and their aliases) over the model [source](pipeline.md) loads as: a snapshot directory, a hub repo id or a GGUF file, under [options](pipeline.md). [stageObserver](pipeline.md) is installed on the model where its kind reports stages ([GenerativeModel](../GenerativeModel/index.md)); a kind that reports none refuses it. An unknown task refuses with IllegalArgumentException naming the tasks; a task whose handle is not in this binding refuses with [ModelverseException](../ModelverseException/index.md). The pipeline owns the model.

[common]\
fun [pipeline](pipeline.md)(task: [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html), model: [PreTrainedModel](../PreTrainedModel/index.md)): [Pipeline](../Pipeline/index.md)

The pipeline of [task](pipeline.md) over an already loaded [model](pipeline.md); a model of another class refuses with IllegalArgumentException.