> For the complete documentation index, see [llms.txt](https://docs.dbnl.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dbnl.com/v0.27.x/reference/python-sdk.md). Agents can also search and read this documentation through its [MCP server](https://docs.dbnl.com/~gitbook/mcp).

# Python SDK

Reference documentation for the Distributional Python SDK

The Python SDK can be used for programmatically creating projects and uploading data to them.

{% hint style="info" %}
We recommend using the UI to create projects as part of a normal workflow. This will provide the best experience and most options for project setup. For more information see [Projects](https://github.com/dbnlAI/docs/blob/main/reference/workflow/projects.md).
{% endhint %}

See [SDK Log Ingestion](https://github.com/dbnlAI/docs/blob/main/reference/configuration/data-connections/sdk-log-ingestion.md) for more information and examples on using the SDK to upload log data to your deployment.

## Installation

To install the latest SDK, run:

```shell
pip install --upgrade dbnl
```

## SDK Functions

* [`convert_otlp_traces_data()`](https://docs.dbnl.com/v0.27.x/reference/python-sdk/sdk-functions.md#convert_otlp_traces_data)
* [`create_llm_model()`](https://docs.dbnl.com/v0.27.x/reference/python-sdk/sdk-functions.md#create_llm_model)
* [`create_metric()`](https://docs.dbnl.com/v0.27.x/reference/python-sdk/sdk-functions.md#create_metric)
* [`create_project()`](https://docs.dbnl.com/v0.27.x/reference/python-sdk/sdk-functions.md#create_project)
* [`delete_llm_model()`](https://docs.dbnl.com/v0.27.x/reference/python-sdk/sdk-functions.md#delete_llm_model)
* [`delete_metric()`](https://docs.dbnl.com/v0.27.x/reference/python-sdk/sdk-functions.md#delete_metric)
* [`get_llm_model()`](https://docs.dbnl.com/v0.27.x/reference/python-sdk/sdk-functions.md#get_llm_model)
* [`get_llm_model_by_name()`](https://docs.dbnl.com/v0.27.x/reference/python-sdk/sdk-functions.md#get_llm_model_by_name)
* [`get_or_create_llm_model()`](https://docs.dbnl.com/v0.27.x/reference/python-sdk/sdk-functions.md#get_or_create_llm_model)
* [`get_or_create_project()`](https://docs.dbnl.com/v0.27.x/reference/python-sdk/sdk-functions.md#get_or_create_project)
* [`get_project()`](https://docs.dbnl.com/v0.27.x/reference/python-sdk/sdk-functions.md#get_project)
* [`log()`](https://docs.dbnl.com/v0.27.x/reference/python-sdk/sdk-functions.md#log)
* [`login()`](https://docs.dbnl.com/v0.27.x/reference/python-sdk/sdk-functions.md#login)
* [`update_llm_model()`](https://docs.dbnl.com/v0.27.x/reference/python-sdk/sdk-functions.md#update_llm_model)

## Classes

* [`LLMModel`](https://docs.dbnl.com/v0.27.x/reference/python-sdk/classes.md#LLMModel)
* [`Metric`](https://docs.dbnl.com/v0.27.x/reference/python-sdk/classes.md#Metric)
* [`Project`](https://docs.dbnl.com/v0.27.x/reference/python-sdk/classes.md#Project)
