# packages

pkgId: 3fdfab2e7552d31c97a54d9d954a0edb99146177fe891b889ea9e9ba0db40d5c
name: python-light-rule-engine-help
arch: noarch
version: 0.3.2
epoch: 0
release: 1
summary: Development documents and examples for light-rule-engine
url: https://pypi.org/project/light-rule-engine/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-light-rule-engine-0.3.2-1.src.rpm
location_href: Packages/python-light-rule-engine-help-0.3.2-1.noarch.rpm
checksum_type: sha256
description:
  ```bash
  pip install light-rule-engine
  ```
  ```bash
  poetry add light-rule-engine
  ```
  ```bash
  uv add light-rule-engine
  ```

  | **Operator**  | **Description**                                                |
  |---------------|----------------------------------------------------------------|
  | `gte`         | Greater than or equal to                                       |
  | `gt`          | Greater than                                                   |
  | `lte`         | Less than or equal to                                          |
  | `lt`          | Less than                                                      |
  | `in`          | Value is in a list/collection                                  |
  | `iin`         | Value is in a list/collection or string (case insensitive)     |
  | `nin`         | Value is not in a list/collection                              |
  | `inin`        | Value is not in a list/collection or string (case insensitive) |
  | `startswith`  | String starts with a specific value                            |
  | `istartswith` | String starts with a specific value (case-insensitive)         |
  | `endswith`    | String ends with a specific value                              |
  | `iendswith`   | String ends with a specific value (case-insensitive)           |
  | `contains`    | Collection or string contains a specific value                 |
  | `icontains`   | String contains a specific value (case-insensitive)            |
  | `exact`       | Value matches exactly                                          |
  | `iexact`      | Value matches exactly (case-insensitive)                       |
  | `ne`          | Not equal                                                      |
  | `eq`          | Equal to                                                       |
  | `regex`       | Matches a regular expression pattern                           |


pkgId: 1b236cd2d06c235461325f98baf2add9c70fae60b8a4d3b2ae2773abcfe72ced
name: python-light-the-torch-help
arch: noarch
version: 0.8.0
epoch: 0
release: 1
summary: Development documents and examples for light-the-torch
url: https://pypi.org/project/light-the-torch/
rpm_license: BSD-3-Clause
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-light-the-torch-0.8.0-1.src.rpm
location_href: Packages/python-light-the-torch-help-0.8.0-1.noarch.rpm
checksum_type: sha256
description:
  [![BSD-3-Clause License](https://img.shields.io/github/license/pmeier/light-the-torch)](https://opensource.org/licenses/BSD-3-Clause)
  [![Project Status: WIP](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
  [![Code coverage via codecov.io](https://codecov.io/gh/pmeier/light-the-torch/branch/main/graph/badge.svg)](https://codecov.io/gh/pmeier/light-the-torch)

  `light-the-torch` is a small utility that wraps `pip` to ease the installation process
  for PyTorch distributions like `torch`, `torchvision`, `torchaudio`, and so on as well
  as third-party packages that depend on them. It auto-detects compatible CUDA versions
  from the local setup and installs the correct PyTorch binaries without user
  interference.

  - [Why do I need it?](#why-do-i-need-it)
  - [How do I install it?](#how-do-i-install-it)
  - [How do I use it?](#how-do-i-use-it)
  - [How does it work?](#how-does-it-work)
  - [Is it safe?](#is-it-safe)
  - [How do I contribute?](#how-do-i-contribute)



  PyTorch distributions like `torch`, `torchvision`, `torchaudio`, and so on are fully
  `pip install`'able, but PyPI, the default `pip` search index, has some limitations:

  1. PyPI regularly only allows binaries up to a size of
     [approximately 60 MB](https://github.com/pypa/packaging-problems/issues/86). One can
     [request a file size limit increase](https://pypi.org/help/#file-size-limit) (and the
     PyTorch team probably does that for every release), but it is still not enough:
     although PyTorch has pre-built binaries for Windows with CUDA, they cannot be
     installed through PyPI due to their size.
  2. PyTorch uses local version specifiers to indicate for which computation backend the
     binary was compiled, for example `torch==1.11.0+cpu`. Unfortunately, local specifiers
     are not allowed on PyPI. Thus, only the binaries compiled with one CUDA version are
     uploaded without an indication of the CUDA version. If you do not have a CUDA capable
     GPU, downloading this is only a waste of bandwidth and disk capacity. If on the other
     hand your NVIDIA driver version simply doesn't support the CUDA version the binary
     was compiled with, you can't use any of the GPU features.

  To overcome this, PyTorch also hosts _most_[^1] binaries
  [on their own package indices](https://download.pytorch.org/whl). To access PyTorch's
  package indices, you can still use `pip install`, but some
  [additional options](https://pytorch.org/get-started/locally/) are needed:

  ```shell
  pip install torch --index-url https://download.pytorch.org/whl/cu118
  ```

  [^1]:
      Some distributions are not compiled against a specific computation backend and thus
      hosting them on PyPI is sufficient since they work in every environment.

  While this is certainly an improvement, it still has a few downsides:

  1. You need to know what computation backend, e.g. CUDA 11.8 (`cu118`), is supported on
     your local machine. This can be quite challenging for new users and at least tedious
     for more experienced ones.
  2. Besides the stable binaries, PyTorch also offers nightly and test ones. To install
     them, you need a different `--index-url` for each.

  If any of these points don't sound appealing to you, and you just want to have the same
  user experience as `pip install` for PyTorch distributions, `light-the-torch` was made
  for you.



  Installing `light-the-torch` is as easy as

  ```shell
  pip install light-the-torch
  ```

  Since it depends on `pip` and it might be upgraded during installation,
  [Windows users](https://pip.pypa.io/en/stable/installation/#upgrading-pip) should
  install it with

  ```shell
  py -m pip install light-the-torch
  ```



  After `light-the-torch` is installed you can use its CLI interface `ltt` as drop-in
  replacement for `pip`:

  ```shell
  ltt install torch
  ```

  In fact, `ltt` is `pip` with a few added options:

  - By default, `ltt` uses the local NVIDIA driver version to select the correct binary
    for you. You can pass the `--pytorch-computation-backend` option to manually specify
    the computation backend you want to use:

    ```shell
    ltt install --pytorch-computation-backend=cu121 torch torchvision torchaudio
    ```

    Borrowing from the mutex packages that PyTorch provides for `conda` installations,
    `--cpuonly` is available as shorthand for `--pytorch-computation-backend=cpu`.

    In addition, the computation backend to be installed can also be set through the
    `LTT_PYTORCH_COMPUTATION_BACKEND` environment variable. It will only be honored in
    case no CLI option for the computation backend is specified.

  - By default, `ltt` installs stable PyTorch binaries. To install binaries from the
    nightly or test channels pass the `--pytorch-channel` option:

    ```shell
    ltt install --pytorch-channel=nightly torch torchvision torchaudio
    ```

    If `--pytorch-channel` is not passed, using `pip`'s builtin `--pre` option implies
    `--pytorch-channel=test`.

  Of course, you are not limited to install only PyTorch distributions. Everything shown
  above also works if you install packages that depend on PyTorch:

  ```shell
  ltt install --pytorch-computation-backend=cpu --pytorch-channel=nightly pystiche
  ```



  The authors of `pip` **do not condone** the use of `pip` internals as they might break
  without warning. As a results of this, `pip` has no capability for plugins to hook into
  specific tasks.

  `light-the-torch` works by monkey-patching `pip` internals at runtime:

  - While searching for a download link for a PyTorch distribution, `light-the-torch`
    replaces the default search index with an official PyTorch download link. This is
    equivalent to calling `pip install` with the `--index-url` option only for PyTorch
    distributions.
  - While evaluating possible PyTorch installation candidates, `light-the-torch` culls
    binaries incompatible with the hardware.



  A project as large as PyTorch is attractive for malicious actors given the large user
  base. For example in December 2022, PyTorch was hit by a
  [supply chain attack](https://pytorch.org/blog/compromised-nightly-dependency/) that
  potentially extracted user information. The PyTorch team mitigated the attack as soon as
  it was detected by temporarily hosting all third party dependencies on their own
  indices. With that,
  `pip install torch --extra-index-url https://download.pytorch.org/whl/cpu` wouldn't pull
  anything from PyPI and thus avoiding malicious packages placed there. Ultimately, this
  became the permanent solution and the official installation instructions now use
  `--index-url` and thus preventing installing anything not hosted on their indices.

  However, due to `light-the-torch`'s index patching, this mitigation was initially
  completely circumvented since only PyTorch distributions would have been installed from
  the PyTorch indices. Since version `0.7.0`, `light-the-torch` will only pull third-party
  dependencies from PyPI in case they are specifically requested and pinned. For example
  `ltt install --pytorch-channel=nightly torch` and
  `ltt install --pytorch-channel=nightly torch sympy` will install everything from the
  PyTorch indices. However, if you pin a third party dependency, e.g.
  `ltt install --pytorch-channel=nightly torch sympy==1.11.1`, it will be pulled from PyPI
  regardless of whether the version matches the one on the PyTorch index.

  In summary, `light-the-torch` is usually as safe as the regular PyTorch installation
  instructions. However, attacks on the supply chain can lead to situations where
  `light-the-torch` circumvents mitigations done by the PyTorch team. Unfortunately,
  `light-the-torch` is not officially supported by PyTorch and thus also not tested by
  them.



  Thanks a lot for your interest to contribute to `light-the-torch`! All contributions are
  appreciated, be it code or not. Especially in a project like this, we rely on user
  reports for edge cases we didn't anticipate. Please feel free to
  [open an issue](https://github.com/pmeier/light-the-torch/issues) if you encounter
  anything that you think should be working but doesn't.

  If you want to contribute code, check out our [contributing guidelines](CONTRIBUTING.md)
  to learn more about the workflow.


pkgId: 505b4326fa26d60c0ebc44cce4f659f256d2a4c1579a919aced8217bb9609ca4
name: python-lightkube-help
arch: noarch
version: 0.15.8
epoch: 0
release: 1
summary: Development documents and examples for lightkube
url: https://github.com/gtsystem/lightkube
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-lightkube-0.15.8-1.src.rpm
location_href: Packages/python-lightkube-help-0.15.8-1.noarch.rpm
checksum_type: sha256
description:
  ![](https://img.shields.io/github/actions/workflow/status/gtsystem/lightkube/python-package.yml?branch=master)
  [![Coverage Status](https://coveralls.io/repos/github/gtsystem/lightkube/badge.svg?branch=master)](https://coveralls.io/github/gtsystem/lightkube?branch=master)
  [![pypi supported versions](https://img.shields.io/pypi/pyversions/lightkube.svg)](https://pypi.python.org/pypi/lightkube)

  Modern lightweight kubernetes module for python




  * *Simple* interface shared across all kubernetes APIs.
  * Extensive *type hints* to avoid common mistakes and to support autocompletion.
  * Models and resources generated from the swagger specifications using standard dataclasses.
  * Load/Dump resource objects from YAML.
  * Support for async/await
  * Support for installing a specific version of the kubernetes models (1.16 to 1.31)
  * Lazy instantiation of inner models.
  * Fast startup and small memory footprint as only needed models and resources can be imported.
  * Automatic handling of pagination when listing resources.

  This module is powered by [httpx](https://github.com/encode/httpx/tree/master/httpx).



  This module requires python >= 3.7

      pip install lightkube



  Read a pod

  ```python
  from lightkube import Client
  from lightkube.resources.core_v1 import Pod

  client = Client()
  pod = client.get(Pod, name="my-pod", namespace="default")
  print(pod.namespace.uid)
  ```

  List nodes
  ```python
  from lightkube import Client
  from lightkube.resources.core_v1 import Node

  client = Client()
  for node in client.list(Node):
      print(node.metadata.name)
  ```

  Watch deployments
  ```python
  from lightkube import Client
  from lightkube.resources.apps_v1 import Deployment

  client = Client()
  for op, dep in client.watch(Deployment, namespace="default"):
      print(f"{dep.namespace.name} {dep.spec.replicas}")
  ```

  Create a config map
  ```python
  from lightkube.resources.core_v1 import ConfigMap
  from lightkube.models.meta_v1 import ObjectMeta

  config = ConfigMap(
      metadata=ObjectMeta(name='my-config', namespace='default'),
      data={'key1': 'value1', 'key2': 'value2'}
  )

  client.create(config)
  ```

  Replace the previous config with a different content
  ```python
  config.data['key1'] = 'new value'
  client.replace(config)
  ```

  Patch an existing config adding a label
  ```python
  patch = {'metadata': {'labels': {'app': 'xyz'}}}
  client.patch(ConfigMap, name='my-config', namespace='default', obj=patch)
  ```

  Remove the label `app`
  ```python

  patch = {'metadata': {'labels': {'app': None}}}
  client.patch(ConfigMap, name='my-config', namespace='default', obj=patch)
  ```

  Delete a namespaced resource
  ```python
  client.delete(ConfigMap, name='my-config', namespace='default')
  ```

  Create resources defined in a file
  ```python
  from lightkube import Client, codecs

  client = Client()
  with open('deployment.yaml') as f:
      for obj in codecs.load_all_yaml(f):
          client.create(obj)
  ```

  Scale a deployment
  ```python
  from lightkube.resources.apps_v1 import Deployment
  from lightkube.models.meta_v1 import ObjectMeta
  from lightkube.models.autoscaling_v1 import ScaleSpec

  obj = Deployment.Scale(
      metadata=ObjectMeta(name='metrics-server', namespace='kube-system'),
      spec=ScaleSpec(replicas=1)
  )
  client.replace(obj)
  ```

  Create and modify resources using [server side apply](https://kubernetes.io/docs/reference/using-api/server-side-apply/)

  *Note:* `field_manager` is required for server-side apply. You can specify it once in the client constructor
  or when calling `apply()`. Also `apiVersion` and `kind` need to be provided as part of
  the object definition.

  ```python
  from lightkube.resources.core_v1 import ConfigMap
  from lightkube.models.meta_v1 import ObjectMeta

  client = Client(field_manager="my-manager")
  config = ConfigMap(
      
      apiVersion='v1', kind='ConfigMap',
      metadata=ObjectMeta(name='my-config', namespace='default'),
      data={'key1': 'value1', 'key2': 'value2'}
  )

  res = client.apply(config)
  print(res.data)


  del config.data['key1']
  config.data['key3'] = 'value3'

  res = client.apply(config)
  print(res.data)

  ```

  Stream pod logs
  ```python
  from lightkube import Client

  client = Client()
  for line in client.log('my-pod', follow=True):
      print(line)
  ```



  The following features are not supported at the moment:

  * Special subresources `attach`, `exec`, `portforward` and `proxy`.
  * `auth-provider` authentication method is not supported. The supported
    authentication methods are `token`, `username` + `password` and `exec`.


pkgId: 9847b994d6f949242c67738bf2063ef332fd41587fcbe662e36be7d8d01257f3
name: python-lightkube-models-help
arch: noarch
version: 1.32.0.8
epoch: 0
release: 1
summary: Development documents and examples for lightkube-models
url: https://github.com/gtsystem/lightkube-models
rpm_license: Apache Software License
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-lightkube-models-1.32.0.8-1.src.rpm
location_href: Packages/python-lightkube-models-help-1.32.0.8-1.noarch.rpm
checksum_type: sha256
description:
  This is a python module containing definitions of kubernetes
  models and resources to be used by [lightkube](https://lightkube.readthedocs.io/en/latest/).

  The version of this package (first 3 parts `major.minor.micro`), match
  the kubernetes schema version used to generate the models.

  You should install the module version matching your kubernetes installation or just
  use compatible resources.


pkgId: 9e629dfd37c71ce9b6f9a8fcaacabd035313f763a8927a3b655e13f552ad1119
name: python-lightning-help
arch: noarch
version: 2.4.0
epoch: 0
release: 1
summary: Development documents and examples for lightning
url: https://github.com/Lightning-AI/lightning
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-lightning-2.4.0-1.src.rpm
location_href: Packages/python-lightning-help-2.4.0-1.noarch.rpm
checksum_type: sha256
description:
  <div align="center">

  <img alt="Lightning" src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/ptl_banner.png" width="800px" style="max-width: 100%;">

  <br/>
  <br/>

  **The deep learning framework to pretrain, finetune and deploy AI models.**

  **NEW- Lightning 2.0 features a clean and stable API!!**

  ______________________________________________________________________

  <p align="center">
    <a href="https://lightning.ai/">Lightning AI</a> •
    <a href="#examples">Examples</a> •
    <a href="#pytorch-lightning-train-and-deploy-pytorch-at-scale">PyTorch Lightning</a> •
    <a href="#lightning-fabric-expert-control">Fabric</a> •
    <a href="https://pytorch-lightning.readthedocs.io/en/2.4.0">Docs</a> •
    <a href="#community">Community</a> •
    <a href="https://lightning.ai/docs/pytorch/stable/generated/CONTRIBUTING.html">Contribute</a> •
  </p>

  <!-- DO NOT ADD CONDA DOWNLOADS... README CHANGES MUST BE APPROVED BY EDEN OR WILL -->

  [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pytorch-lightning)](https://pypi.org/project/pytorch-lightning/)
  [![PyPI Status](https://badge.fury.io/py/pytorch-lightning.svg)](https://badge.fury.io/py/pytorch-lightning)
  [![PyPI - Downloads](https://img.shields.io/pypi/dm/pytorch-lightning)](https://pepy.tech/project/pytorch-lightning)
  [![Conda](https://img.shields.io/conda/v/conda-forge/lightning?label=conda&color=success)](https://anaconda.org/conda-forge/lightning)
  [![codecov](https://codecov.io/gh/Lightning-AI/pytorch-lightning/graph/badge.svg?token=SmzX8mnKlA)](https://codecov.io/gh/Lightning-AI/pytorch-lightning)

  [![Discord](https://img.shields.io/discord/1077906959069626439?style=plastic)](https://discord.gg/VptPCZkGNa)
  ![GitHub commit activity](https://img.shields.io/github/commit-activity/w/lightning-ai/lightning)
  [![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/Lightning-AI/lightning/blob/master/LICENSE)

  <!--
  [![CodeFactor](https://www.codefactor.io/repository/github/Lightning-AI/lightning/badge)](https://www.codefactor.io/repository/github/Lightning-AI/lightning)
  -->

  </div>

  <div align="center">

  <p align="center">

  &nbsp;

  <a target="_blank" href="https://lightning.ai/docs/pytorch/latest/starter/introduction.html#define-a-lightningmodule">
    <img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/get-started-badge.svg" height="36px" alt="Get started"/>
  </a>

  </p>

  </div>



  Simple installation from PyPI

  ```bash
  pip install lightning
  ```

  <!--  -->

  ______________________________________________________________________



  [PyTorch Lightning: Train and deploy PyTorch at scale](#pytorch-lightning-train-and-deploy-pytorch-at-scale).
  <br/>
  [Lightning Fabric: Expert control](#lightning-fabric-expert-control).

  Lightning gives you granular control over how much abstraction you want to add over PyTorch.

  <div align="center">
      <img src="https://pl-public-data.s3.amazonaws.com/assets_lightning/continuum.png" width="80%">
  </div>

  &nbsp;
  &nbsp;




  PyTorch Lightning is just organized PyTorch - Lightning disentangles PyTorch code to decouple the science from the engineering.



  ______________________________________________________________________


  Explore various types of training possible with PyTorch Lightning. Pretrain and finetune ANY kind of model to perform ANY task like classification, segmentation, summarization and more:

  | Task                                                                                                        | Description                                                    | Run |
  |-------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------|---|
  | [Hello world](#hello-simple-model)                                                                          | Pretrain - Hello world example                                 | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/pytorch-lightning-hello-world"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
  | [Image classification](https://lightning.ai/lightning-ai/studios/image-classification-with-pytorch-lightning) | Finetune - ResNet-34 model to classify images of cars          | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/image-classification-with-pytorch-lightning"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
  | [Image segmentation](https://lightning.ai/lightning-ai/studios/image-segmentation-with-pytorch-lightning)   | Finetune - ResNet-50 model to segment images                   | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/image-segmentation-with-pytorch-lightning"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
  | [Object detection](https://lightning.ai/lightning-ai/studios/object-detection-with-pytorch-lightning)       | Finetune - Faster R-CNN model to detect objects                   | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/object-detection-with-pytorch-lightning"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
  | [Text classification](https://lightning.ai/lightning-ai/studios/text-classification-with-pytorch-lightning) | Finetune - text classifier (BERT model)                        | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/text-classification-with-pytorch-lightning"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
  | [Text summarization](https://lightning.ai/lightning-ai/studios/text-summarization-with-pytorch-lightning)   | Finetune - text summarization (Hugging Face transformer model) | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/text-summarization-with-pytorch-lightning"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
  | [Audio generation](https://lightning.ai/lightning-ai/studios/finetune-a-personal-ai-music-generator)        | Finetune - audio generator (transformer model)                 | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/finetune-a-personal-ai-music-generator"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
  | [LLM finetuning](https://lightning.ai/lightning-ai/studios/finetune-an-llm-with-pytorch-lightning)          | Finetune - LLM (Meta Llama 3.1 8B)                | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/finetune-an-llm-with-pytorch-lightning"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |
  | [Image generation](https://lightning.ai/lightning-ai/studios/train-a-diffusion-model-with-pytorch-lightning)          | Pretrain - Image generator (diffusion model)                | <a target="_blank" href="https://lightning.ai/lightning-ai/studios/train-a-diffusion-model-with-pytorch-lightning"><img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/studio-badge.svg" alt="Open In Studio"/></a> |



  ```python


  import torch, torch.nn as nn, torch.utils.data as data, torchvision as tv, torch.nn.functional as F
  import lightning as L








  class LitAutoEncoder(L.LightningModule):
      def __init__(self):
          super().__init__()
          self.encoder = nn.Sequential(nn.Linear(28 * 28, 128), nn.ReLU(), nn.Linear(128, 3))
          self.decoder = nn.Sequential(nn.Linear(3, 128), nn.ReLU(), nn.Linear(128, 28 * 28))

      def forward(self, x):
          
          embedding = self.encoder(x)
          return embedding

      def training_step(self, batch, batch_idx):
          
          x, _ = batch
          x = x.view(x.size(0), -1)
          z = self.encoder(x)
          x_hat = self.decoder(z)
          loss = F.mse_loss(x_hat, x)
          self.log("train_loss", loss)
          return loss

      def configure_optimizers(self):
          optimizer = torch.optim.Adam(self.parameters(), lr=1e-3)
          return optimizer





  dataset = tv.datasets.MNIST(".", download=True, transform=tv.transforms.ToTensor())
  train, val = data.random_split(dataset, [55000, 5000])




  autoencoder = LitAutoEncoder()
  trainer = L.Trainer()
  trainer.fit(autoencoder, data.DataLoader(train), data.DataLoader(val))
  ```

  Run the model on your terminal

  ```bash
  pip install torchvision
  python main.py
  ```

  ______________________________________________________________________



  Lightning has over [40+ advanced features](https://lightning.ai/docs/pytorch/stable/common/trainer.html#trainer-flags) designed for professional AI research at scale.

  Here are some examples:

  <div align="center">
      <img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/features_2.jpg" max-height="600px">
    </div>

  <details>
    <summary>Train on 1000s of GPUs without code changes</summary>

  ```python


  trainer = Trainer(accelerator="gpu", devices=8)


  trainer = Trainer(accelerator="gpu", devices=8, num_nodes=32)
  ```

  </details>

  <details>
    <summary>Train on other accelerators like TPUs without code changes</summary>

  ```python

  trainer = Trainer(accelerator="tpu", devices=8)
  ```

  </details>

  <details>
    <summary>16-bit precision</summary>

  ```python

  trainer = Trainer(precision=16)
  ```

  </details>

  <details>
    <summary>Experiment managers</summary>

  ```python
  from lightning import loggers


  trainer = Trainer(logger=TensorBoardLogger("logs/"))


  trainer = Trainer(logger=loggers.WandbLogger())


  trainer = Trainer(logger=loggers.CometLogger())


  trainer = Trainer(logger=loggers.MLFlowLogger())


  trainer = Trainer(logger=loggers.NeptuneLogger())


  ```

  </details>

  <details>

  <summary>Early Stopping</summary>

  ```python
  es = EarlyStopping(monitor="val_loss")
  trainer = Trainer(callbacks=[es])
  ```

  </details>

  <details>
    <summary>Checkpointing</summary>

  ```python
  checkpointing = ModelCheckpoint(monitor="val_loss")
  trainer = Trainer(callbacks=[checkpointing])
  ```

  </details>

  <details>
    <summary>Export to torchscript (JIT) (production use)</summary>

  ```python

  autoencoder = LitAutoEncoder()
  torch.jit.save(autoencoder.to_torchscript(), "model.pt")
  ```

  </details>

  <details>
    <summary>Export to ONNX (production use)</summary>

  ```python

  with tempfile.NamedTemporaryFile(suffix=".onnx", delete=False) as tmpfile:
      autoencoder = LitAutoEncoder()
      input_sample = torch.randn((1, 64))
      autoencoder.to_onnx(tmpfile.name, input_sample, export_params=True)
      os.path.isfile(tmpfile.name)
  ```

  </details>

  ______________________________________________________________________



  - Models become hardware agnostic
  - Code is clear to read because engineering code is abstracted away
  - Easier to reproduce
  - Make fewer mistakes because lightning handles the tricky engineering
  - Keeps all the flexibility (LightningModules are still PyTorch modules), but removes a ton of boilerplate
  - Lightning has dozens of integrations with popular machine learning tools.
  - [Tested rigorously with every new PR](https://github.com/Lightning-AI/lightning/tree/master/tests). We test every combination of PyTorch and Python supported versions, every OS, multi GPUs and even TPUs.
  - Minimal running speed overhead (about 300 ms per epoch compared with pure PyTorch).

  ______________________________________________________________________

  <div align="center">
      <a href="https://lightning.ai/docs/pytorch/stable/">Read the PyTorch Lightning docs</a>
  </div>

  ______________________________________________________________________

  &nbsp;
  &nbsp;



  Run on any device at any scale with expert-level control over PyTorch training loop and scaling strategy. You can even write your own Trainer.

  Fabric is designed for the most complex models like foundation model scaling, LLMs, diffusion, transformers, reinforcement learning, active learning. Of any size.

  <table>
  <tr>
  <th>What to change</th>
  <th>Resulting Fabric Code (copy me!)</th>
  </tr>
  <tr>
  <td>
  <sub>

  ```diff
  + import lightning as L
    import torch; import torchvision as tv

   dataset = tv.datasets.CIFAR10("data", download=True,
                                 train=True,
                                 transform=tv.transforms.ToTensor())

  + fabric = L.Fabric()
  + fabric.launch()

    model = tv.models.resnet18()
    optimizer = torch.optim.SGD(model.parameters(), lr=0.001)
  - device = "cuda" if torch.cuda.is_available() else "cpu"
  - model.to(device)
  + model, optimizer = fabric.setup(model, optimizer)

    dataloader = torch.utils.data.DataLoader(dataset, batch_size=8)
  + dataloader = fabric.setup_dataloaders(dataloader)

    model.train()
    num_epochs = 10
    for epoch in range(num_epochs):
        for batch in dataloader:
            inputs, labels = batch
  -         inputs, labels = inputs.to(device), labels.to(device)
            optimizer.zero_grad()
            outputs = model(inputs)
            loss = torch.nn.functional.cross_entropy(outputs, labels)
  -         loss.backward()
  +         fabric.backward(loss)
            optimizer.step()
            print(loss.data)
  ```

  </sub>
  <td>
  <sub>

  ```Python
  import lightning as L
  import torch; import torchvision as tv

  dataset = tv.datasets.CIFAR10("data", download=True,
                                train=True,
                                transform=tv.transforms.ToTensor())

  fabric = L.Fabric()
  fabric.launch()

  model = tv.models.resnet18()
  optimizer = torch.optim.SGD(model.parameters(), lr=0.001)
  model, optimizer = fabric.setup(model, optimizer)

  dataloader = torch.utils.data.DataLoader(dataset, batch_size=8)
  dataloader = fabric.setup_dataloaders(dataloader)

  model.train()
  num_epochs = 10
  for epoch in range(num_epochs):
      for batch in dataloader:
          inputs, labels = batch
          optimizer.zero_grad()
          outputs = model(inputs)
          loss = torch.nn.functional.cross_entropy(outputs, labels)
          fabric.backward(loss)
          optimizer.step()
          print(loss.data)
  ```

  </sub>
  </td>
  </tr>
  </table>



  <details>
    <summary>Easily switch from running on CPU to GPU (Apple Silicon, CUDA, …), TPU, multi-GPU or even multi-node training</summary>

  ```python


  fabric = Fabric()


  fabric = Fabric(accelerator="gpu")


  fabric = Fabric(accelerator="gpu", devices=8)


  fabric = Fabric(accelerator="gpu", devices=8, num_nodes=32)


  fabric = Fabric(accelerator="tpu")
  ```

  </details>

  <details>
    <summary>Use state-of-the-art distributed training strategies (DDP, FSDP, DeepSpeed) and mixed precision out of the box</summary>

  ```python

  fabric = Fabric(strategy="ddp")
  fabric = Fabric(strategy="deepspeed")
  fabric = Fabric(strategy="fsdp")


  fabric = Fabric(precision="16-mixed")
  fabric = Fabric(precision="64")
  ```

  </details>

  <details>
    <summary>All the device logic boilerplate is handled for you</summary>

  ```diff
    
  - model.to(device)
  - batch.to(device)
  ```

  </details>

  <details>
    <summary>Build your own custom Trainer using Fabric primitives for training checkpointing, logging, and more</summary>

  ```python
  import lightning as L


  class MyCustomTrainer:
      def __init__(self, accelerator="auto", strategy="auto", devices="auto", precision="32-true"):
          self.fabric = L.Fabric(accelerator=accelerator, strategy=strategy, devices=devices, precision=precision)

      def fit(self, model, optimizer, dataloader, max_epochs):
          self.fabric.launch()

          model, optimizer = self.fabric.setup(model, optimizer)
          dataloader = self.fabric.setup_dataloaders(dataloader)
          model.train()

          for epoch in range(max_epochs):
              for batch in dataloader:
                  input, target = batch
                  optimizer.zero_grad()
                  output = model(input)
                  loss = loss_fn(output, target)
                  self.fabric.backward(loss)
                  optimizer.step()
  ```

  You can find a more extensive example in our [examples](examples/fabric/build_your_own_trainer)

  </details>

  ______________________________________________________________________

  <div align="center">
      <a href="https://lightning.ai/docs/fabric/stable/">Read the Lightning Fabric docs</a>
  </div>

  ______________________________________________________________________

  &nbsp;
  &nbsp;





  - [CPC transforms](https://lightning-bolts.readthedocs.io/en/stable/transforms/self_supervised.html#cpc-transforms)
  - [Moco v2 transforms](https://lightning-bolts.readthedocs.io/en/stable/transforms/self_supervised.html#moco-v2-transforms)
  - [SimCLR transforms](https://lightning-bolts.readthedocs.io/en/stable/transforms/self_supervised.html#simclr-transforms)



  - [GPT-2](https://lightning-bolts.readthedocs.io/en/stable/models/convolutional.html#gpt-2)
  - [UNet](https://lightning-bolts.readthedocs.io/en/stable/models/convolutional.html#unet)



  - [DQN Loss](https://lightning-bolts.readthedocs.io/en/stable/losses.html#dqn-loss)
  - [Double DQN Loss](https://lightning-bolts.readthedocs.io/en/stable/losses.html#double-dqn-loss)
  - [Per DQN Loss](https://lightning-bolts.readthedocs.io/en/stable/losses.html#per-dqn-loss)



  - [Basic GAN](https://lightning-bolts.readthedocs.io/en/stable/models/gans.html#basic-gan)
  - [DCGAN](https://lightning-bolts.readthedocs.io/en/stable/models/gans.html#dcgan)



  - [Logistic Regression](https://lightning-bolts.readthedocs.io/en/stable/models/classic_ml.html#logistic-regression)
  - [Linear Regression](https://lightning-bolts.readthedocs.io/en/stable/models/classic_ml.html#linear-regression)

  &nbsp;
  &nbsp;



  Lightning is rigorously tested across multiple CPUs, GPUs and TPUs and against major Python and PyTorch versions.



  <details>
    <summary>Current build statuses</summary>

  <center>

  |       System / PyTorch ver.        | 1.13                                                                                                                                                                                                                            | 2.0                                                                                                                                                                                                                             |                                                                                                               2.1                                                                                                               |
  | :--------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: | :-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
  |        Linux py3.9 \[GPUs\]        |  |  | [![Build Status](https://dev.azure.com/Lightning-AI/lightning/_apis/build/status%2Fpytorch-lightning%20%28GPUs%29?branchName=refs%2Ftags%2F2.4.0)](https://dev.azure.com/Lightning-AI/lightning/_build/latest?definitionId=24&branchName=master) |
  |        Linux py3.9 \[TPUs\]        |                                                                                                                                                                                                                                 |  [![Test PyTorch - TPU](https://github.com/Lightning-AI/lightning/actions/workflows/tpu-tests.yml/badge.svg)](https://github.com/Lightning-AI/lightning/actions/workflows/tpu-tests.yml)     |      |
  |  Linux (multiple Python versions)  | [![Test PyTorch](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml/badge.svg)](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml)                                 | [![Test PyTorch](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml/badge.svg)](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml)                                 |                 [![Test PyTorch](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml/badge.svg)](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml)                 |
  |   OSX (multiple Python versions)   | [![Test PyTorch](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml/badge.svg)](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml)                                 | [![Test PyTorch](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml/badge.svg)](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml)                                 |                 [![Test PyTorch](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml/badge.svg)](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml)                 |
  | Windows (multiple Python versions) | [![Test PyTorch](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml/badge.svg)](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml)                                 | [![Test PyTorch](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml/badge.svg)](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml)                                 |                 [![Test PyTorch](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml/badge.svg)](https://github.com/Lightning-AI/lightning/actions/workflows/ci-tests-pytorch.yml)                 |

  </center>
  </details>

  &nbsp;
  &nbsp;



  The lightning community is maintained by

  - [10+ core contributors](https://lightning.ai/docs/pytorch/latest/community/governance.html) who are all a mix of professional engineers, Research Scientists, and Ph.D. students from top AI labs.
  - 800+ community contributors.

  Want to help us build Lightning and reduce boilerplate for thousands of researchers? [Learn how to make your first contribution here](https://lightning.ai/docs/pytorch/stable/generated/CONTRIBUTING.html)

  Lightning is also part of the [PyTorch ecosystem](https://pytorch.org/ecosystem/) which requires projects to have solid testing, documentation and support.



  If you have any questions please:

  1. [Read the docs](https://lightning.ai/docs).
  1. [Search through existing Discussions](https://github.com/Lightning-AI/lightning/discussions), or [add a new question](https://github.com/Lightning-AI/lightning/discussions/new)
  1. [Join our discord](https://discord.com/invite/tfXFetEZxv).


pkgId: 826a9da77ed4ebde2aa6b8642a81f7524dfe32cd9f2334d3ac3b0f107e16e16e
name: python-lightning-module-enhanced-help
arch: noarch
version: 0.35.3
epoch: 0
release: 1
summary: Development documents and examples for lightning-module-enhanced
url: https://gitlab.com/mihaicristianpirvu/lightning-module-enhanced
rpm_license: WTFPL
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-lightning-module-enhanced-0.35.3-1.src.rpm
location_href: Packages/python-lightning-module-enhanced-help-0.35.3-1.noarch.rpm
checksum_type: sha256
description:
  Trying to make pytorch-lightning more *pythonic*, whatever that means.

  Docs [here](docs/).



  ```
  pip install lightning-module-enhanced
  ```

  Lowest supported python version: 3.10. We have `lightning-module-enhanced==0.34.xxx` that supports python3.8 as well,
  but it's not getting updates.


pkgId: d584e97db6d09e649887610af571f62562974dd85f03a07e357fab889ff22e81
name: python-lightning-thunder-help
arch: noarch
version: 0.1.0
epoch: 0
release: 1
summary: Development documents and examples for lightning-thunder
url: https://github.com/Lightning-AI/lightning-thunder
rpm_license: Apache 2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-lightning-thunder-0.1.0-1.src.rpm
location_href: Packages/python-lightning-thunder-help-0.1.0-1.noarch.rpm
checksum_type: sha256
description:
  ![](https://github.com/Lightning-AI/lightning-thunder/raw/0.1.0/docs/source/_static/images/lightning_thunder_lightmode_nobyline.png)



  Lightning Thunder is a source-to-source compiler for PyTorch.

  It makes PyTorch programs faster both on single accelerators or in distributed settings.

  Thunder aims to be usable, understandable, and extensible.



  Thunder can achieve significant speedups over standard PyTorch eager code, through the compounding effects of optimizations and the use of best in class executors. Here is an example of the pretraining throughput for Llama 2 7B as implemented in [LitGPT](https://github.com/Lightning-AI/litgpt).

  ![](https://github.com/Lightning-AI/lightning-thunder/raw/0.1.0/docs/source/_static/images/training_throughput_single.png)

  We achieve a 40% speedup in training throughput compared to eager code on H100 using a combination of executors including nvFuser, torch.compile, cuDNN, and TransformerEngine FP8.

  Thunder supports distributed strategies like DDP and FSDP (ZeRO2 and ZeRO3). Here is the normalized throughput measured for Llama 2 7B (this time without FP8 mixed precision, support for FSDP is underway).

  ![](https://github.com/Lightning-AI/lightning-thunder/raw/0.1.0/docs/source/_static/images/normalized_training_throughput_zero2.png)

  **NOTE: Lightning Thunder is alpha.** Feel free to get involved, expect a few bumps along the way.



  Try Thunder without installing by using our [Zero to Thunder Tutorial Studio](https://lightning.ai/lightning-ai/studios/zero-to-thunder-tutorial).



  Install [nvFuser](https://github.com/NVIDIA/Fuser) nightly, which will also install the matching PyTorch nightly:

  ```bash
  pip install --pre 'nvfuser-cu121[torch]' --extra-index-url https://pypi.nvidia.com
  ```

  Install Thunder:

  ```bash
  pip install git+https://github.com/Lightning-AI/lightning-thunder.git
  ```

  or install from the local repo:

  ```bash
  pip install .
  ```



  Here is a simple example of how Thunder lets you compile and run PyTorch code:

  ```python
  import torch
  import thunder


  def foo(a, b):
      return a + b


  jfoo = thunder.jit(foo)

  a = torch.full((2, 2), 1)
  b = torch.full((2, 2), 3)

  result = jfoo(a, b)

  print(result)





  ```

  The compiled function `jfoo` takes and returns PyTorch tensors, just like the original function, so modules and functions compiled by Thunder can be used as part of larger PyTorch programs.



  Thunder is in its early stages, it should not be used for production runs yet.

  However, it can already deliver outstanding performance on models supported by [LitGPT](https://github.com/Lightning-AI/lit-gpt), such as Mistral, Llama2, Gemma, Falcon, and derivatives.

  Run training loop for Llama, single-GPU:

  ```bash
  python examples/lit-gpt/train.py
  ```

  Run training loop for Llama, multi-GPU, using FSDP:

  ```bash
  python examples/lit-gpt/train_fsdp.py
  ```

  See [README.md](examples/lit-gpt/README.md) for details on running LitGPT with Thunder.



  Given a python callable or PyTorch module, Thunder can generate an optimized program that:

  - Computes its forward and backward passes
  - Coalesces operations into efficient fusion regions
  - Dispatches computations to optimized kernels
  - Distributes computations optimally across machines

  To do so, Thunder ships with:

  - A JIT for acquiring Python programs targeting PyTorch and custom operations
  - A multi-level IR to represent operations as a trace of a reduced op-set
  - An extensible set of transformations on the trace, such as `grad`, fusions, distributed (like `ddp`, `fsdp`), functional (like `vmap`, `vjp`, `jvp`)
  - A way to dispatch operations to an extensible collection of executors

  Thunder is written entirely in Python. Even its trace is represented as valid Python at all stages of transformation. This allows unprecedented levels of introspection and extensibility.

  Thunder doesn't generate code for accelerators directly. It acquires and transforms user programs so that it's possible to optimally select or generate device code using fast executors like:

  - [torch.compile](https://pytorch.org/get-started/pytorch-2.0/)
  - [nvFuser](https://github.com/NVIDIA/Fuser)
  - [cuDNN](https://developer.nvidia.com/cudnn)
  - [Apex](https://github.com/NVIDIA/apex)
  - [TransformerEngine](https://github.com/NVIDIA/TransformerEngine)
  - [PyTorch eager](https://github.com/pytorch/pytorch)
  - custom kernels, including those written with [OpenAI Triton](https://github.com/openai/triton)

  Modules and functions compiled with Thunder fully interoperate with vanilla PyTorch and support PyTorch's autograd. Also, Thunder works alongside torch.compile to leverage its state-of-the-art optimizations.



  Docs are currently not hosted publicly. However you can build them locally really quickly:

  ```bash
  make docs
  ```

  and point your browser to the generated docs at `docs/build/index.html`.



  You can set up your environment for developing Thunder by installing the development requirements:

  ```bash
  pip install -r requirements/devel.txt
  ```

  Install Thunder as an editable package (optional):

  ```bash
  pip install -e .
  ```

  Now you run tests:

  ```bash
  pytest thunder/tests
  ```

  Thunder is very thoroughly tested, so expect this to take a while.



  Lightning Thunder is released under the [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0) license.
  See LICENSE file for details.

  [![CI testing](https://github.com/Lightning-AI/lightning-thunder/actions/workflows/ci-testing.yml/badge.svg?event=push)](https://github.com/Lightning-AI/lightning-thunder/actions/workflows/ci-testing.yml)
  [![General checks](https://github.com/Lightning-AI/lightning-thunder/actions/workflows/ci-checks.yml/badge.svg?event=push)](https://github.com/Lightning-AI/lightning-thunder/actions/workflows/ci-checks.yml)
  [![Documentation Status](https://readthedocs.org/projects/lightning-thunder/badge/?version=latest)](https://lightning-thunder.readthedocs.io/en/latest/?badge=latest)
  [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Lightning-AI/lightning-thunder/main.svg?badge_token=mqheL1-cTn-280Vx4cJUdg)](https://results.pre-commit.ci/latest/github/Lightning-AI/lightning-thunder/main?badge_token=mqheL1-cTn-280Vx4cJUdg)


pkgId: 6c1c716fb03bf1d24be0fe950fd8c1d941d7b8bb10c06137317bf83af5ed2c3a
name: python-lightning-utilities-help
arch: noarch
version: 0.11.9
epoch: 0
release: 1
summary: Development documents and examples for lightning-utilities
url: https://github.com/Lightning-AI/utilities
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-lightning-utilities-0.11.9-1.src.rpm
location_href: Packages/python-lightning-utilities-help-0.11.9-1.noarch.rpm
checksum_type: sha256
description:
  [![PyPI Status](https://badge.fury.io/py/lightning-utilities.svg)](https://badge.fury.io/py/lightning-utilities)
  [![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/Lightning-AI/utilities/blob/master/LICENSE)
  [![PyPI - Downloads](https://img.shields.io/pypi/dm/lightning-utilities)](https://pepy.tech/project/lightning-utilities)
  [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/lightning-utilities)](https://pypi.org/project/lightning-utilities/)

  [![UnitTests](https://github.com/Lightning-AI/utilities/actions/workflows/ci-testing.yml/badge.svg?event=push)](https://github.com/Lightning-AI/utilities/actions/workflows/ci-testing.yml)
  [![Apply checks](https://github.com/Lightning-AI/utilities/actions/workflows/ci-use-checks.yaml/badge.svg?event=push)](https://github.com/Lightning-AI/utilities/actions/workflows/ci-use-checks.yaml)
  [![Docs Status](https://readthedocs.org/projects/lit-utilities/badge/?version=latest)](https://lit-utilities.readthedocs.io/en/latest/?badge=latest)
  [![pre-commit.ci status](https://results.pre-commit.ci/badge/github/Lightning-AI/utilities/main.svg)](https://results.pre-commit.ci/latest/github/Lightning-AI/utilities/main)

  __This repository covers the following use-cases:__

  1. _Reusable GitHub workflows_
  2. _Shared GitHub actions_
  3. _General Python utilities in `lightning_utilities.core`_
  4. _CLI `python -m lightning_utilities.cli --help`_



  __Usage:__

  ```yaml
  name: Check schema

  on: [push]

  jobs:

    check-schema:
      uses: Lightning-AI/utilities/.github/workflows/check-schema.yml@v0.5.0
      with:
        azure-dir: ""  # skip Azure check

    check-code:
      uses: Lightning-AI/utilities/.github/workflows/check-code.yml@main
      with:
        actions-ref: main  # normally you shall use the same version as the workflow
  ```

  See usage of other workflows in [.github/workflows/ci-use-checks.yaml](https://github.com/Lightning-AI/utilities/tree/main/.github/workflows/ci-use-checks.yaml).



  See available composite actions [.github/actions/](https://github.com/Lightning-AI/utilities/tree/main/.github/actions).

  __Usage:__

  ```yaml
  name: Do something with cache

  on: [push]

  jobs:
    pytest:
      runs-on: ubuntu-20.04
      steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-python@v4
        with:
          python-version: 3.9
      - uses: Lightning-AI/utilities/.github/actions/cache
        with:
          python-version: 3.9
          requires: oldest # or latest
  ```



  <details>
    <summary>Installation</summary>
  From source:

  ```bash
  pip install https://github.com/Lightning-AI/utilities/archive/refs/heads/main.zip
  ```

  From pypi:

  ```bash
  pip install lightning_utilities
  ```

  </details>

  __Usage:__

  Example for optional imports:

  ```python
  from lightning_utilities.core.imports import module_available

  if module_available("some_package.something"):
      from some_package import something
  ```



  The package provides common CLI commands.

  <details>
    <summary>Installation</summary>

  From pypi:

  ```bash
  pip install lightning_utilities[cli]
  ```

  </details>

  __Usage:__

  ```bash
  python -m lightning_utilities.cli [group] [command]
  ```

  <details>
    <summary>Example for setting min versions</summary>

  ```console
  $ cat requirements/test.txt
  coverage>=5.0
  codecov>=2.1
  pytest>=6.0
  pytest-cov
  pytest-timeout
  $ python -m lightning_utilities.cli requirements set-oldest
  $ cat requirements/test.txt
  coverage==5.0
  codecov==2.1
  pytest==6.0
  pytest-cov
  pytest-timeout
  ```

  </details>


pkgId: 2f8f8c04bac15e9ebdb9fd331853ee4f89a46aace183c64905dbc9f60be4f187
name: python-lightwave-smart-help
arch: noarch
version: 0.8.30
epoch: 0
release: 1
summary: Development documents and examples for lightwave-smart
url: https://github.com/LightwaveSmartHome/lightwave_smart
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-lightwave-smart-0.8.30-1.src.rpm
location_href: Packages/python-lightwave-smart-help-0.8.30-1.noarch.rpm
checksum_type: sha256
description:
  Python library to provide reliable communication with Lightwave Smart Series (second generation) devices.  Including lights (dimmers), power outlets (sockets), smart switchs (wirefrees), PIRs, thermostats, TRVs, magnetic switches, relays, energy monitors and other device types.


  **The LWLink2Public class should not be used in this version, it has not been tested.**



  The easiest way is

      pip3 install lightwave_smart

  Or just copy https://raw.githubusercontent.com/LightwaveSmartHome/lightwave-smart/master/lightwave_smart/lightwave_smart.py into your project




  You'll need to import the library

      from lightwave_smart import lightwave_smart

  If you want to see all the messages passed back and forth with the Lightwave servers, set the logging level to debug:

      import logging
      logging.basicConfig(level=logging.DEBUG)


  Start by authenticating with the LW servers.

      link = lightwave_smart.LWLink2("example@example.com", "password")

  This sets up a `LWLink2` object called `link`, and gets an authentication token from LW which is stored in the object. We can now connect to the LW websocket service

      link.connect()


  Next:

      link.get_hierarchy()

  This requests the LW server to tell us all of the registered "featuresets". A "featureset" is LW's word for a group of features (e.g. a light switch could have features for "power" and "brightness") - this is what I think of as a device, but that's not how LW describes them (sidenote: what LW considers to be a device depends on the generation of the hardware - for gen 1 hardware, devices and featuresets correspond, for gen2 a device corresponds to a physical object; e.g. a 2 gang switch is a single device, but 2 featuresets).

  Running `get_hierarchy` populates a dictionary of all of the featuresets available. the dictionary keys are unique identifiers provided by LW, the values are `LWRFFeatureSet` objects that hold information about the featureset.

  To see the objects:

      print(link.featuresets)

  For a slightly more useful view:

      for i in link.featuresets.values():
          print(i.name, i.featureset_id, i.features)

  In my case this returns

      Garden Room 5bc4d06e87779374d29d7d9a-5bc4d61387779374d29fdd1e {'switch': <lightwave_smart.lightwave_smart.LWRFFeature object at 0x0000021DB49C93A0>, 'protection': <lightwave_smart.lightwave_smart.LWRFFeature object at 0x0000021DB49C9AC0>, 'dimLevel': <lightwave_smart.lightwave_smart.LWRFFeature object at 0x0000021DB49C9B50>, 'identify': <lightwave_smart.lightwave_smart.LWRFFeature object at 0x0000021DB49C9BB0>}

  This is a light switch with the name `Garden Room` and the featureset id `5bc4d06e87779374d29d7d9a-5bc4d61387779374d29fdd1e` which we'll use in the example. The features will be explained below.



  Featuresets are accessed from the dictionary directly:


      print(link.featuresets['5bc4d06e87779374d29d7d9a-5bc4d61387779374d29fdd1e'].name)

  will give the name you assigned when you set up the device in the LW app.



  There are a number of methods to return info about the devices

  |Method|Usage|
  |---|---|
  |print(link.featuresets['5bc4d06e87779374d29d7d9a-5bc4d61387779374d29fdd1e'].is_switch())|Is it a socket?|
  |print(link.featuresets['5bc4d06e87779374d29d7d9a-5bc4d61387779374d29fdd1e'].is_light())|Light switches|
  |print(link.featuresets['5bc4d06e87779374d29d7d9a-5bc4d61387779374d29fdd1e'].is_climate())|Thermostats|
  |print(link.featuresets['5bc4d06e87779374d29d7d9a-5bc4d61387779374d29fdd1e'].is_cover())|Blinds / three-way relay|
  |print(link.featuresets['5bc4d06e87779374d29d7d9a-5bc4d61387779374d29fdd1e'].is_climate())|Thermostats|
  |print(link.featuresets['5bc4d06e87779374d29d7d9a-5bc4d61387779374d29fdd1e'].is_energy())|Energy meters|
  |print(link.featuresets['5bc4d06e87779374d29d7d9a-5bc4d61387779374d29fdd1e'].is_windowsensor())|Window sensor|
  |print(link.featuresets['5bc4d06e87779374d29d7d9a-5bc4d61387779374d29fdd1e'].is_hub())|LinkPlus Hub|
  |print(link.featuresets['5bc4d06e87779374d29d7d9a-5bc4d61387779374d29fdd1e'].is_gen2())|Generation 2 device?|
  |print(link.featuresets['5bc4d06e87779374d29d7d9a-5bc4d61387779374d29fdd1e'].reports_power())|Has power reporting|
  |print(link.featuresets['5bc4d06e87779374d29d7d9a-5bc4d61387779374d29fdd1e'].has_led())|Has an indicator LED that is configurable|



  This is how we find out the state of the device, and we will also use this information to control the device:

      print(link.featuresets['5bc4d06e87779374d29d7d9a-5bc4d61387779374d29fdd1e'].features)

  `features` is a dictionary of the features within a given featureset. The keys are the names of the features, the values are LWRFFeature objects.

  The LWRFFeature objects have properties: featureset, id, name, state. E.g.

      for i in link.featuresets['5bc4d06e87779374d29d7d9a-5bc4d61387779374d29fdd1e'].features.values():
          print(i.name, i.id, i.state)

  returns

      switch 5bc4d06e87779374d29d7d9a-28-3157334318+1 0
      protection 5bc4d06e87779374d29d7d9a-29-3157334318+1 0
      dimLevel 5bc4d06e87779374d29d7d9a-30-3157334318+1 59
      identify 5bc4d06e87779374d29d7d9a-72-3157334318+1 0

  showing the light is currently off (feature `switch`), the physical buttons are not locked (feature `protection`) and the brightness is set to 59% (feature `dimlevel`).



  The values of the featuresets are static and won't respond to changes in the state of the physical device (unless you set up a callback to handle messages from the server). If you want to make sure the values are up to date you can:

      link.update_featureset_states()

  Finally there are a handful of convenience methods if you just want to return devices of a particular type:

      print(link.get_switches())
      print(link.get_lights())
      print(link.get_climates())
      print(link.get_energy())


  Turning on a switch/light, turning off a switch/light or setting the brightness level for a light is as follows:

      link.turn_on_by_featureset_id("5bc4d06e87779374d29d7d9a-5bc4d61387779374d29fdd1e")
      link.turn_off_by_featureset_id("5bc4d06e87779374d29d7d9a-5bc4d61387779374d29fdd1e")
      link.set_brightness_by_featureset_id("5bc4d06e87779374d29d7d9a-5bc4d61387779374d29fdd1e", 60) #Brightness in percent

  Then there is one more method for a thermostat

      link.set_temperature_by_featureset_id(featureset_id, level)

  And some methods for covers (blinds)

      link.cover_open_by_featureset_id(featureset_id)
      link.cover_close_by_featureset_id(featureset_id)
      link.cover_stop_by_featureset_id(featureset_id)



  Finally, for any other features you might want to read or write the value of, you can access them directly. Note that the first option needs the **feature** unique id.

      link.read_feature(feature_id)

  or

      link.featuresets[featureset_id].features[featurename].state

  Writing:

      link.write_feature(feature_id, value)

  or

      link.write_feature_by_name(featureset_id, featurename, value)

  or

      await link.featuresets[featureset_id].features[featurename].set_state(value) #async only, see below



  This library is all using async programming, so notifications will only really work if your code is also async and is managing the event loop. Nonetheless, you can try the following for an idea of how to get a callback when an event is spotted by the server:

      import asyncio

      def test():
           print("this is a test callback")

      asyncio.get_event_loop().run_until_complete(link.async_register_callback(test))

  This will call the `test` function every time a change is detected to the state of one of the features. This is likely only useful if you then run `link.update_featureset_states()` to ensure the internal state of the object is consistent with your actual LW system.

  See example_async.py for a minimal client.



  The library is actually all built on async methods (the sync versions described above are just wrappers for the async versions)

      async_connect()
      async_get_hierarchy()
      async_update_featureset_states()
      async_write_feature(feature_id, value)
      async_read_feature(feature_id)
      async_turn_on_by_featureset_id(featureset_id)
      async_turn_off_by_featureset_id(featureset_id)
      async_set_brightness_by_featureset_id(featureset_id, level)
      async_set_temperature_by_featureset_id(featureset_id, level)



  Credit to Bryan Blunt for the original version https://github.com/bigbadblunt/lightwave2


pkgId: 5f004e5e808471a48a863c200a0e35bdd5520ddc538368d60387d95b61e78466
name: python-lightweaver-debuginfo
arch: aarch64
version: 0.13.0
epoch: 0
release: 1
summary: Debug information for package python-lightweaver
url: https://pypi.org/project/lightweaver/
rpm_license: MIT License
rpm_group: Development/Debug
rpm_buildhost: localhost
rpm_sourcerpm: python-lightweaver-0.13.0-1.src.rpm
location_href: Packages/python-lightweaver-debuginfo-0.13.0-1.aarch64.rpm
checksum_type: sha256
description:
  This package provides debug information for package python-lightweaver.
  Debug information is useful when developing applications that use this
  package or when debugging this package.


pkgId: d10b6f6336e84b1fd20ef80f08d0da9874e322f23b3ce173a2420e3807235c68
name: python-lightweaver-debugsource
arch: aarch64
version: 0.13.0
epoch: 0
release: 1
summary: Debug sources for package python-lightweaver
url: https://pypi.org/project/lightweaver/
rpm_license: MIT License
rpm_group: Development/Debug
rpm_buildhost: localhost
rpm_sourcerpm: python-lightweaver-0.13.0-1.src.rpm
location_href: Packages/python-lightweaver-debugsource-0.13.0-1.aarch64.rpm
checksum_type: sha256
description:
  This package provides debug sources for package python-lightweaver.
  Debug sources are useful when developing applications that use this
  package or when debugging this package.


pkgId: 320628372f841f7857b12fbe59d8097624ad033f894bbd9f8906a9576797f58e
name: python-lightweaver-help
arch: aarch64
version: 0.13.0
epoch: 0
release: 1
summary: Development documents and examples for lightweaver
url: https://pypi.org/project/lightweaver/
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-lightweaver-0.13.0-1.src.rpm
location_href: Packages/python-lightweaver-help-0.13.0-1.aarch64.rpm
checksum_type: sha256
description:
  **C. Osborne (University of Glasgow) & I. Milić (NSO/CU Boulder), 2019-2021**

  **MIT License**

  Lightweaver is an NLTE radiative transfer code in the style of [RH](https://github.com/ITA-Solar/rh).
  It is well validated against RH and also [SNAPI](https://github.com/ivanzmilic/snapi).
  The code is currently designed for plane parallel atmospheres, either 1D single columns (which can be parallelised over wavelength) or 1.5D parallel columns with `ProcessPool` or MPI parallelisation.
  There is also support for unpolarised radiative transfer in 2D atmospheres.

  Lightweaver is described in a [paper (including examples!)](https://arxiv.org/abs/2107.00475), and has [API documentation](https://goobley.github.io/Lightweaver/).

  Whilst the core numerics are implemented in C++, as much of the non-performance critical code as possible is implemented in Python, and the code currently only has a Python interface (provided through a Cython binding module).
  Other languages with a C/C++ interface could interact directly with this core, hopefully allowing it to be reused as needed in different projects.

  The aim of Lightweaver is to provide an NLTE Framework, rather than a "code".
  That is to say, it should be more malleable, and provide easier access to experimentation, with most forms of experimentation (unless one wants to play with formal solvers or iteration schemes), being available directly from python.
  Formal solvers that comply with the interface defined in Lightweaver can be compiled into separate shared libraries and then loaded at runtime.
  The preceding concepts are inspired by the popular python machine learning frameworks such as PyTorch and Tensorflow.



  For most users precompiled python wheels (supporting modern Linux, Mac, and Windows 10 systems) can be installed from `pip` and are the easiest way to get started with Lightweaver.
  Lightweaver requires python 3.8+, and it is recommended to be run inside a virtual environment using `conda`.
  In this case a new virtual environment can be created with:
  ```
  conda create -n Lightweaver python=3.8
  ```
  activate the environment:
  ```
  conda activate Lightweaver
  ```
  and Lightweaver can then be installed with
  ```
  python -m pip install lightweaver
  ```



  Whilst the above should work for most people, if you wish to work on the Lightweaver backend it is beneficial to have a source installation.
  This requires a compiler supporting C++17.
  The build is then run with `python3 -m pip install -vvv -e .`.
  The libraries currently produce a few warnings, but should not produce any errors.



  - [Paper](https://arxiv.org/abs/2107.00475).
  - [API documentation](https://goobley.github.io/Lightweaver/).
  - I suggest looking through [the samples repository](https://github.com/Goobley/LightweaverSamples) (in particular the `Simple*.py`) after the code description in the paper to gain an understanding of the basic functionality and interfaces.
  These samples are unfortunately not always up to date, but are a work in progress.
  - The [MsLightweaver repository](https://github.com/Goobley/MsLightweaver) contains a more "production grade" tool built on Lightweaver for reprocessing the time-dependent radiative output from RADYN simulations.
  This tool is currently undocumented, but has a relatively simple structure.

  Please contact me through this repository if difficulties are encountered.



  The [python implementation](https://github.com/jaimedelacruz/witt) of the Wittmann equation of state has been kindly provided J. de la Cruz Rodriguez.


pkgId: 2036270eca104c25c6e48e3d0b3e13faf8f3e8713f5b2801e43a9032e570f3cd
name: python-lightweight-genetic-algorithm-help
arch: noarch
version: 1.0.0
epoch: 0
release: 1
summary: Development documents and examples for lightweight-genetic-algorithm
url: https://github.com/JoseEliel/lightweight_genetic_algorithm
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-lightweight-genetic-algorithm-1.0.0-1.src.rpm
location_href: Packages/python-lightweight-genetic-algorithm-help-1.0.0-1.noarch.rpm
checksum_type: sha256
description:
  <img src="https://github.com/JoseEliel/lightweight_genetic_algorithm/raw/main/graphical_abstract.png" width="800"/>

  - [About](#about)
  - [Installation](#installation)
  - [Features](#features)
  - [User Guide](#user-guide)
      - [Overview](#overview)
      - [Example 1: Numerical Genes](#example-1-numerical-genes)
      - [Example 2: Categorical Genes](#example-2-categorical-genes)




  This package provides an intuitive, flexible, and efficient implementation of a genetic algorithm in Python. It is designed to be easy to use while still providing a high degree of flexibility for a wide range of optimization problems. The package is developed by Eliel Camargo-Molina and Jonas Wessén.

  > For detailed documentation please visit [Read the Docs](https://lightweight-genetic-algorithm.readthedocs.io/).




  The `lightweight-genetic-algorithm` Python module can be installed using `pip`:

  ```bash
  pip install lightweight-genetic-algorithm
  ```

  The source code is available at [github.com/JoseEliel/lightweight_genetic_algorithm](https://github.com/JoseEliel/lightweight_genetic_algorithm).



  The `lightweight-genetic-algorithm` Python module contains several features that allow the user to easily set up a GA for a wide range of optimization problems. These features include:

  - **Support for Numerical and Categorical Genes**: The package can handle optimization problems formulated either in terms of numerical or categorical genes.
  - **Multiple Crossover Methods**: The package provides four different crossover methods: `Between`, `Midpoint`, `Either Or`, and `None`.
  - **Multiple Mutation Modes**: The package includes three mutation modes for numerical genes: `additive`, `multiplicative`, `random`. For categorical genes, the algorithm assumes the `categorical` mutation mode.
  - **Diversity-Enhanced Selection**: The package uses the diversity-enhanced selection algorithm, allowing the algorithm to explore widely different regions in parameter space.
  - **Customizable Distance Measure**: The user can specify the distance function (used during selection) to be either `Euclidean` or `Dynamic` for numeric genes. For categorical genes, the Hamming distance is assumed. It is also possible for the user to supply their own distance function.
  - **Multiprocessing**: The package supports multiprocessing for parallel fitness evaluations, which can dramatically speed up the genetic algorithm for problems where the fitness function is computationally expensive.





  The primary class in this package is `GeneticAlgorithm`. A `GeneticAlgorithm` instance is created with the following inputs:

  - `fitness_function`: A function computing the fitness score of an individual. This function should receive an array of genes as its first input argument and return a single number. Additional arguments can be passed to the fitness function using the `fitness_function_args` argument.
  - `gene_ranges`: A list of tuples representing the range of each numeric gene. Each tuple should contain two numbers, with the first number being the lower bound and the second the upper bound. For categorical genes, `gene_ranges` should instead be a one-dimensional list of possible categories.
  - `number_of_genes` (only needed for categorical genes): The number of genes defining an individual. For numeric genes, the `number_of_genes` is inferred from the length of `gene_ranges`.
  - `fitness_function_args` (optional): Additional arguments to pass to the fitness function. This should be a tuple of arguments.
  - `crossover_method` (optional): The method used for crossover. Available options are `Between`, `Midpoint`, `Either Or`, and `None`. Default is `Between` for numeric genes. For categorical genes, only `Either Or` or `None` is possible.
  - `mutation_mode` (optional): The mode used for mutation. Options available are `additive`, `multiplicative`, `random`, and `categorical`. Default is `additive` for numeric genes and `categorical` for categorical genes.
  - `mutation_rate` (optional): The rate of mutation. The default is 1.0/`number_of_genes`. During crossover, each gene is mutated with probability `mutation_rate`.
  - `measure` (optional): Specifies the distance function between two points in the gene space. This argument can be a string variable (`Euclidean`, `Dynamic`, or `Hamming`) corresponding to the three distance measures discussed in this work. The `measure` argument can also be a user-defined distance function. The default is Euclidean distance for numeric genes and Hamming distance for categorical genes.
  - `use_multiprocessing` (optional): Whether to use multiprocessing for parallel fitness evaluations. Default is False.
  - `ncpus` (optional): The number of CPUs to use for multiprocessing. Default is the number of CPUs on the system minus one. This argument is used only when `use_multiprocessing` is True.
  - `selection_method` (optional): The method used for survivor selection. Available options are `Diversity Enhanced` and `Fitness Proportionate`. Default is `Diversity Enhanced`.
  - `output_directory` (optional): The directory where the output files are saved. Default is None. If specified, the algorithm saves the genes of the selected survivors in each generation to a file `<date-time>_survivors.npy` as a *numpy* array in the output directory. The average fitness and best fitness at each generation are saved to `<date-time>_fitness.txt`. A log file is saved to `log.txt` containing the output of the algorithm printed to the console.

  Once an instance of the `GeneticAlgorithm` class has been created, the genetic algorithm is executed using the `run` or `run_light` methods. These methods take the following arguments:

  - `n_generations`: The number of generations to run the genetic algorithm for.
  - `population_size`: The number of individuals in the population.
  - `fitness_threshold` (optional): The fitness threshold at which the genetic algorithm should stop. If this is set, the genetic algorithm will stop when the fitness of the best individual in the population is greater than or equal to the fitness threshold. Default is None.
  - `init_genes` (optional): An initial set of gene values for creating the initial population. Default is `None`.
  - `verbosity` (optional): The verbosity level for printing out messages. The options are `0` (silent), `1` (normal output), and `2` (detailed output). Default is `1`.

  The `run` method returns the full list of `Individual` instances across all generations, where each `Individual` object has attributes such as fitness and gene values.

  The `run_light` method is similar to `run` but returns only the gene values of all individuals across all generations.



  In this example, an individual represents a point in the xy-plane, and the fitness function takes the form:

  $$ f(x,y) = - A \left( \sqrt{x^2 + y^2} - R \right)^2, $$

  which has an extended maximum on the circle centered at the origin with radius $R$. The overall factor $A$ can be chosen to balance the diversity punishment and the fitness reward. The goal of the algorithm is to find a set of points that are evenly distributed along the entire circle.

  The complete Python code for this example is shown below. The genetic algorithm is run for 20 generations with a population size of 100 using the `Between` crossover method.

  ```python
  from lightweight_genetic_algorithm import GeneticAlgorithm


  def fitness_function(individual): # individual is x,y coordinates
      distance = (individual[0]**2 + individual[1]**2)**0.5
      R = 5 # Circle radius
      A = 5 # Overall fitness scaling
      fitness = -A*(distance - R)**2
      return fitness


  gene_ranges = [ (-10,10), (-10,10) ]


  ga = GeneticAlgorithm(fitness_function, gene_ranges, crossover_method='Between')
  all_populations = ga.run_light(n_generations=20, population_size=100)



  ```

  *Code for the categorical genes example. In this example, an individual represents coordinates of a point in the xy-plane. The fitness function has an extended maximum on a circle with radius 5.0. The genetic algorithm is run for 20 generations with a population size of 100 using the `Between` crossover method.*

  The resulting population after 20 generations is depicted below in Figure 1. In 20 generations, the individuals are evenly distributed along the circle.

  ![Figure 1: Initial and final populations for the numerical genes example.](https://github.com/JoseEliel/lightweight_genetic_algorithm/raw/main/Figure_A2.png)

  *Figure 1: The initial population is randomly distributed, while the final population is evenly distributed along the circle after 20 generations.*




  Next, we turn to a slightly more complex example involving categorical genes. In this example, we seek to construct an array of Lysine (K) and Glutamic acid (E) representing the amino-acid sequence of a model intrinsically disordered protein. The goal is to find a diverse set of sequences with a sequence charge decoration (SCD) parameter near a given target value.

  The net charge of a sequence is the sum of the charges of the amino acids with Lysine (K) having a charge of +1 and Glutamic Acid (E) having a charge of -1. The SCD parameter is a single number that can be calculated given a sequence of charges. The SCD parameter is a measure of the "charge blockiness" (i.e., an alternating sequence `EKEKEK...EK` has SCD ≈ 0 while a di-block sequence `EEEE...EEEKKKK...KKK` gives a large, negative SCD) and correlates well with both the radius-of-gyration of isolated chains and with the upper-critical temperature for phase separation in multi-chain systems.

  The complete Python code for this example is shown in below. In this example, an individual corresponds to a list of `E`'s and `K`'s representing the amino-acid sequence. This code showcases two additional important features of the `lightweight-genetic-algorithm` module: multiprocessing and the usage of additional arguments to the fitness function.

  ```python
  from lightweight_genetic_algorithm import GeneticAlgorithm


  def calculate_SCD(sequence):
      aa_charges = {'K':1, 'E':-1} # Amino acid electric charges
      charge_sequence = [ aa_charges[aa] for aa in sequence ]

      SCD = 0
      for a in range(len(charge_sequence)-1):
          for b in range(a+1,len(charge_sequence)):
              SCD += charge_sequence[a] * charge_sequence[b] * (b-a)**0.5
      SCD /= len(charge_sequence)
      return SCD


  def fitness_function(sequence, target_SCD):
      SCD = calculate_SCD(sequence)
      fitness = -(SCD - target_SCD)**2
      return fitness

  def main():
      
      gene_ranges = ['E', 'K'] # Glutamic acid (E, charge=-1) , Lysine (K, charge=+1)

      N = 50 # sequence length
      target_SCD = -10 # Target SCD value

      
      ga = GeneticAlgorithm(fitness_function, gene_ranges,
                          number_of_genes = N,
                          fitness_function_args = (target_SCD,),
                          use_multiprocessing = True)

      
      all_populations = ga.run_light(n_generations=50, population_size=100)

  if __name__ == '__main__':
      main()
  ```

  *Complete Python code for the categorical genes example, showcasing the usage of multiprocessing and additional fitness function arguments. The GA is run for 50 generations with a population size of 100. The final population of sequences is contained in `all_populations[-1]` which is a list of length 100 where each entry is a list of `E`'s and `K`'s representing the amino-acid sequence.*

  The net charges and SCD values for the initial and final populations are shown in Figure 2 below. Note that the SCD values are close to the target value of -10 while there is a wide range of net charges in the final population. This demonstrates the effect of the diversity-enhanced selection method.

  ![Figure 2: SCD values and net charges for initial and final populations of the categorical genes example.](https://github.com/JoseEliel/lightweight_genetic_algorithm/raw/main/Figure_A4.png)

  *Figure 2: The initial population has a wide range of SCD values and net charges, while the final population has SCD values close to the target value of -10.0.*


pkgId: 7f20d83a00cd18d96f38156325a7989ec758da9d967a002797997c09108b12cf
name: python-lightwood-help
arch: noarch
version: 24.12.3.0
epoch: 0
release: 1
summary: Development documents and examples for lightwood
url: https://pypi.org/project/lightwood/
rpm_license: GPL-3.0-only
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-lightwood-24.12.3.0-1.src.rpm
location_href: Packages/python-lightwood-help-24.12.3.0-1.noarch.rpm
checksum_type: sha256
description:
  <!--- badges here? --->

  Lightwood is an AutoML framework that enables you to generate and customize machine learning pipelines declarative syntax called JSON-AI.

  Our goal is to make the data science/machine learning (DS/ML) life cycle easier by allowing users to focus on **what** they want to do their data without needing to write repetitive boilerplate code around machine learning and data preparation. Instead, we enable you to focus on the parts of a model that are truly unique and custom.

  Lightwood works with a variety of data types such as numbers, dates, categories, tags, text, arrays and various multimedia formats. These data types can be combined together to solve complex problems. We also support a time-series mode for problems that have between-row dependencies.

  Our JSON-AI syntax allows users to change any and all parts of the models Lightwood automatically generates. The syntax outlines the specifics details in each step of the modeling pipeline. Users may override default values (for example, changing the type of a column) or alternatively, entirely replace steps with their own methods (ex: use a random forest model for a predictor). Lightwood creates a "JSON-AI" object from this syntax which can then be used to automatically generate python code to represent your pipeline.

  For details on how to generate JSON-AI syntax and how Lightwood works, check out the [Lightwood Philosophy](#Lightwood-Philosophy).



  Lightwood abstracts the ML pipeline into 3 core steps:

  (1) Pre-processing and data cleaning <br>
  (2) Feature engineering <br>
  (3) Model building and training <br>

  <p align="center">
  <img src="/assets/lightwood.png" alt="Lightwood internals" width="800"/>
  </p>


  For each column in your dataset, Lightwood will identify the suspected data type (numeric, categorical, etc.) via a brief statistical analysis. From this, it will generate a JSON-AI syntax.

  If the user keeps default behavior, Lightwood will perform a brief pre-processing approach to clean each column according to its identified data type. From there, it will split the data into train/dev/test splits.

  The `cleaner` and `splitter` objects respectively refer to the pre-processing and the data splitting functions.


  Data can be converted into features via "encoders". Encoders represent the rules for transforming pre-processed data into a numerical representations that a model can be used.

  Encoders can be **rule-based** or **learned**. A rule-based encoder transforms data per a specific set of instructions (ex: normalized numerical data) whereas a learned encoder produces a representation of the data after training (ex: a "\[CLS\]" token in a language model).

  Encoders are assigned to each column of data based on the data type; users can override this assignment either at the column-based level or at the data-type based level. Encoders inherit from the `BaseEncoder` class.


  We call a predictive model that intakes *encoded* feature data and outputs a prediction for the target of interest a `mixer` model. Users can either use Lightwood's default mixers or create their own approaches inherited from the `BaseMixer` class.

  We predominantly use PyTorch based approaches, but can support other models.



  We invite you to check out our [documentation](https://mindsdb.github.io/lightwood/) for specific guidelines and tutorials! Please stay tuned for updates and changes.


  Lightwood works with `pandas.DataFrames`. Once a DataFrame is loaded, defined a "ProblemDefinition" via a dictionary. The only thing a user needs to specify is the name of the column to predict (via the key `target`).

  Create a JSON-AI syntax from the command `json_ai_from_problem`. Lightwood can then use this object to *automatically generate python code filling in the steps of the ML pipeline* via `code_from_json_ai`.

  You can make a `Predictor` object, instantiated with that code via `predictor_from_code`.

  To train a `Predictor` end-to-end, starting with unprocessed data, users can use the `predictor.learn()` command with the data.

  ```python
  import pandas as pd
  from lightwood.api.high_level import (
      ProblemDefinition,
      json_ai_from_problem,
      code_from_json_ai,
      predictor_from_code,
  )

  if __name__ == '__main__':
      
      df = pd.read_csv("https://raw.githubusercontent.com/mindsdb/benchmarks/main/benchmarks/datasets/hdi/data.csv"
      )

      
      pdef = ProblemDefinition.from_dict(
          {
              "target": "Development Index",  # column you want to predict
          }
      )

      
      json_ai = json_ai_from_problem(df, problem_definition=pdef)

      
      

      
      code = code_from_json_ai(json_ai)

      
      

      
      predictor = predictor_from_code(code)

      
      predictor.learn(df)

      
      test_df = predictor.split(predictor.preprocess(df))["test"]
      preds = predictor.predict(test_df).iloc[:10]
      print(preds)
  ```



  Lightwood supports user architectures/approaches so long as you follow the abstractions provided within each step.

  Our [tutorials](https://mindsdb.github.io/lightwood/tutorials.html) provide specific use cases for how to introduce customization into your pipeline. Check out "custom cleaner", "custom splitter", "custom explainer", and "custom mixer". Stay tuned for further updates.




  You can install Lightwood as follows:

  ```python
  pip3 install lightwood
  ```
  >Note: depending on your environment, you might have to use pip instead of pip3 in the above command.

  However, we recommend creating a python virtual environment.


  - Python version should be in the range >=3.8, < 3.11
  - Clone lightwood
  - `cd lightwood && pip install -r requirements.txt && pip install -r requirements_image.txt`
  - Add it to your python path (e.g. by adding `export PYTHONPATH='/where/you/cloned/lightwood':$PYTHONPATH` as a newline at the end of your `~/.bashrc` file)
  - Check that the `unittest`s are passing by going into the directory where you cloned lightwood and running: `python -m unittest discover tests`

  > If `python` default to python2.x on your environment use `python3` and `pip3` instead

  Currently, the preferred environment for working with lightwood is visual studio code, a very popular python IDE. However, any IDE should work. While we don't have guides for those, please feel free to use the following section as a template for VSCode, or to contribute your own tips and tricks to set up other IDEs.



  * Install and enable setting sync using github account (if you use multiple machines)
  * Install pylance (for types) and make sure to disable pyright
  * Go to `Python > Lint: Enabled` and disable everything *but* flake8
  * Set `python.linting.flake8Path` to the full path to flake8 (which flake8)
  * Set `Python › Formatting: Provider` to autopep8
  * Add `--global-config=<path_to>/lightwood/.flake8` and `--experimental` to `Python › Formatting: Autopep8 Args`
  * Install live share and live share whiteboard


  <!--- CONTRIBUTING.md ---->



  We love to receive contributions from the community and hear your opinions! We want to make contributing to Lightwood as easy as it can be.

  Being part of the core Lightwood team is possible to anyone who is motivated and wants to be part of that journey!

  Please continue reading this guide if you are interested in helping democratize machine learning.



  * Report a bug
  * Improve documentation
  * Solve an issue
  * Propose new features
  * Discuss feature implementations
  * Submit a bug fix
  * Test Lightwood with your own data and let us know how it went!


  In general, we follow the ["fork-and-pull"](https://docs.github.com/en/github/collaborating-with-pull-requests/getting-started/about-collaborative-development-models#fork-and-pull-model) git workflow. Here are the steps:

  1. Fork the Lightwood repository
  2. Make changes and commit them
  3. Make sure that the CI tests pass. You can run the test suite locally with `flake8 .` to check style and `python -m unittest discover tests` to run the automated tests. This doesn't guarantee it will pass remotely since we run on multiple envs, but should work in most cases.
  4. Push your local branch to your fork
  5. Submit a pull request from your repo to the `main` branch of `mindsdb/lightwood` so that we can review your changes. Be sure to merge the latest from main before making a pull request!

  > Note: You will need to sign a CLI agreement for the code since lightwood is under a GPL license.


  We use GitHub issues to track bugs and features. Report them by opening a [new issue](https://github.com/mindsdb/lightwood/issues/new/choose) and fill out all of the required inputs.


  Pull request (PR) reviews are done on a regular basis. **If your PR does not address a previous issue, please make an issue first**.

  If your change has a chance to affecting performance we will run our private benchmark suite to validate it.

  Please, make sure you respond to our feedback/questions.


  If you have additional questions or you want to chat with MindsDB core team, you can join our community: <a href="https://join.slack.com/t/mindsdbcommunity/shared_invite/zt-o8mrmx3l-5ai~5H66s6wlxFfBMVI6wQ" target="_blank"><img src="https://img.shields.io/badge/slack-@mindsdbcommunity-blueviolet.svg?logo=slack " alt="MindsDB Community"></a>.

  To get updates on Lightwood and MindsDB’s latest announcements, releases, and events, sign up for our [Monthly Community Newsletter](https://mindsdb.com/newsletter/?utm_medium=community&utm_source=github&utm_campaign=lightwood%20repo).

  Join our mission of democratizing machine learning and allowing developers to become data scientists!


  Please note that this project is released with a [Contributor Code of Conduct](https://github.com/mindsdb/lightwood/blob/main/CODE_OF_CONDUCT.md). By participating in this project, you agree to abide by its terms.




  <a href="https://github.com/mindsdb/lightwood/graphs/contributors">
    <img src="https://contributors-img.web.app/image?repo=mindsdb/lightwood" />
  </a>



  * [Lightwood License](https://github.com/mindsdb/lightwood/blob/master/LICENSE)


pkgId: 6ebf2b1e5e1b5e6be3d1f9b3dc3737e9f6cee2e57e339bc5565464248bf26a02
name: python-ligo-followup-advocate-help
arch: noarch
version: 1.2.11
epoch: 0
release: 1
summary: Development documents and examples for ligo-followup-advocate
url: https://pypi.org/project/ligo-followup-advocate/
rpm_license: GPL-2+
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-ligo-followup-advocate-1.2.11-1.src.rpm
location_href: Packages/python-ligo-followup-advocate-help-1.2.11-1.noarch.rpm
checksum_type: sha256
description:
  This package provides tools for LIGO/Virgo/KAGRA follow-up advocates to assist
  in tasks such as drafting astronomical bulletins for gravitational-wave
  detections.


pkgId: 4a5b3ca537ee82aade0ad1145640509ccd9f2c69aaf3ce4d870a1e503e9a9b48
name: python-likeprocessing-help
arch: noarch
version: 0.1.7.5.4
epoch: 0
release: 1
summary: Development documents and examples for likeprocessing
url: https://pypi.org/project/likeprocessing/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-likeprocessing-0.1.7.5.4-1.src.rpm
location_href: Packages/python-likeprocessing-help-0.1.7.5.4-1.noarch.rpm
checksum_type: sha256
description:
  **Dans pycharm :** \
  CTRL+ALT+s, puis choisir project -> python interpreter et + puis likeprocessing

  **dans le terminal :** \
  pip install likeprocessing




  Le programme doit contenir deux fonctions, setup() et draw(), et l'exécution est lancée à l'aide de l'instruction run(globals()).

  Lorsque l'on exécute l'instruction run(globals()), la fonction setup() est exécutée une fois :


  ```
  from likeprocessing.processing import *
  def setup():
      createCanvas(800,600)
      
  ```


  Cette fonction permet de définir les dimensions de la fenêtre de tracé, et quelques paramètres initiaux. Les valeurs données aux paramètres de la fonction **createCanvas() ** sont affectées automatiquement à deux variables systèmes : **width** pour le premier paramètre et **height** pour le second. Un troisième paramètre **resizable** optionnel permet d'offrir la possibilité de redimensionner la fenêtre avec la souris  On peut récupérer les valeurs de **width** et **height** grâce au fonction **width()** et **height()**

  Puis la fonction **draw()** est ensuite exécutée en boucle, après l'exécution de **setup()**:


  ```
  def draw():
      
  ```


  Elle contient des instructions qui seront exécutées avec une fréquence réglable, permettant de modifier le contenu de la fenêtre et de créer des contenus statiques ou des animations.

  L'instruction **stop()** met fin à l'exécution de la boucle :


  ```
  def compute():
      
  ```


  Cette fonction n'est pas obligatoire. Elle permet d'éviter de trop surcharger la fonction **draw()** en réservant celle-ci aux instructions de dessins. La fonction **compute()** si elle existe est insérée dans la boucle et est exécutée avant la fonction **draw()**





  ```
  from likeprocessing.processing import *

  def setup():
     createCanvas(400,200)
     background("grey")

  def draw():
     pass

  run(globals())
  ```






  <table>
    <tr>
     <td><strong>Fonctions</strong>
     </td>
     <td><strong>description</strong>
     </td>
    </tr>
    <tr>
     <td>width(), height()
     </td>
     <td>Dimensions de la zone de dessin. Les valeurs de width et height sont définies par les paramètres de la fonction createCanvas().
     </td>
    </tr>
    <tr>
     <td>createCanvas()
     </td>
     <td> La fonction createCanvas(largeur,hauteur) permet de dimensionner la fenêtre de l'application. En plus de la largeur et de la hauteur on peut ajouter un troisieme paramètre à True pour que la fenêtre puisse être redimensionnée. (ex createCanvas(400,300,True).
       <BR>On peut aussi changer l'icone de la fenêtre avec le paramètre facultatif icone :<br>
       createCanvas(400,300,True,icone="image.png")
     </td>
    </tr>
    <tr>
     <td>title("mon titre")
     </td>
     <td> La fonction title("mon titre") permet de changer le titre de la fenêtre par mon titre
     </td>
    </tr>
    <tr>
     <td>set_icone("icone.jpg")
     </td>
     <td> La fonction set_icone() permet de changer l'icône de la fenêtre
     </td>
    </tr>
  </table>






  <table>
    <tr>
     <td><strong>Fonctions</strong>
     </td>
     <td><strong>description</strong>
     </td>
    </tr>
    <tr>
     <td>frameCount()
     </td>
     <td>Nombre d'images affichées depuis le démarrage du programme.
     </td>
    </tr>
    <tr>
     <td>frameRate() \
  getFrameRate()
     </td>
     <td>Renvoie le nombre d'images affichées chaque seconde.
     </td>
    </tr>
    <tr>
     <td>frameRate(valeur) \
  setFrameRate(valeur)
     </td>
     <td>Spécifie le nombre d'images à afficher chaque seconde.
     </td>
    </tr>
    <tr>
     <td>noLoop()
     </td>
     <td>Si cette instruction est présente dans la fonction setup la fonction draw sera exécutée une seule fois. Si cette instruction est présente dans la fonction draw, les instructions de la fonction draw en cours sont exécutées (il n'y a pas d'interruption) mais celle-ci ne sera pas appelée à nouveau.
     </td>
    </tr>
    <tr>
     <td>loop()
     </td>
     <td>Relance l'exécution en boucle de draw().
     </td>
    </tr>
  </table>









  <table>
    <tr>
     <td><strong>syntaxe</strong>
     </td>
     <td><strong>description</strong>
     </td>
    </tr>
    <tr>
     <td>'red'
     </td>
     <td>nom de couleur
     </td>
    </tr>
    <tr>
     <td>120
     </td>
     <td>niveau de gris : 0 - 255
     </td>
    </tr>
    <tr>
     <td>(100, 125, 255)
     </td>
     <td>couleur r, v, b (décimal) : 0 - 255
     </td>
    </tr>
    <tr>
     <td>'#2aff95'
     </td>
     <td>couleur r, v, b (hexadécimal) : 00 - ff
     </td>
    </tr>
  </table>






  <table>
    <tr>
     <td><strong>Fonctions</strong>
     </td>
     <td><strong>description</strong>
     </td>
    </tr>
    <tr>
     <td>background(couleur)
     </td>
     <td>Définit la couleur d'arrière-plan de la zone de dessin (255 par défaut).
     </td>
    </tr>
    <tr>
     <td>set_background_image(image: Image)
     </td>
     <td>Définit l'image d'arrière-plan de la zone de dessin.
     </td>
    </tr>
    <tr>
     <td>get_background_image()
     </td>
     <td>Récupère l'image d'arrière-plan de la zone de dessin.
     </td>
    </tr>
    <tr>
     <td>save_background():
     </td>
     <td>fait une copie du contenu de la fenêtre et le sauvegarde dans l'image d'arrière plan.
     </td>
    </tr>
    <tr>
     <td>fill(couleur=None)
     </td>
     <td>Définit la couleur de remplissage des formes (255 par défaut) et réactive le remplissage des formes. Sans paramètre seul le remplissage est activé (utile après un noFill()). Retourne la valeur précédente du remplissage.
     </td>
    </tr>
    <tr>
     <td>fill_mouse_on(couleur: any):
     </td>
     <td>initialise la couleur de fond des figures qui affichera quand la souris est dessus.
     </td>
    </tr>
    <tr>
     <td>get_fill()
     </td>
     <td>Retourne la couleur de fond actuelle
     </td>
    </tr>
    <tr>
     <td>noFill()
     </td>
     <td>Désactive la couleur de remplissage.
     </td>
    </tr>
    <tr>
     <td>stroke(couleur)
     </td>
     <td>Définit la couleur du tracé des bords des formes et des lignes("black" par défaut). Retourne la valeur précédente de la couleur.
     </td>
    </tr>
    <tr>
     <td>get_stroke()
     </td>
     <td>retourne la couleur des bords actuelle
     </td>
    </tr>
    <tr>
     <td>noStroke()
     </td>
     <td>Désactive le tracé du contour des figures. Retourne la valeur précédente de la couleur.
     </td>
    </tr>
    <tr>
     <td>save_fill_stroke()
     </td>
     <td>Sauvegarde les paramètres fill et stroke
     </td>
    </tr>
    <tr>
     <td>restore_fill_stroke()
     </td>
     <td>recharge les paramètres fill et stroke précédemment sauvegardé avec <strong>save_fill_stroke</strong>
     </td>
    </tr>
  </table>


  Si **noFill()** et **noStroke() **sont exécutées en même temps, rien n'est tracé dans la zone de dessin.







  L'origine du repère est située en haut à gauche. Les abscisses augmentent de gauche à droite, les ordonnées augmentent de haut en bas.



  ![](./images/image1.png)



  <table>
    <tr>
     <td><strong>fonctions</strong>
     </td>
     <td><strong>description</strong>
     </td>
    </tr>
    <tr>
     <td>point(x, y)
     </td>
     <td>Trace un point de coordonnées (x, y). carré de 2x2 pixels
     </td>
    </tr>
    <tr>
     <td>line(x1, y1, x2, y2)
     </td>
     <td>Trace un segment reliant les deux points de coordonnées (x1, y1) et (x2, y2).
     </td>
    </tr>
    <tr>
     <td>ellipse(x, y, largeur, hauteur)
     </td>
     <td>Tracer une ellipse dont le centre a pour coordonnées (x, y) et dont la largeur et la hauteur prennent les valeurs fixées.
     </td>
    </tr>
    <tr>
     <td>circle(x, y, diametre)
     </td>
     <td>Trace un cercle dont le centre a pour coordonnées (x, y) et dont le diamètre prend la valeur fixée. Idem ellipse((x, y, diametre, diametre)
     </td>
    </tr>
    <tr>
     <td>arc(x,y,largeur,hauteur,,angleDebut, angleFin)
     </td>
     <td>Créer une portion d'ellipse type part de tarte qui pourra être rempli entre les points repérés par les angles angleDébut et angleFin (unité courante). x et y sont les coordonnées du centre du cercle.
     </td>
    </tr>
    <tr>
     <td>circle_arc(x,y,rayon,angleDebut, angleFin)
     </td>
     <td>idem arc mais à partir d'un disque
     </td>
    </tr>
    <tr>
     <td>ellipseMode(corners_center: str)
     </td>
     <td>Définie la position des points x et y des fonctions basées sur ellipse. par défaut : "corners" x et y sont les coordonnées du point en haut à gauche du rectangle dans lequel est inscrit l'ellipse. si les paramètre est "center" x et y représente le centre du rectangle. Retourne la valeur précédente du mode.
     </td>
    </tr>
    <tr>
     <td>rect(x, y, largeur, hauteur)
     </td>
     <td>Créer un rectangle aux coordonnées x,y de largeur largeur et de hauteur. Si rectMode('center') x et y sont les coordonnées du centre du rectangle. Si rectMode('corners') x,y sont les coordonnées du coin haut gauche. Le rectangle est rempli par la couleur définie par fill(couleur). Si le paramètre image est renseigné (image= ...) le fond du rectangle sera occupé pas l'image retaillée aux dimensions du rectangle sauf si largeur et/ou hauteur sont nulles (ou non renseignées). largeur et/ou hauteur seront alors celles de l'image. Les paramètres <strong>allign_h </strong>(left, center et right) et  <strong>allign_v</strong> (top,center et bottom) permettent d'aligner l'image dans un cadre plus grand qu'elle.
     </td>
    </tr>
    <tr>
     <td>square(x, y, cote)
     </td>
     <td>Trace un carré dont le sommet en haut à gauche a pour coordonnées (x, y) et dont le côté prend la valeur fixée. fonctionnement idem rectangle
     </td>
    </tr>
    <tr>
     <td>rectMode(corners_center: str)
     </td>
     <td>Définie la position des points x et y des fonctions basées sur rect. par défaut : "corners" x et y sont les coordonnées du point en haut à gauche du rectangle. si les paramètre est "center" x et y représente le centre du rectangle. Retourne la valeur précédente du mode.
     </td>
    </tr>
    <tr>
     <td>triangle(x1, y1, x2, y2, x3, y3)
     </td>
     <td>Trace un triangle dont les trois sommets ont pour coordonnées (x1, y1), (x2, y2), et (x3, y3).
     </td>
    </tr>
    <tr>
     <td>quad(x1, y1, x2, y2, x3, y3, x4, y4)
     </td>
     <td>Trace un quadrilatère dont les quatre sommets ont pour coordonnées (x1, y1), (x2, y2), (x3, y3) et (x4, y4).
     </td>
    </tr>
    <tr>
     <td>k_line(points)
     </td>
     <td>trace un ligne brisée à partir d'une liste de points [[1,2],[5,6],[8,3],.....]. (nb_point = nb_segments + 1)
     </td>
    </tr>
  </table>






  <table>
    <tr>
     <td><strong>fonctions</strong>
     </td>
     <td><strong>description</strong>
     </td>
    </tr>
    <tr>
     <td>strokeWeight(epaisseur)
     </td>
     <td>Définit l'épaisseur du tracé en pixels (par défaut : 1 pixel). Retourne la valeur précédente de la largeur du trait
     </td>
    </tr>
    <tr>
     <td>noStroke()
     </td>
     <td>Désactive le tracé du contour des figures en mettant la largeur du bord à 0. Retourne la valeur précédente de la largeur.
     </td>
    </tr>
    <tr>
     <td>stroke(couleur)
     </td>
     <td>Définit la couleur du tracé des bords des formes et des lignes ("black" par défaut). Si aucune valeur n'est passée, celle-ci retourne la couleur actuelle. Retourne la valeur précédente de la couleur.
     </td>
    </tr>
  </table>





  Les paramètres optionnels sont passés directement dans la fonction et ne concernent que celle-ci:

  fill, no_fill, fill_mouse_on, stroke, stroke_weight, command, fill_mousse_on, name. Pour les rectangles nous avons en plus image et border_rounded

  exemple :


  ```
  triangle(20, 10, 50, 15, 40, 70, fill = "green", fill_mouse_on="yellow", stroke_weight=3)
  rect(10,100,100,50,fill = "red", image=loadImage("image.jpg")) # rectangle avec une image
  rect(150,100,100,60,fill= "blue",border_rounded = 10) # rectangle au coins arrondis avec un rayon de 10px
  ```


  l'ajout de **command = ma_fonction** ou **command_mouse_over = ma_fonction** au paramètre **fill_mouse_on="couleur"** permet d'exécuter la fonction **ma_fonction()**. Si l'on veut attribuer **ma_fonction** à plusieurs formes il est possible d'ajouter le paramètre **name = valeur**. Dans ce cas, la fonction **ma_fonction(name)** sera exécutée . Il faudra créer impérativement soit :

  def ma_fonction():

      pass

  ou

  def ma_fonction(nom):

      pass

  Remarque:<br>
  avec le paramètre command exécute la fonction si la forme est cliquée alors qu'avec command_mous_over elle sera exécutée simplement si la souris est sur la forme.<br>
  Si les deux paramètres sont présents les deux fonctions sont exécutées.




  <table>
    <tr>
     <td><strong>fonctions</strong>
     </td>
     <td><strong>description</strong>
     </td>
    </tr>
    <tr>
     <td>text(chaine, x, y)
     </td>
     <td>Affiche la chaîne à la position (x, y) dans une boite ajustée. couleur, largeur bord et couleur bord de la boite idem formes. Accepte les paramètres optionnels
     </td>
    </tr>
    <tr>
     <td>text(chaine, x, y, largeur, hauteur)
     </td>
     <td>Affiche la chaîne à la position (x, y) dans une boite de dimensions largeur x hauteur. couleur, largeur bord et couleur bord de la boite idem formes. largeur et hauteur sont optionnels
     </td>
    </tr>
    <tr>
     <td>text_button(texte_bouton, x, y, largeur, hauteur,command=ma_fonction, name="nom")
     </td>
     <td>Affiche un bouton à la position (x, y) dans une boite de dimensions largeur x hauteur. couleur, largeur bord et couleur bord de la boite idem formes. largeur et hauteur sont optionnels.command est une fonction qui sera exécutée si le bouton est cliqué. name est optionnel et permet d'attribuer un nom au bouton. Si name est présent, la fonction command sera exécutée avec le paramètre name (optionnel).
     </td>
    </tr>
    <tr>
     <td>textAlign(alignement_horizontal)
  <p>
  textAlign(alignement_horizontal, alignement_vertical)
     </td>
     <td>Spécifie l'alignement horizontal parmi LEFT, CENTER, et RIGHT et l'alignement vertical parmi TOP, BOTTOM, CENTER, et BASELINE
     </td>
    </tr>
    <tr>
     <td>textFont(police)
  <p>
  textFont(police, taille)
     </td>
     <td>Spécifie la police de caractères et éventuellement sa taille. Retourne la police et la taille précédente
     </td>
    </tr>
    <tr>
     <td>textSize(taille)
     </td>
     <td>Spécifie la taille de la police de caractères. Retourne la taille précédente de la police
     </td>
    </tr>
    <tr>
     <td>textStyle(style)
     </td>
     <td>Spécifie le style parmi NORMAL, ITALIC, BOLD et BOLDITALIC
     </td>
    </tr>
    <tr>
     <td>textWidth(chaine)
     </td>
     <td>Largeur en pixels de l'affichage de chaîne, dans la police et taille actuelles
     </td>
    </tr>
  </table>





  Les paramètres optionnels sont passés directement dans la fonction et ne concernent que celle-ci:

  la fonction text possèdes elle aussi des paramètres optionnels qui ne concernent que la fonction en cours : \
  **font, font_size, font_color** qui permettent  de définir la police, la taille des caractères ainsi que la couleur de ceux-ci.

  **allign_h et allign_v** permettent de positionner le texte dans la boîte de texte comme **textAllign()**.

  **padx et pady** permettent de créer une marge autour du texte (valeur en pixels)

  **margin_left, margin_right, margin_top, margin_bottom** permettent de créer de décaler le texte (valeur en pixels) \
  **margin_left** décale le texte vers la droite si align_h="left" \
  **margin_right** décale le texte vers la gauche si align_h="right" \
  **margin_top** décale le texte vers le bas si align_v="top" \
  **margin_bottom** décale le texte vers le haut si align_v="bottom"

  exemple :


  ```
  text("salut les amis",20,30,300,allign_h="center",font="arial",font_size=48,fontTools="green",pady=10)
  ```



  Ce code va afficher "salut les amis" dans un cadre de longueur 300 à la position x=20 et y=30. La hauteur du cadre est calculée en fonction de la hauteur du texte (font_size). **pady=10** ajoute 10 pixels au dessus et en dessous du texte. **Si la hauteur du cadre est donnée, si celle-ci est trop petite le texte sortira du cadre.**








  <table>
    <tr>
     <td><strong>fonctions</strong>
     </td>
     <td><strong>description</strong>
     </td>
    </tr>
    <tr>
     <td>key()
     </td>
     <td>état des touches du clavier (list)
     </td>
    </tr>
    <tr>
     <td>keyCode()
     </td>
     <td>Code de la dernière touche appuyée.
     </td>
    </tr>
    <tr>
     <td>keyIsPressed()
  <p>
  isKeyPressed()
     </td>
     <td>Vaut True lorsqu'une touche du clavier est appuyée et False sinon.
     </td>
    </tr>
    <tr>
     <td>keyIsDown(code)
  <p>
  keyIsDown(touche)
     </td>
     <td>Vaut True si la touche concernée est appuyée et False sinon.
     </td>
    </tr>
  </table>






  <table>
    <tr>
     <td><strong>fonctions</strong>
     </td>
     <td><strong>description</strong>
     </td>
    </tr>
    <tr>
     <td>mouseX(), mouseY()
     </td>
     <td>Coordonnées du pointeur de la souris
     </td>
    </tr>
    <tr>
     <td>mouseXY()
     </td>
     <td>Coordonnées du pointeur de la souris sous forme de tuple
     </td>
    </tr>
    <tr>
     <td>mouseIsPressed()
     </td>
     <td>Vaut True si la souris est cliquée, et False sinon.
     </td>
    </tr>
    <tr>
     <td>fill_mouse_on(couleur:str)
     </td>
     <td>Change la couleur des formes quand on passe la souris dessus. Non actif par défaut.
     </td>
    </tr>
    <tr>
     <td>noFill_mouse_on()
     </td>
     <td>annule l'effet de fill_mouse_on()
     </td>
    </tr>
    <tr>
     <td>mouse_click_down()
     </td>
     <td>renvoie True lors du passage de relâché à appuyé du bouton de la souris.
     </td>
    </tr>
    <tr>
     <td>mouse_click_up()
     </td>
     <td>renvoie True lors du passage de appuyé à relâché du bouton de la souris.
     </td>
    </tr>
    <tr>
     <td>mouse_click()
     </td>
     <td>idem mouseIsPressed()
     </td>
    </tr>
    <tr>
     <td>mouse_wheel_state()
     </td>
     <td>retourne 1 si la roulette de la souris est tournée vers l'avant, -1 vers l'arrière et 0 si elle est immobile.
     </td>
    </tr>
  </table>









  <table>
    <tr>
     <td><strong>fonctions</strong>
     </td>
     <td><strong>description</strong>
     </td>
    </tr>
    <tr>
     <td>angleMode(mode_angle:str)
     </td>
     <td>Définit l'unité de mesure des angles. \
   'rad' les angles des fonctions trigonométriques seront pris comme des radians (défaut) \
   'deg' les angles des fonctions trigonométriques seront pris comme des degrés \
  'grd' les angles des fonctions trigonométriques seront pris comme des grades \
  Une exception est levée en cas d'erreur de paramètre
  <p>
  si mode_angle == "" la valeur de mode est retournée (str)
     </td>
    </tr>
    <tr>
     <td>cos(), sin(), tan(), acos(),asin(),atan(),atan2()
     </td>
     <td>Fonctions trigonométriques usuelles l'unité considérée sera celle choisie avec angleMode(). atan2 : même fonctionnement que la fonction math.atan2 mais l'unité de l'angle retourné dépend  de angleMode()
     </td>
    </tr>
    <tr>
     <td>degrees(mesure) \
  radians(mesure) \
  grades(mesure)
     </td>
     <td>Convertit une mesure d'angle en degrés, en radians ou en grades. l'unité de mesure dépend de angleMode().
     </td>
    </tr>
    <tr>
     <td>HALF_PI, PI, QUARTER_PI, TWO_PI
     </td>
     <td>Constantes permettant respectivement d'approcher les valeurs de π/2, π, π/4, 2π
     </td>
    </tr>
  </table>






  <table>
    <tr>
     <td><strong>fonctions</strong>
     </td>
     <td><strong>description</strong>
     </td>
    </tr>
    <tr>
     <td>dist(x1,y1,x2,y2)
     </td>
     <td>retourne la distance entre deux points
     </td>
    </tr>
    <tr>
     <td>midPoint(x1, y1, x2, y2)
     </td>
     <td>retourne le milieu d'un segment défini par deux points
     </td>
    </tr>
  </table>






  <table>
    <tr>
     <td><strong>fonctions</strong>
     </td>
     <td><strong>description</strong>
     </td>
    </tr>
    <tr>
     <td>loadImage(chemin)
     </td>
     <td>Charge une image à partir d'un chemin et crée un objet Image. Si nécessaire, l'image peut être préchargée en plaçant l'appel à la fonction loadImage en debut de programme.
     </td>
    </tr>
    <tr>
     <td>loadImages((liste_images:list[str],sens=0) ->Image:
     </td>
     <td>Retourne une surface qui est l'assemblage de toutes les images
      de la liste. Si sens = 1 les images sont assemblées verticalement
      et horizontalement si sens =0. Ex: loadImages(["image1.png","image2.jpg"])
     </td>
    </tr>
    <tr>
     <td>background(Image)
     </td>
     <td>Affiche une Image en fond d'écran
     </td>
    </tr>
    <tr>
     <td>image(image, x, y)
     </td>
     <td>Affiche une Image en plaçant le pixel en haut à gauche au point de coordonnées (x, y) dans la zone de dessin.
     </td>
    </tr>
    <tr>
     <td>copy_image(picture: Image, rect=None) -> Image
     </td>
     <td>retourne une copie de picture ou une partie de picture au dimensions de rect
     </td>
    </tr>
    <tr>
     <td>get_pixel_color(picture: Image, pos: tuple) -> tuple
     </td>
     <td>retourne la valeur de la couleur d'un pixel d'une image (picture)
  <p>
  sous la forme d'un tuple
     </td>
    </tr>
    <tr>
     <td>resize_image(picture:Image,size : tuple
     </td>
     <td>retourne une image redimensionné en fonction de size : (largeur,hauteur)
     </td>
    </tr>
  </table>






  <table>
    <tr>
     <td><strong>fonctions</strong>
     </td>
     <td><strong>description</strong>
     </td>
    </tr>
    <tr>
     <td>translate(x,y)
     </td>
     <td>applique une translation à toutes les fonctions de dessin et d'image. x et y sont des valeurs relatives qui s'ajoutent aux translations précédentes.
  <p>
  La translation est remise à zéro avant chaque exécution de la fonction draw().
     </td>
    </tr>
    <tr>
     <td>get_translate()
     </td>
     <td>retourne la valeur de la translation sous la forme d'un tuple (x,y)
     </td>
    </tr>
    <tr>
     <td>init_translate()
     </td>
     <td>Force la remise à zéro de la translation. (A utiliser dans la fonction draw() en cas de besoin
     </td>
    </tr>
    <tr>
     <td>rotate(angle,axis)
     </td>
     <td>applique une rotation &lt;angle> par rapport à &lt;axis>. à toutes les fonctions de dessin et d'image. angle est une valeur absolue. Par défaut axis vaut (0,0). Cette fonction retourne la valeur précédente prise par la fonction sous la forme d'un tuple.
     </td>
    </tr>
    <tr>
     <td>flip_h(axe_h)
     </td>
     <td>entraîne une symétrie horizontale par rapport à la droite y = axe_h
     </td>
    </tr>
    <tr>
     <td>flip_v(axe_v)
     </td>
     <td>entraîne une symétrie verticale par rapport à la droite x = axe_v
     </td>
    </tr>
  </table>







  <table>
    <tr>
     <td><strong>fonctions</strong>
     </td>
     <td><strong>description</strong>
     </td>
    </tr>
    <tr>
     <td>t=Tempo(duree_ms)
     </td>
     <td>t=Tempo(1000) créer un objet de temporisation t de durée 1000 ms qui se relance indéfiniment.
      <img src="./images/image2.png">
     </td>
    </tr>
    <tr>
     <td>t.fin()
     </td>
     <td>renvoie True lorsque la temporisation est terminée. Pour notre exemple au bout de 500 ms.
     </td>
    </tr>
    <tr>
     <td>t.is_on()
     </td>
     <td>renvoie True si la temporisation est à on.
     </td>
    </tr>
    <tr>
     <td>t.is_off()
     </td>
     <td>renvoie True si la temporisation est à off.
     </td>
    </tr>
    <tr>
     <td>t.set_tempo(duree_ms)
     </td>
     <td>permet de réinitialiser la temporisation avec une nouvelle valeur.
     </td>
    </tr>
    <tr>
     <td>t.reset()
     </td>
     <td>force le redémarrage de la temporisation.
     </td>
    </tr>
     <td>t=Monostable(duree_ms)
     </td>
     <td>t=Monostable(500) créer un objet de temporisation t de durée 500 ms qui ne se relance qu'après execution de la methode reset()
     </td>
  <tr>
     <td>t=Pwm(500,25)
      </td>
      <td>
      créer un objet générateur de signaux carré de période 500 ms et de rapport cyclique 25%
     </td>
    </tr>
  </table>

  Comme les objets Monostable et Pwm héritent de Tempo ils en possèdent les méthodes.




  l’IHM d’un programme permet à l’utilisateur d’interagir avec celui-ci.

  En mode console les instructions print et input permettent de réaliser une interaction sommaire entre le programme et l’utilisateur.

  En mode graphique l’interaction sera plus poussée.







  Taper le code suivant dans un nouveau fichier dans votre ide préféré :


  ```
  from likeprocessing.processing import *

  ihm = IhmScreen()

  def setup():
     createCanvas(400, 200)
     ihm.init()
     background("grey")
  def compute():
  ihm.scan_events()


  def draw():
  ihm.draw()


  run(globals())
  ```


  Quand vous exécutez ce code une fenêtre fonctionnelle vide apparaît.




  Nous allons ajouter du texte dans la fenêtre.




  Ajouter le code suivant :


  ```
  etiquette1 = Label(ihm, (10, 10, 0, 0), "notre premier texte")
  ```


   et lancer le programme. Que se passe-t-il ?

  Maintenant ajouter


  ```
  ihm.addObjet(etiquette1)
  ```


   et lancer le programme. Que se passe-t-il ?

  Ajouter :


  ```
  ihm.pack(["obj_1"])

  ```


  Que se passe-t-il ?

  Essayer pack(margin_left=10) , pack(margin_right=10)

  Ajouter une étiquette2 à la fenêtre.


  ```
  etiquette2 = Label(ihm, (10, 10, 0, 0), "etiquette2")
  ihm.addObjet(etiquette2)
  ```


  Où se place-t-elle sans utiliser **pack** ?

  Essayer avec la méthode pack et conclure.

  Remarque :

  on peut utiliser la méthode addObjet en lui passant une liste d'objet


  ```
  ihm.addObjet([texte,entry, bouton])
  ```





  On souhaite réaliser interface suivante qui contient :



  ![](./images/image3.png)

  une étiquette (Label) donnant une explication à l’utilisateur, une zone de texte modifiable (LineEdit) et un bouton (Bouton) qui permettra de changer le titre de la fenêtre par le texte entré par l’utilisateur.


  ```
  etiquette = Label(ihm, (10, 10, 0, 0), "Modifier le texte et appuyer sur le bouton")
  texte = LineEdit(ihm,(10,30,100,30),"")
  bouton = Bouton(ihm, (10, 60, 100, 30), "Changer le titre")
  ihm.addObjet([etiquette,texte, bouton])
  ihm.pack(["obj_1","obj_2","obj_3"])
  ```


  n’oubliez pas d’utiliser les méthode addObjet() et pack()

  Lorsque vous lancez le programme, que se passe-t-il ?

  Modifier votre programme en complétant la création du bouton avec :


  ```
  command=lambda : title(texte.text())
  ```


  texte.text() permet de récupérer le texte écrit par l’utilisateur.

  lambda permet de définir une fonction sur une ligne (le paramètre **command** à besoin d’une fonction comme valeur). On peut aussi donner le nom d'une fonction que l'on aura déjà créé.

  Tester votre programme et modifier les paramètres de pack() en utilisant expand="x",pady=10,padx=10 pour obtenir la fenêtre ci-dessus (vous pouvez changer la hauteur de la fenêtre).




  L'objet IhmScreen possède plusieurs méthodes pour gérer l'interface graphique:

  addObjet permet d'ajouter des widgets à l'interface. Si les objets n'ont pas de nom (paramètre nom non renseigné) la méthode les nomme "obj_1", "obj_2",...

  objet_by_name(nom_objet) permet de récupérer l'objet de l'interface pour par exemple changer sa couleur, récupérer la valeur du texte d'un LineEdit ou changer le **text()** d'un Label...

  Ex :


  ```
  ihm.addObjet(LineEdit(ihm,(10,30,100,30),""),"texte")
  ```


  Cette commande ajoute à l'interface un champ modifiable qui sera appelé "texte"

  print(ihm.objet_by_name("texte").text()) affichera sur le console la valeur du champ.

  On peut si on le souhaite supprimer un objet : ihm.delObjet(nom_objet) ou simplement le rendre invisible avec ihm.objet_by_name(nom_objet).visible = False




  On désire réaliser l’interface suivante :

  Il faut créer des boutons pour chaque touche ainsi qu’une étiquette pour simuler l’écran de la calculatrice.


  ```
  touche = [["1","2","3","*"],
           ["4","5","6","/"],
           ["7","8","9","+"],
           ["0",".","²","-"],
           ["(",")","=","AC"]]

  for i in range(5):
     for j in range(4):
         ihm.addObjet(Bouton(None, (10+.....*40, 50+.....*40, 40, 40), touche[i][j], command=lambda v=touche[i][j]: calcule(v)))
  ```


  la dernière ligne peut être remplacer par :


  ```
  ihm.addObjet(Bouton(None, (10+.....*40, 50+.....*40, 40, 40), touche[i][j], command=calcule, name = touche[i][j]))
  ```


  ce qui évite d'utiliser la fonction lambda.

  Le paramètre **name** sera envoyé à la fonction **calcule**.




  créer l’IHM de la calculatrice.





  ![](./images/image4.png)




  Réalisation de l’interface graphique d'un logiciel de dessin

  On veut créer l’IHM du logiciel de dessin my_paint dont le code est le suivant:


  ```
  from likeprocessing.processing import *

  forme = "cercle"
  couleur = "blue"
  point1 = None
  figure = []


  def draw_figure():
     for f in figure:
         largeur = abs(f[1][0] - f[2][0])
         hauteur = abs(f[1][1] - f[2][1])
         if f[0] == "rectangle":
             rect(*f[1],largeur,hauteur,fill=f[3])
         elif f[0] == "ligne":
             line(*f[1],*f[2],stroke=f[3])
         elif f[0] == "cercle":
             circle(*f[1],dist(*f[1],*f[2]),fill=f[3],center_mode="center")


  def setup():
     createCanvas(400, 200,True)
     background("grey")
     title("my_paint")


  def compute():
     global point1
     if mouse_click_down():
         if point1 is None:
             point1 = mouseXY()
             figure.append([forme, point1, point1, couleur])
     if len(figure)>0 and mouseIsPressed():
         figure[-1][2] = mouseXY()
     if mouse_click_up():
         figure[-1][2] = mouseXY()
         point1 = None



  def draw():
     draw_figure()


  run(globals())
  ```


  forme peut prendre les valeurs suivantes : "rectangle","cercle","ligne" et couleur les couleurs acceptés par likeprocessing.

  l'interface doit permettre :

  - afficher le type de forme en cours

  - de changer le type de forme,

  - couleur des figures,

  - la couleur du fond,

  - effacer la dernière forme,

  - effacer le dessin,




  Ces boîtes ont un comportement bloquant c'est à dire que seule l'interaction avec avec la boite est prise en compte : les fonctions compute(), draw(), exit() ne sont plus appelées.


  ```
  ShowInfo(ihm, "Ceci est une \ninformation").response()
  ```



  ![](./images/image5.png)


  ```
  ShowWarning(ihm, "Ceci est un \navertissement").response()
  ```


  ![](./images/image6.png)



  ```
  ShowError(ihm, "Ceci est une \nerreur").response()
  ```


  ![](./images/image7.png)



  ```
  AskYesNo(ihm, "Voulez-vous Vraiment\nquitter le jeu").response()
  ```



  ![](./images/image8.png)



  ```
  AskOkCancel(ihm, "Voulez-vous Vraiment\nquitter le jeu").response()
  ```



  ![](images/image9.png)



  ```
  AskRetriyCancel(ihm, "Voulez-vous tenter\nà nouveau\nvotre chance").response()
  ```


  ![](./images/image10.png)





  les bouton sont numéroté de la gauche vers la droite (0,1) .Le clique sur croix de la boîte retourne la valeur 4


  ```
  if AskYesNo(ihm, "Voulez-vous tenter\nà nouveau\nvotre chance").response() == 0:
  ```


  Avec le code ci-dessus, la condition sera vraie si le bouton de gauche est cliqué.

  Exemple d'utilisation d'une boîte et de la fonction exit().

  La fonction exit() est une fonction facultative (comme compute) destinée à simplifier la sortie du programme que ce soit par l'intermédiaire d'un bouton dédié ou par l'utilisation de la croix de fermeture de la fenêtre.

  Sans cette fonction lorsque que l'on appuie sur la croix la fonction **set_quit(True)** est exécutée ce qui à pour effet de fermer immédiatement l'application.

   le code suivant qui utilise la fonction exit() permet de faire les choses avec plus d'élégance :


  ```
  def exit():
     set_quit(False)
     if AskYesNo(ihm, "Voulez-vous Vraiment\nquitter le jeu").response() == 0:
         set_quit(True)
  ```


  ajout d'un bouton dédié à la fermeture du programme :


  ```
  ihm.addObjet(Bouton(ihm, (0, 0, 100, 0), "Quitter",
                     font_size=20, command=lambda : set_quit(True) ), bp_quitter")
  ```


  On peut aussi passer par une fonction intermédiaire:


  ```
  def bp_quitter():
     set_quit(True)

  ihm.addObjet(Bouton(ihm, (0, 0, 100, 0), "Quitter",
                     font_size=20, command=bp_quitter), "bp_quitter")
  ```




  **Remarque**: on peut rendre si nécessaire la croix de la fenêtre likeprocessing inactive avec la fonction  **disabled_quit_cross(). **La fonction** enabled_quit_cross()** permet de la réactivée.


pkgId: 325f85b44ddd625d6d418ef67f9d81742186fdf43d3800ca9a12509a79a9d804
name: python-lilliepy-dir-router-help
arch: noarch
version: 0.1
epoch: 0
release: 1
summary: Development documents and examples for lilliepy-dir-router
url: https://github.com/websitedeb/lilliepy-dir-router
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-lilliepy-dir-router-0.1-1.src.rpm
location_href: Packages/python-lilliepy-dir-router-help-0.1-1.noarch.rpm
checksum_type: sha256
description:
  a router that uses folders and files to create routes for reactpy files (is used in the lilliepy framework)


  * reactpy
  * reactpy router
  * pathlib
  * importlib
  * os
  * re


  if you are using the lilliepy framework, then this part should be already dont for you, if not, then read this

  ```python

  from lilliepy_dir_router import FileRouter

  FileRouter("/path/to/your/pages/folder", verbose=True) # verbose, if set to true, will print out the routes and status of the router
  ```



  there are 4 special types of files/directories to use in this current release





  silent folders are denoted as ([FOLDER_NAME]), these folders are only for grouping files together, they wont be added to said file's route


  ```
  â”œâ”€â”€ pages
  â”‚   â”œâ”€â”€ (files)
  â”‚   â”‚   â”œâ”€â”€ file.x.py
  ```
  * the url for ```file.x.py``` will be /file, notice how it isnt /files/file





  regular files must end in a ```.x.py``` extenstion if you want it to render, if there are functions of python files you dont want to render or want to make components that you want to import to other ```.x.py``` files and it said component shouldnt have its own route, then use the regular ```.py``` extension.
  * NOTE: the router will ignore files that are not in ```.x.py``` extenstion


  ```python


  from reactpy import component, html # import component (to make function a component), and html (to make html), you can also import hooks from here if you want


  @component # makes function component
  def main(): # NOTE: FUNCTION'S NAME MUST BE THE SAME AS THE FILE'S NAME (THIS IS CASE SENSITIVE TOO)
    return html.h1("yo") # returns <h1>yo</h1>

  @component
  def test(): # this wont render in this file as it's name isnt the same as the file's name, however, you can use this function in your component (the functions that has the same name as the file's name)
    return html.h1("Test")

  ```
  * again, note, function's name MUST be the same name as the file's name if you want it to render, you can create helper functions and/or import them into the render-ing component



  this special file is the root file, it will render in the root of an url, and if it kept in the first dir, then it will render in "/"


  ```
  â”œâ”€â”€ pages
  â”‚   â”œâ”€â”€ +root.x.py     <-- this will render in "/"
  â”‚   â”œâ”€â”€ files
  â”‚   â”‚   â”œâ”€â”€ +root.x.py  <-- this will render in "/files", notice it renders in the root folder
  â”‚   â”‚   â”œâ”€â”€ file.x.py
  â”‚   â”œâ”€â”€ another_example
  â”‚   â”‚   â”œâ”€â”€ +root.x.py  <-- this will render in "/another_example", notice it renders in the root folder
  â”‚   â”‚   â”œâ”€â”€ file_two.x.py
  â”‚   â”‚   â”œâ”€â”€ nested_folder
  â”‚   â”‚   â”‚   â”œâ”€â”€ +root.x.py    <-- this will render in "/another_example/nested_folder"
  â”‚   â”‚   â”œâ”€â”€ nested_folder_two
  â”‚   â”‚   â”‚   â”œâ”€â”€ (folder)
  â”‚   â”‚   â”‚   â”‚   â”œâ”€â”€ +root.x.py  <-- this will render in "/another_example/nested_folder", as the parent folder for +root.x.py is a silent folder, so it is neglected
  ```
  * so in simpler terms, the ```+root.x.py``` file will render in the parent folder root dir url
  * NOTE: it will not render in "/[PARENT_FOLDER_OF_+ROOT.X.PY_FILE]/", as this is a completely different route
  * NOTE: if the parent folder is a slient folder, the +root.x.py file wont be the root file for the silent folder, it will be the root folder for the parent folder of the silent folder


  ```python


  from reactpy import component, html

  @component
  def root(): # the render-ing function for a +root.x.py file MUST be called "root" (LOWER CASE, NOT UPPPER CASE)
    return html.h1("home")
  ```



  these are files which take in value(s) from the url, they are made by saying +[(FILE_NAME)].x.py


  ```
  â”œâ”€â”€ pages
  â”‚   â”œâ”€â”€ +[name].x.py
  â”‚   â”œâ”€â”€ id
  â”‚   â”‚   â”œâ”€â”€ +[id].x.py
  ```


  ```python


  from reactpy import html, component


  @component

  def id(params): # 1 parameter must be given so that this function can access the value(s) in the url, the parameter's name MUST be called params if you want it to be a slug (this is to help differeciate between slug params and other params)
      return html.div([
          html.h1(f"Dynamic Content for ID: {params['id']}"), #params is a dictionary, trust me, knowing that helps you alot
          html.p("This page dynamically renders content based on the slug."),
      ])
  ```


  this page (or component) will handle all 404 error routes


  ```python
  from reactpy import component, html


  @component
  def not_found(): #function's name MUST be not_found
    return html.h1("Not found")
  ```



  you should use ```.x.py``` when:
    * you want the file to render
    * it dosnt contain sensitive backend code
    * it dosnt have parameters other than the slug file's ```params``` parameter

  you should use ```.py``` when:
    * you want to make a component that you want to import and not have a url of its own
    * you want to do backend code
    * you have more parameters than just the slug's ```params``` parameter

  you could think of ```.x.py``` as the client components and ```.py``` as the server components in reactjs


pkgId: 932caa1a3b4e2824d1f70278d1719799fcb1297904cfcaf6fa8a9d0280510966
name: python-lilya-help
arch: noarch
version: 0.11.7
epoch: 0
release: 1
summary: Development documents and examples for lilya
url: https://github.com/dymmond/lilya
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-lilya-0.11.7-1.src.rpm
location_href: Packages/python-lilya-help-0.11.7-1.noarch.rpm
checksum_type: sha256
description:
  **Documentation**: [https://lilya.dev](https://lilya.dev) 📚
  **Source Code**: [https://github.com/dymmond/lilya](https://github.com/dymmond/lilya)


pkgId: 7c0481bc5e57e0eec21c087276b0eb73c0c4f79169773ae586308e08b6e5bfd6
name: python-limeinstall-help
arch: noarch
version: 0.0.1
epoch: 0
release: 1
summary: Development documents and examples for limeinstall
url: https://github.com/Limespy/Limeinstaller
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-limeinstall-0.0.1-1.src.rpm
location_href: Packages/python-limeinstall-help-0.0.1-1.noarch.rpm
checksum_type: sha256
description:
  [![PyPI Package latest release](https://img.shields.io/pypi/v/limeinstall.svg)][1]
  [![PyPI Wheel](https://img.shields.io/pypi/wheel/limeinstall.svg)][1]
  [![Supported versions](https://img.shields.io/pypi/pyversions/limeinstall.svg)][1]
  [![Supported implementations](https://img.shields.io/pypi/implementation/limeinstall.svg)][1]



  LimeInstall is a tool for more complex installation combining installation from pyproject, requirements and editable repositories.



  - [Quick start guide](#quick-start-guide)
      - [The first steps](#the-first-steps)
          - [Installing](#installing)
          - [Importing](#importing)
          - [Example](#example)



  Here's how you can start





  Install LimeInstall with pip

  ```
  pip install limeinstall
  ```



  Import name is the same as install name, `limeinstall`.

  ```python
  import limeinstall
  ```

  Since the package is accessed often,  abbreviation `li` is used. The abbreviation is used throughout this document.

  ```python
  import limeinstall as li
  ```



  ```python
  import limeinstall as li

  ```





  Initial release

  [1]: <https://pypi.org/project/limeinstall> "Project PyPI page"


pkgId: c4a79768e6e227ffb094fd4b379bc68f3e8e7bacac6cfb9f0ecddddaa30c17af
name: python-liminal-orm-help
arch: noarch
version: 1.1.3
epoch: 0
release: 1
summary: Development documents and examples for liminal-orm
url: https://github.com/dynotx/liminal-orm
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-liminal-orm-1.1.3-1.src.rpm
location_href: Packages/python-liminal-orm-help-1.1.3-1.noarch.rpm
checksum_type: sha256
description:
  [![PyPI version](https://img.shields.io/pypi/v/liminal-orm.svg)](https://pypi.org/project/liminal-orm/)
  [![License](https://img.shields.io/github/license/dynotx/liminal-orm)](https://github.com/dynotx/liminal-orm/blob/main/LICENSE.md)
  [![CI](https://github.com/dynotx/liminal-orm/actions/workflows/liminal.yml/badge.svg)](https://github.com/dynotx/liminal-orm/actions/workflows/liminal.yml)
  [![Downloads](https://static.pepy.tech/personalized-badge/liminal-orm?period=total&units=international_system&left_color=grey&right_color=blue&left_text=Downloads)](https://pepy.tech/project/liminal-orm)

  Liminal ORM<sup>1</sup> is an open-source Python package that builds on [Benchling's](https://www.benchling.com/) LIMS<sup>2</sup> platform and provides a simple, code-first approach for synchronizing and managing your Benchling schemas. Check out the [**full documentation here**](https://dynotx.github.io/liminal-orm/) and join our [**Slack community here**](https://join.slack.com/t/liminalorm/shared_invite/zt-2ujrp07s3-bctook4e~cAjn1LgOLVY~Q)!

  Liminal provides an ORM framework using [SQLAlchemy](https://github.com/sqlalchemy/sqlalchemy) along with a schema migration service inspired by [Alembic](https://alembic.sqlalchemy.org/en/latest/). This allows you to define your Benchling schemas in code and create a *single source of truth* that synchronizes between your upstream Benchling tenant(s) and downstream dependencies. By creating a standard interface and through using one-line CLI<sup>3</sup> commands, Liminal enables a code-first approach for managing Benchling tenants and accessing Benchling data. With the schemas defined in code, you can also take advantage of the additional capabilities that the Liminal toolkit provides. This includes:

  - The ability to run migrations to your Benchling tenant(s) through an easy to use CLI.
  - One source of truth defined in code for your Benchling schema model that your many Benchling tenants can stay in sync with.
  - Easy to implement validation rules to reflect business logic for all of your Benchling entities.
  - Strongly typed queries for all your Benchling entities.
  - CI/CD integration with GitHub Actions to ensure that your Benchling schemas and code are always in sync.
  - And more based on community contributions/feedback :)

  If you are a Benchling user, try out Liminal by following the [**Quick Start Guide**](https://dynotx.github.io/liminal-orm/getting-started/prerequisites/)! Reach out in the [Discussions](https://github.com/dynotx/liminal-orm/discussions) forum with any questions or to simply introduce yourself! If there is something blocking you from using Liminal or you're having trouble setting Liminal up, please share in [Issues](https://github.com/dynotx/liminal-orm/issues) or reach out directly (contact information below). You can expect responses within 48 hours :)

  Benchling is an industry standard cloud platform for life sciences R&D. Liminal builds on top of Benchling's platform and assumes that you already have a Benchling tenant set up and have (or have access to) an admin user account. If not, learn more about getting started with Benchling [here](https://www.benchling.com/explore-benchling)!

  Nirmit Damania is the creator and current maintainer of Liminal (I post Liminal updates to [Discussions](https://github.com/dynotx/liminal-orm/discussions) and my [LinkedIn](https://www.linkedin.com/in/nirmit-damania/)). Most importantly, **you** have the ability to influence the future of Liminal! Any feedback, positive or negative, is highly encouraged and will be used to steer the direction of Liminal. Refer to the [Contributing guide](https://github.com/dynotx/liminal-orm/blob/main/CONTRIBUTING.md) to learn more about how you can contribute to Liminal.

  ⭐️ Leave a star on the repo to spread the word!
  If you or your organization use Liminal, please consider adding yourself or your organization to the [Users](https://github.com/dynotx/liminal-orm/blob/main/USERS.md) list.

  <img width="793" alt="liminal_simple_graph" src="https://github.com/user-attachments/assets/52e32cd0-3407-49f5-b100-5763bee3830c">



  - [Overview](#liminal-orm)
  - [Getting Started](#getting-started)
    - [Toolkit](#toolkit)
  - [Mission](#mission)
  - [Community](#community)
  - [Contributing](#contributing)
  - [License](#license)
  - [Acknowledgements](#acknowledgements)
  - [Footnotes](#footnotes)



  Note: Liminal requires you to have (or have access to) an admin user account for your Benchling tenant. If you run into any issues, please reach out to us on the [Discussions](https://github.com/dynotx/liminal-orm/discussions/categories/q-a) forum and we'll be happy to help!

  Check out this [Quick Start Guide](https://dynotx.github.io/liminal-orm/getting-started/prerequisites/) to get you setup with Liminal!



  With your schemas defined in code, you can now take advantage of the additional capabilities that the Liminal toolkit provides.

  1. Entity validation: Easily create custom validation rules for your Benchling entities.

      ```python
      from liminal.validation import BenchlingValidator, BenchlingValidatorReport, BenchlingReportLevel
      from liminal.orm.base_model import BaseModel

      class CookTempValidator(BenchlingValidator):
          """Validates that a field value is a valid enum value for a Benchling entity"""

          def validate(self, entity: type[BaseModel]) -> BenchlingValidatorReport:
              valid = True
              message = None
              if entity.cook_time is not None and entity.cook_temp is None:
                  valid = False
                  message = "Cook temp is required if cook time is set"
              if entity.cook_time is None and entity.cook_temp is not None:
                  valid = False
                  message = "Cook time is required if cook temp is set"
              return self.create_report(valid, BenchlingReportLevel.MED, entity, message)
      ```

  2. Strongly typed queries: Write type-safe queries using SQLAlchemy to access your Benchling entities.

      ```python
      with BenchlingSession(benchling_connection, with_db=True) as session:
          pizza = session.query(Pizza).filter(Pizza.name == "Margherita").first()
          print(pizza)
      ```

  3. CI/CD integration: Use Liminal to automatically generate and apply your revision files to your Benchling tenant(s) as part of your CI/CD pipeline.

  4. And more to come!



  The democratization of software in Biotech is crucial. By building a community around complex, yet common, problems and creating open-source solutions, we can work together to tackle these challenges together and enable faster innovation in the industry. By breaking down the silos between private platforms, we can enable a more dynamic and open ecosystem. This was the motivation for Liminal's creation. Liminal's goal is to create an open-source software product that enables a standard, code-first approach to configuration and change management for LIMS systems. We started with Benchling, but the goal is to make Liminal the go-to solution for any LIMS system.



  We're excited to hear from you! Feel free to introduce yourself on the [Liminal GitHub Discussions page](https://github.com/dynotx/liminal-orm/discussions/categories/intros)

  Please refer to [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) to learn more about how to interact with the community.

  Please refer to [GOVERNANCE.md](./GOVERNANCE.md) to learn more about the project's governance structure.



  Contributions of any kind are welcome and encouraged! This ranges from feedback and feature requests all the way to code contributions.
  Please refer to [CONTRIBUTING.md](./CONTRIBUTING.md) to learn how to contribute to Liminal!



  Liminal ORM is distributed under the [Apache License, Version 2.0](./LICENSE.md).



  - Email: <opensource@dynotx.com>
  - LinkedIn: [Nirmit Damania](https://www.linkedin.com/in/nirmit-damania/)



  This project could not have been started without the support of Dyno Therapeutics and the help of the following people.

  - [Steve Northup](https://github.com/steve-dyno): For being an incredibly supportive manager and mentor, making key technical contributions, and providing guidance on the project's direction.
  - [Joyce Samson](https://github.com/samsonjoyce): For being Liminal's first power user at Dyno Therapeutics, providing valuable feedback that informed the project's direction, and coming up with Liminal's name.
  - [David Levy-Booth](https://github.com/davidlevybooth): For providing leadership and guidance on releasing this as an open source software.
  - The rest of the Dyno team...



  ORM<sup>1</sup>: Object-Relational Mapper. An ORM is a piece of software designed to translate between the data representations used by databases and those used in object-oriented programming. In this case, Liminal provides an ORM layer built specifically for Benchling that allows for users to quickly and easily define Benchling entities in code. [SQLAlchemy](https://github.com/sqlalchemy/sqlalchemy) is the underlying ORM that Liminal uses to interact with your Benchling tenant(s) and is an open-source software that is an industry standard software.

  LIMS<sup>2</sup>: Laboratory Information Management System. A LIMS is a piece of software that allows you to effectively manage samples and associated data. [Benchling](https://www.benchling.com/) is an industry-leading LIMS software.

  CLI<sup>3</sup>: Command Line Interface. A CLI is a piece of software that allows you to interact with a software program via the command line. Liminal provides a CLI that allows you to interact with your Liminal environment. This project uses [Typer](https://github.com/fastapi/typer) to construct the CLI


pkgId: 119bc14f6b28fc435fff30084debd069119d38634c50853cd1c271f7a72ee925
name: python-line-works-sdk-help
arch: noarch
version: 0.0.1
epoch: 0
release: 1
summary: Development documents and examples for line-works-sdk
url: https://github.com/nanato12/line-works-sdk
rpm_license: MIT License
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-line-works-sdk-0.0.1-1.src.rpm
location_href: Packages/python-line-works-sdk-help-0.0.1-1.noarch.rpm
checksum_type: sha256
description:
  LINE Works SDK for Python



  Python 3.10+



  ```sh
  $ pip install line-works-sdk
  ```



  ```python
  from line_works import LineWorks


  WORKS_ID = "YOUR WORKS ID"
  PASSWORD = "YOUR WORKS PASSWORD"

  works = LineWorks(works_id=WORKS_ID, password=PASSWORD)


  my_info = works.get_my_info()
  print(f"{my_info=}")
  ```



  - [nezumi0627](https://github.com/nezumi0627)



  The following linter results are detected by GitHub Actions.

  - ruff
  - mypy


pkgId: c0cf254ebfaf22ea1010a6bda5966be8aebada6efdc7d801d455d86346439f82
name: python-linear-python-help
arch: noarch
version: 0.1.0
epoch: 0
release: 1
summary: Development documents and examples for linear-python
url: https://github.com/jpbullalayao/linear-python
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-linear-python-0.1.0-1.src.rpm
location_href: Packages/python-linear-python-help-0.1.0-1.noarch.rpm
checksum_type: sha256
description:
  A Python client for the [Linear](https://linear.app/) API.



  ```bash
  pip install linear-python
  ```





  Create an `.env` file that contains your personal Linear API Key:

  ```
  LINEAR_API_KEY=your-api-key
  ```

  Then, you are ready to initialize the python Linear client

  ```python
  from linear_python import LinearClient, Config
  client = LinearClient(Config.API_KEY)
  ```



  ```python
  viewer = client.get_viewer()
  print(f"Current user: {viewer['data']['viewer']['name']}")
  ```



  ```python
  issue_data = {
      "team_id": "your-team-id",
      "title": "New bug report",
      "description": "Description of the issue"
  }
  new_issue = client.create_issue(issue_data)
  print(f"Created issue: {new_issue['data']['issueCreate']['issue']['url']}")
  ```



  - [Linear Docs](https://developers.linear.app/docs)



  MIT License


pkgId: cf7e4307fcf66e152fbfc2410ab1ae43821480065b72c600e562a2c781a9ed46
name: python-linear-python-help
arch: noarch
version: 0.2.2
epoch: 0
release: 1
summary: Development documents and examples for linear-python
url: https://github.com/jpbullalayao/linear-python
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-linear-python-0.2.2-1.src.rpm
location_href: Packages/python-linear-python-help-0.2.2-1.noarch.rpm
checksum_type: sha256
description:
  A Python client for the [Linear](https://linear.app/) API.



  - Python 3.7+
  - Required packages (automatically installed):
    - requests
    - python-dotenv
    - strawberry-graphql
    - pydantic
    - typing-extensions



  The package and all its dependencies can be installed via pip:

  ```bash
  pip install linear-python
  ```





  Retrieve your personal Linear API Key, and then initialize the python Linear client:

  ```python
  from linear_python import LinearClient
  client = LinearClient("<Linear API Key Here>")
  ```

  You're now ready to use linear-python! Below are a few sample functions you can call.



  ```python
  viewer = client.get_viewer()
  ```



  ```python
  issue_data = {
      "teamId": "your-team-id",
      "title": "New bug report",
      "description": "Description of the issue"
  }
  new_issue = client.create_issue(issue_data)
  ```



  - [Linear Docs](https://developers.linear.app/docs)



  MIT License


pkgId: e806fef993a22033fbcb78a29c57b288c1dc689efd83b68b330c8e2a876e2b78
name: python-lines-methods-help
arch: noarch
version: 0.0.1
epoch: 0
release: 1
summary: Development documents and examples for lines-methods
url: https://github.com/UgryumovAV
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-lines-methods-0.0.1-1.src.rpm
location_href: Packages/python-lines-methods-help-0.0.1-1.noarch.rpm
checksum_type: sha256
description:
  Using the library is as simple and convenient as possible:
  Let's import it first:
  First, import everything from the library (use the `from `...` import ` construct).
  Examples of some operations:
  Finding the intersection point of two vectors using the `get_intersection()` function:
      intersection = get_intersection(line_a, line_b)
  Finding the length of the vector using the `get_length()` function:
      length = get_length(coordinates)
  Finding the angle between two vectors using the `get_angle_between_lines()` function:
      angle = get_angle_between_lines(line_a, line_b)
  Stretch the line in both directions using the `extend_line()` function:
      new_coordinates = extend_line(line, extend_length)
  Finding the midpoint using the `get_medium_point_from_line()` function:


pkgId: aefc2d4e856ddb589da1fdbc04f920f65ee911b2abf6b7c930b22c7f5d03b82d
name: python-lingoshelle-help
arch: noarch
version: 1.3
epoch: 0
release: 1
summary: Development documents and examples for lingoshelle
url: https://pypi.org/project/lingoshelle/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-lingoshelle-1.3-1.src.rpm
location_href: Packages/python-lingoshelle-help-1.3-1.noarch.rpm
checksum_type: sha256
description:
  ![Image](https://github.com/blueraymusic/Cmd-bot/assets/83096078/cfc199a3-bf06-4b67-a59c-2022d2a19368)

  Update computer v0.2 - Support for GPT-4 API

  This update introduces the computer.yaml configuration file. In this file, you can specify which OpenAI model you want to query and other settings. The safety switch also moved into this configuration file.

  For now, the default model is still gpt-3.5-turbo, but you can update to gpt-4 if you have gotten access already!

  computer v0.2 - by @blueraymusic

  ```
  Usage:
  - computer [-a] list the current directory information
  Argument: -a: Prompt the user before running the command (only useful when safety is off)

  - computer [-c] generate pre-trained tranformers output
  Argument: -c: Prompt the user before running the command (useful when safety is off)
  //Important: this argument also takes nlp prompt (.e.g what is a rainbow?)

  - computer [-i] list the information
  Argument: -i: this argument does not need prompt (.e.g computer -i)


  Current configuration per computer.yaml:
  * Model        : gpt-3.5-turbo
  * Temperature  : 0
  * Max. Tokens  : 500
  * Safety       : on
  ```
  Happy Hacking!


      - macOS
          - Optional faster way -> You can download the install.sh, then run (in terminal) : bash install.sh
      - Or
        - git clone https://github.com/blueraymusic/Combot
        - cd Cmd-bot
        - pip3 install -r requirements.txt
        - chmod +x computer.py

        - Then create alias for computer in the following files:
          - ~/.bashr & ~/.bash_profile & ~/.zshrc
          - alias computer=$(pwd)/computer.py




  - pip install lingoshelle
  - python -m lingoshelle
  - computer -i



  try: computer show me some funny unicode characters
  OpenAI API Key configuration

  There are three ways to configure the key on Linux and macOS:

  a) You can either export `OPENAI_API_KEY=<yourkey>` or have a .env file in the same directory as computer.py with OPENAI_API_KEY="<yourkey>" as a line
  b) Create a file at `~/.openai.apikey` with the key in it
  c) Add the key to the `computer.yaml` configuration file



  To set the alias, like computer on each login, add them to .bash_aliases (or .zshrc on macOS) file. Make sure the path is the one you want to use.
  ```
  echo "alias computer=$(pwd)/computer.py"     >> ~/.bash_aliases
  Installation script
  ```
  Another option is to run `source install.sh` after cloning the repo. That does the following:

  Copies the necessary files to `~/combot/`
  Creates alias computer pointing to `~/combot/computer.py`
  Adds the aliases to the `~/.bash_aliases or ~/.zshrc` file
  That's it for Linux and macOS. Now make sure you have an OpenAI API key set.





  On Windows, you can run .\install.bat (or double-click) after cloning the repo. By default, it does the following:

  Copies the necessary files to ` ~\combot\ `
  Creates a computer.bat file in ~ that lets you run equivalent to `python.exe ~\combot\computer.py`

  - You also have the option to:

  Change the location where combot\ and computer.bat will be created
  Skip creating combot\ and use the folder of the cloned repository instead.
  Create a `.openai.apikey` file in your ~ directory
  That's it basically.

  OpenAI API Key Configuration on Windows

  On Windows, export `OPENAI_API_KEY=<yourkey>` will not work instead:

  Run `$env:OPENAI_API_KEY="<yourkey>"` to set the key for that terminal
  Or, Run PowerShell as an administrator and run `setx OPENAI_API_KEY "<yourkey>"`
  Or, Go to Start and search edit environment variables for your account and manually create the variable with the name `OPENAI_API_KEY` and value <yourkey>
  Optionally (since v.0.2), the key can also be stored in computer.yaml.

  Running computer on Windows

  Windows is less tested; it does work though and will use PowerShell.
  ```
  python.exe computer.py what is my username
  ```
  That's it.

  ```
  computer.bat
  ```


  If you use install.bat, you should have a computer.bat file in your ~ directory that lets you run the command like so:
  ```
  .\computer.bat what is my username
  ```
  You can put the computer.bat file into a $PATH directory (like C:\Windows\System32) to use in any directory like so:
  ```
  computer what is my username
  ```

  Have fun.

  Disabling the safety switch! Caution!

  By default, computer will prompt the user before executing commands.

  Since v.0.2, the safety switch setting moved to computer.yaml; the old ~/.computer-safety-off is not used anymore.

  To have computer run commands right away when they come:

  Examples:


  Here are a couple of examples of how this utility can be used.
  ```
  - computer what's the time?
  - computer search up a "banana" on google/youtube
  - computer what's the time in UTC?
  - computer what's the date and time in Vienna, Austria?
  - computer show me some unicode characters
  - computer what is my username and what's my machine name?
  - computer is there a nano process running
  - computer download the homepage of ycombinator.com and store it in index.html
  - computer find all unique URLs in index.html
  - computer create a file named test.txt and write my username into it
  - computer print the contents of the test.txt file
  - computer -a delete the test.txt file
  - computer what's the current price of Bitcoin in USD
  - computer what's the current price of Bitcoin in USD. Extract the price only
  - computer look at the SSH logs to see if any suspicious logons occurred
  - computer look at the SSH logs and show me all recent logins
  - computer is the user hacker logged on right now?
  - computer do I have a firewall running?
  - computer create a hostnames.txt file and add 10 typical hostnames based on planet names to it, line by line; then show me the contents
  - computer find any file with the name computer.py. Do not show permission denied errors
  - computer write a new bash script file called scan.sh, with the contents to iterate over hostnames.txt and invoke a default nmap scan on each host; then show me the file.
  - computer write a new bash script file called scan.sh, with the contents to iterate over hostnames.txt and invoke a default nmap scan on each host; then show me the file. Make it over multiple lines with comments and annotations.
  ```
  - # Generative Pretrained Tranformers
      - computer -c what is a rainbow?
      - computer -c what is the second law of newton?


  Type in:
  ```
  computer -i
  ```

  Additional:
  To enable total and complete access for optimal use, you can run it with root pass in the root.yaml:
  ```
  .\root.yaml
  ```
  change pass by the root password, as follows, else, leave it as nopass :
  ```
  pass: passw
  ```


  To get more information regarding the bot
  Email: sissokoadel057@gmail.com

  Thanks!


pkgId: fc850f571d25c0009e548c911752ca1f540430442384ad3a25330dc8d36f2a15
name: python-link-pty-help
arch: noarch
version: 0.6.0
epoch: 0
release: 1
summary: Development documents and examples for link-pty
url: https://github.com/ricepastem/link_pty
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-link-pty-0.6.0-1.src.rpm
location_href: Packages/python-link-pty-help-0.6.0-1.noarch.rpm
checksum_type: sha256
description:
  link_pty is a Python package that allows you to manage pseudo terminals via WebSocket. It supports creating, managing, and interacting with terminals remotely through a WebSocket connection.



  To install the package:

  ```bash
  pip install link_pty
  ```


  After installing, you can run the terminal manager with:

  ```bash
  link-pty --base-url "your_base_url_here"
  ```

  If no base URL is provided, it defaults to linkpty.codesocean.top:43143.


pkgId: c3ff366e2e217322511c896911d439e2a54d5b98895a211aa2d02196b6135fc2
name: python-linked-services-help
arch: noarch
version: 1.3.1
epoch: 0
release: 1
summary: Development documents and examples for linked-services
url: https://pypi.org/project/linked-services/
rpm_license: LGPL-3.0-or-later
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-linked-services-1.3.1-1.src.rpm
location_href: Packages/python-linked-services-help-1.3.1-1.noarch.rpm
checksum_type: sha256
description:
  **Table of Contents**
  - [What does this](#what-does-this)
  - [Installation](#installation)
  - [License](#license)

  Linked Services was made by [4geeks.com](https://4geeks.com) to manage communication between multiple services and microservices, it manages specifically communications between pairwise services, so, if only two services share the same key, a request just could has two emisors, the other service and itself. It was designed to replace the signature algorithms because them are significally slower.

  You should install linked-services with a few optional dependencies running:
  ```bash
  pip install linked-services[django,requests,aiohttp]
  ```


  - django
  - djangorestframework
  - celery-task-manager[django]
  - adrf

  - requests
  - brotli

  - httpx
  - httpcore
  - h11
  - idna
  - brotli

  - aiohttp
  - aiodns
  - brotli

  `linked-services` is distributed under the terms of the [LGPL 3.0](https://spdx.org/licenses/LGPL-3.0-or-later.html) license.


pkgId: 805a705242ad0ab95e5ca2ea3a7a85f270b415c0dcc10ef87b08e71b53a4d70f
name: python-linode-mgmt-help
arch: noarch
version: 1.0.7
epoch: 0
release: 1
summary: Development documents and examples for linode-mgmt
url: https://pypi.org/project/linode-mgmt/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-linode-mgmt-1.0.7-1.src.rpm
location_href: Packages/python-linode-mgmt-help-1.0.7-1.noarch.rpm
checksum_type: sha256
description:
  The linode-mgmt is a python package that used to manage Linode ELK clusters.

  To use this package and perform actions on linode, you will need to acquire a token.
  Follow the following guideline to acquire one:
  * Browse to https://www.linode.com/
  * Click on your profile --> API Tokens
  * Click on the `Create A Personal Access Token` button
  * Fill in all your details and click on the `Create Token` button
  * Keep the Token in a safe place

  Note: This token will be used to communicate with the Linode API.



  Prepare the python virtual environment

  ```bash
  mkdir linode-mgmt ; cd linode-mgmt
  python3.9 -m venv .
  source bin/activate
  ```

  Make sure the following packages are installed:
  - pip==22.3.1
  - setuptools==65.6.3



  ```bash
  pip install linode-mgmt
  ```


  usage: linode-mgmt <resource> <action> [arguments]

  Linode Management component

  ```
  optional arguments:
    --help            show this help message and exit
    --version         shows program version
    --log-file NAME   log file name
    --verbose         if added will print more information
    --dry-run         used to test action without performing anything

  required arguments:
    --token <TEXT>    a personal access token

  resources:
      cluster
      node
      volume
      storage
      firewall
  ```



  - To create a new cluster with 3 nodes in 'us-iad' region
  ref: https://api.linode.com/v4/regions
  ```
  linode-mgmt cluster create \
  --token <token> \
  --cluster <cluster> \
  --region us-iad \
  --node-count 3 \
  --node-type g6-dedicated-56 \
  --kube-version 1.30 \
  --verbose
  ```

  - To upgrade an existing cluster to a newer kubernetes version
  ref: https://www.linode.com/docs/products/compute/kubernetes/guides/upgrade-kubernetes-version/?tabs=cloud-manager,linode-api
  ```
  linode-mgmt cluster upgrade \
  --token <token> \
  --cluster <cluster> \
  --kube-version 1.31 \
  --verbose
  ```

  - To delete a cluster
  ```
  linode-mgmt cluster delete \
  --token <token> \
  --cluster <cluster> \
  --verbose
  ```

  - To get a cluster id
  ```
  linode-mgmt cluster get-id \
  --token <token> \
  --cluster <cluster> \
  --verbose
  ```

  - To power on a specific node
  ```
  linode-mgmt node poweron \
  --token <token> \
  --node lke87300-132938-63c003e48302 \
  --verbose
  ```

  - To power off a specific node
  ```
  linode-mgmt node poweroff \
  --token <token> \
  --node lke87300-132938-63c003e48302 \
  --verbose
  ```

  - To restart a specific node
  ```
  linode-mgmt node restart \
  --token <token> \
  --node lke87300-132938-63c003e48302 \
  --verbose
  ```

  - To get a node id
  ```
  linode-mgmt node get-id \
  --token <token> \
  --node lke87300-132938-63c003e48302 \
  --verbose
  ```

  - To update a node with specific alert thresholds
  ```
  linode-mgmt node update \
  --token <token> \
  --cluster <cluster> \
  --node lke87300-132938-63c003e48302 \
  --node-cpu-alert
  --verbose
  ```

  - To delete a volume
  ```
  linode-mgmt volume delete \
  --token <token> \
  --volume-name pvc1809b72cc85e4fa7 \
  --verbose
  ```

  - To create a new storage objects (bucket)
  ```
  linode-mgmt storage create \
  --token <token> \
  --cluster <cluster> \
  --bucket-name <bucket> \
  --verbose
  ```

  - To List all storage objects
  ```
  linode-mgmt storage list \
  --token <token> \
  --cluster <cluster> \
  --verbose
  ```

  - To delete a storage objects
  ```
  linode-mgmt storage delete \
  --token <token> \
  --cluster <cluster> \
  --bucket-name <bucket> \
  --verbose
  ```

  - To get a firewall id
  ```
  linode-mgmt firewall get-id \
  --token <token> \
  --firewall <firewall> \
  --verbose
  ```

  - To get a list of all firewalls
  ```
  linode-mgmt firewall list \
  --token <token> \
  --verbose
  ```

  - To add a node to a firewall
  ```
  linode-mgmt firewall add-node \
  --token <token> \
  --node-name lke268293-471352-15cf7a690000 \
  --firewall <firewall> \
  --verbose
  ```


pkgId: b65a9be5db466d32b68d454d30c6997f825c8219adb51dc49d72583f08a6b492
name: python-lion-anthropic-help
arch: noarch
version: 0.1.0
epoch: 0
release: 1
summary: Development documents and examples for lion-anthropic
url: https://pypi.org/project/lion-anthropic/
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-lion-anthropic-0.1.0-1.src.rpm
location_href: Packages/python-lion-anthropic-help-0.1.0-1.noarch.rpm
checksum_type: sha256
rpm_license:
  MIT License  Copyright (c) 2024 lion-agi  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


pkgId: 2a9439f0a0df642bf13d390a362bd5610bb78d2a5353e84e0765b069ef9d1f5e
name: python-lion-groq-help
arch: noarch
version: 0.1.0
epoch: 0
release: 1
summary: Development documents and examples for lion-groq
url: https://pypi.org/project/lion-groq/
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-lion-groq-0.1.0-1.src.rpm
location_href: Packages/python-lion-groq-help-0.1.0-1.noarch.rpm
checksum_type: sha256
rpm_license:
  Apache License Version 2.0, January 2004 http://www.apache.org/licenses/  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION  1. Definitions.  "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.  "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.  "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.  "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.  "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.  "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.  "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).  "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.  "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."  "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.  2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.  3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.  4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:  (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and  (b) You must cause any modified files to carry prominent notices stating that You changed the files; and  (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and  (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.  You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.  5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.  6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.  7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.  8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.  9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.  END OF TERMS AND CONDITIONS  APPENDIX: How to apply the Apache License to your work.  To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!)  The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.   Copyright 2024 HaiyangLi  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


pkgId: fec9d3cc0816358a16076b332b45b0be5580c007c013229d2c56f2c1f34eabf3
name: python-lion-openai-help
arch: noarch
version: 1.0.3
epoch: 0
release: 1
summary: Development documents and examples for lion-openai
url: https://pypi.org/project/lion-openai/
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-lion-openai-1.0.3-1.src.rpm
location_href: Packages/python-lion-openai-help-1.0.3-1.noarch.rpm
checksum_type: sha256
description:
  [![Python Version](https://img.shields.io/badge/python-3.11%2B-blue)](https://www.python.org/downloads/)
  ![PyPI - Downloads](https://img.shields.io/pypi/dm/lion-openai?color=blue)
  ![Discord](https://img.shields.io/discord/1167495547670777866?color=7289da&label=discord&logo=discord)

  Welcome to lion-openai, a powerful Python library for seamless integration with OpenAI's APIs. As part of the lion ecosystem, lion-openai provides a robust, type-safe, and user-friendly interface for interacting with OpenAI's services.



  - 🔄 Asynchronous API calls for efficient performance
  - 🧩 Easy integration with other lion ecosystem components
  - 📊 Type-safe request and response models using Pydantic
  - 🛠 Customizable API configurations
  - 🧪 Comprehensive test suite
  - 🔒 Built-in error handling and retries



  Here's how lion-openai fits into the lion ecosystem:

  ```mermaid
  graph TD
      A[lion Ecosystem] --> B[lion-openai]
      B --> C[OpenAI API]
      A --> D[Other lion Components]
      B --> E[Type-safe Models]
      B --> F[Async Operations]
  ```



  lion-openai uses Poetry for dependency management. To install:

  ```bash
  poetry add lion-openai
  ```

  Or if you're using pip:

  ```bash
  pip install lion-openai
  ```



  1. Ensure you have Python 3.10 or newer installed.
  2. Install Poetry:
     ```bash
     curl -sSL https://install.python-poetry.org | python3 -
     ```
  3. Clone the repository:
     ```bash
     git clone https://github.com/lion-agi/lion-openai.git
     cd lion-openai
     ```
  4. Install dependencies:
     ```bash
     poetry install
     ```
  5. Set up pre-commit hooks:
     ```bash
     poetry run pre-commit install
     ```



  We use pytest for our test suite. To run the tests:

  ```bash
  poetry run pytest
  ```



  We use several tools to maintain code quality:

  - **Black**: For code formatting
  - **isort**: For sorting imports
  - **Flake8**: For style guide enforcement
  - **mypy**: For static type checking

  These tools are run automatically via pre-commit hooks before each commit. You can also run them manually:

  ```bash
  poetry run pre-commit run --all-files
  ```



  We use GitHub Actions for our CI/CD pipeline. On every push and pull request:

  - Tests are run
  - Code quality checks are performed
  - Documentation is built and deployed



  We welcome contributions! Please see our [Contributing Guidelines](CONTRIBUTING.md) for more details.

  Before submitting a pull request:

  1. Ensure all tests pass
  2. Update documentation as needed
  3. Add any necessary tests for new functionality



  lion-openai is released under the MIT License. See the [LICENSE](LICENSE) file for details.



  - OpenAI for their fantastic API
  - The entire lion ecosystem team and contributors

  Remember, in the lion-openai jungle, we roar with code! 🦁💻

rpm_license:
  MIT License  Copyright (c) 2024 lion-agi  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


pkgId: 136317835c88bd9ec2369a67009a4d8cf3a36f86aa2636170a925e20b4737c3c
name: python-lion-service-help
arch: noarch
version: 1.1.1
epoch: 0
release: 1
summary: Development documents and examples for lion-service
url: https://pypi.org/project/lion-service/
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-lion-service-1.1.1-1.src.rpm
location_href: Packages/python-lion-service-help-1.1.1-1.noarch.rpm
checksum_type: sha256
description:
  A unified interface for AI model providers (OpenAI, Anthropic, Perplexity, Groq) with rate limiting and token management.

  [![Version](https://img.shields.io/pypi/v/lion-service.svg)](https://pypi.org/lion-agi/lion-service/)
  [![License](https://img.shields.io/github/license/lion-agi/lion-service.svg)](LICENSE)



  - Unified interface for multiple AI providers
  - Built-in rate limiting and token tracking
  - Automatic retries with exponential backoff
  - Token calculation using tiktoken



  ```bash
  uv pip install lion-service


  uv pip install lion-openai      # For OpenAI
  uv pip install lion-anthropic   # For Anthropic
  uv pip install lion-perplexity  # For Perplexity
  uv pip install lion-groq        # For Groq
  ```



  ```python
  from lion_service import iModel


  model = iModel(
      provider="openai",
      task="chat",
      model="gpt-4",
      api_key="your-api-key",
      interval_tokens=90000,  # Optional: Token limit per minute
      interval_requests=3500  # Optional: Request limit per minute
  )


  async def chat():
      response = await model.invoke(
          messages=[{"role": "user", "content": "Hello!"}]
      )
      print(response)
  ```



  ```python

  model = iModel(
      provider="openai",
      interval_tokens=90000,  # 90K tokens/min
      interval_requests=3500  # 3.5K requests/min
  )
  ```



  ```python
  from lion_service import RateLimitError

  try:
      response = await model.invoke(...)
  except RateLimitError as e:
      print(f"Rate limit exceeded: {e.requested_tokens} tokens")
  ```



  ```python
  from lion_service import Service, register_service

  @register_service
  class MyService(Service):
      def __init__(self, api_key: str):
          self.api_key = api_key
          self.name = "my_service"

      def list_tasks(self):
          return ["chat", "completion"]
  ```



  1. Fork and clone the repository
  2. Install dev dependencies: `uv pip install -e ".[dev]"`
  3. Make changes
  4. Run tests: `pytest`
  5. Submit a pull request

  See [Contributing Guide](docs/contributing.md) for detailed instructions.



  Apache License 2.0 - see [LICENSE](LICENSE)

rpm_license:
  Apache License Version 2.0, January 2004 http://www.apache.org/licenses/  TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION  1. Definitions.  "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.  "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.  "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.  "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.  "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.  "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.  "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).  "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.  "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."  "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.  2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.  3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.  4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:  (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and  (b) You must cause any modified files to carry prominent notices stating that You changed the files; and  (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and  (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.  You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.  5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.  6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.  7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.  8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.  9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.  END OF TERMS AND CONDITIONS  APPENDIX: How to apply the Apache License to your work.  To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!)  The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.   Copyright 2024 HaiyangLi  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at  http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


pkgId: b4eebc3ce30dbc88863347b56585784d9dae3135330b20932cbc53298aa381e1
name: python-lionagi-help
arch: noarch
version: 0.5.0
epoch: 0
release: 1
summary: Development documents and examples for lionagi
url: https://pypi.org/project/lionagi/
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-lionagi-0.5.0-1.src.rpm
location_href: Packages/python-lionagi-help-0.5.0-1.noarch.rpm
checksum_type: sha256
description:
  ![PyPI - Version](https://img.shields.io/pypi/v/lionagi?labelColor=233476aa&color=231fc935)
  ![PyPI - Downloads](https://img.shields.io/pypi/dm/lionagi?color=blue)
  ![Python Version](https://img.shields.io/badge/python-3.11%2B-blue)

  [Documentation](https://ocean-lion.com/Welcome) | [Discord](https://discord.gg/aqSJ2v46vu) | [PyPI](https://pypi.org/project/lionagi/) | [Roadmap](https://trello.com/b/3seomsrI/lionagi)




  > Harness the power of next-generation AI while maintaining complete control and reliability.



  The AI revolution is transforming how we work - but with great power comes great responsibility. LION provides the control mechanisms and reliability features needed to safely integrate advanced AI capabilities into enterprise workflows.

  LION is designed to be:
  - 🔒 **Controlled**: Built-in safety mechanisms and verification
  - 🎯 **Precise**: Exact control over AI behaviors
  - 🔧 **Flexible**: Build any workflow you need
  - 🚀 **Efficient**: Minimal dependencies, maximum performance



  ```python
  from lionagi import iModel, Branch


  gpt4o = iModel(provider="openai", model="gpt-4o")

  hunter = Branch(
      system="you are a hilarious dragon hunter who responds in 10 words rhymes",
      imodel=gpt4o,
  )


  print(await hunter.communicate("I am a dragon"))
  ```

  ```
  You claim to be a dragon, oh what a braggin'!
  ```



  LION maintains minimal dependencies for maximum reliability:

  ```bash
  uv pip install lionagi
  ```

  Dependencies:
  - litellm
  - jinja2
  - pandas
  - pillow
  - python-dotenv



  Below is an example of what you can build with LION. Note that these are sample implementations - LION provides the building blocks, you create the workflows that fit your needs.

  ```mermaid
  sequenceDiagram
      autonumber
      participant Client
      participant Orchestrator
      participant ResearchAgent
      participant AnalysisAgent
      participant ValidationAgent
      participant Tools

      Client->>+Orchestrator: Submit Complex Task
      Note over Orchestrator: Task Analysis & Planning

      % Research Phase
      Orchestrator->>+ResearchAgent: Delegate Research
      activate ResearchAgent
      ResearchAgent->>Tools: Access Data Sources
      Tools-->>ResearchAgent: Raw Data
      ResearchAgent-->>-Orchestrator: Research Results
      deactivate ResearchAgent

      % Analysis Phase
      Orchestrator->>+AnalysisAgent: Process Data
      activate AnalysisAgent
      AnalysisAgent->>Tools: Apply Models
      Tools-->>AnalysisAgent: Analysis Results
      AnalysisAgent-->>-Orchestrator: Processed Insights
      deactivate AnalysisAgent

      % Validation Phase
      Orchestrator->>+ValidationAgent: Verify Results
      activate ValidationAgent
      ValidationAgent->>Tools: Apply Safety Checks
      Tools-->>ValidationAgent: Validation Status
      ValidationAgent-->>-Orchestrator: Verified Results
      deactivate ValidationAgent

      Orchestrator-->>-Client: Return Validated Output
  ```




  Join our [Discord community](https://discord.gg/aqSJ2v46vu) to:
  - Share ideas
  - Report issues
  - Contribute code
  - Learn from others



  ```bibtex
  @software{Li_LionAGI_2023,
    author = {Haiyang Li},
    month = {12},
    year = {2023},
    title = {LionAGI: Intelligent Integration Framework},
    url = {https://github.com/lion-agi/lionagi},
  }
  ```

rpm_license:
[cell repeats an earlier one in this file: 10237 characters]


pkgId: e963358b219e9b45dbed8965ef07c8bd1b5fe7cf2082b890186c9103cad05163
name: python-lionz-help
arch: noarch
version: 0.11.0
epoch: 0
release: 1
summary: Development documents and examples for lionz
url: https://github.com/QIMP-Team/lionz
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-lionz-0.11.0-1.src.rpm
location_href: Packages/python-lionz-help-0.11.0-1.noarch.rpm
checksum_type: sha256
description:
  LIONZ, an acronym for Lesion Segmentation, is a robust Python tool designed
                        to act as a central platform for extracting tumor and lesion information
                        from PET/CT datasets. Built with accuracy and performance in mind, LIONZ aims
                        to streamline medical imaging tasks and contribute to enhanced diagnosis.


pkgId: d3a0c1495c6ba01c5c9b239dfcf21047b9b427ac78cfacfa88b6d8b95dbadf17
name: python-lit-mlflow-help
arch: noarch
version: 0.1.0
epoch: 0
release: 1
summary: Development documents and examples for lit-mlflow
url: https://twsl.github.io/lit-mlflow/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-lit-mlflow-0.1.0-1.src.rpm
location_href: Packages/python-lit-mlflow-help-0.1.0-1.noarch.rpm
checksum_type: sha256
description:
  [![Build](https://github.com/twsl/lit-mlflow/actions/workflows/build.yaml/badge.svg)](https://github.com/twsl/lit-mlflow/actions/workflows/build.yaml)
  [![Documentation](https://github.com/twsl/lit-mlflow/actions/workflows/docs.yaml/badge.svg)](https://github.com/twsl/lit-mlflow/actions/workflows/docs.yaml)
  ![GitHub Release](https://img.shields.io/github/v/release/twsl/lit-mlflow?include_prereleases)
  [![PyPI - Package Version](https://img.shields.io/pypi/v/lit-mlflow?logo=pypi&style=flat&color=orange)](https://pypi.org/project/lit-mlflow/)
  [![PyPI - Python Version](https://img.shields.io/pypi/pyversions/lit-mlflow?logo=pypi&style=flat&color=blue)](https://pypi.org/project/lit-mlflow/)
  [![Dependencies Status](https://img.shields.io/badge/dependencies-up%20to%20date-brightgreen.svg)](https://github.com/twsl/lit-mlflow/pulls?utf8=%E2%9C%93&q=is:pr%20author:app/dependabot)
  [![Docs with MkDocs](https://img.shields.io/badge/MkDocs-docs?style=flat&logo=materialformkdocs&logoColor=white&color=%23526CFE)](https://squidfunk.github.io/mkdocs-material/)
  [![Poetry](https://img.shields.io/endpoint?url=https://python-poetry.org/badge/v0.json)](https://python-poetry.org/)
  [![linting: ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)
  [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](.pre-commit-config.yaml)
  [![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)
  [![security: bandit](https://img.shields.io/badge/security-bandit-yellow.svg)](https://github.com/PyCQA/bandit)
  [![Semantic Versions](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--versions-e10079.svg)](https://github.com/twsl/lit-mlflow/releases)
  [![Copier](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/copier-org/copier/master/img/badge/badge-grayscale-border.json)](https://github.com/copier-org/copier)
  [![License](https://img.shields.io/badge/license-MIT-blue)](LICENSE)


  An improved Lightning mlflow logger. Works seamlessly with PyTorch Lightning on Databricks and offers more control compared to the `mlflow.pytorch.autolog` function.




  - Makes `MLflow` logging work with `lightning` and [Databricks](https://www.databricks.com/)




  With `pip`:
  ```bash
  python -m pip install lit-mlflow
  ```

  With [`poetry`](https://python-poetry.org/):
  ```bash
  poetry add lit-mlflow
  ```



  Replace `mlflow.autolog()` with the `MlFlowAutoCallback`:

  ```python
  from lit_mlflow import MlFlowAutoCallback
  import lightning.pytorch as pl

  trainer = pl.Trainer(
      callbacks=[
          MlFlowAutoCallback()
      ]
  )
  ```

  To support Databricks mlflow, use the `DbxMLFlowLogger` instead of the `MlFlowLogger`:

  ```python
  from lit_mlflow import DbxMLFlowLogger
  import lightning.pytorch as pl

  trainer = pl.Trainer(
      logger=[
          DbxMLFlowLogger()
      ]
  )
  ```



  ```bash
  poetry run mkdocs build -f ./docs/mkdocs.yml -d ./_build/
  ```




  ```bash
  copier update --trust -A --vcs-ref=HEAD
  ```




  This project was generated with [![🚀 A generic python project template.](https://img.shields.io/badge/python--project--template-%F0%9F%9A%80-brightgreen)](https://github.com/twsl/python-project-template)


pkgId: 82de43517afe858afecaefbd7b2249d0918ed9c335ce67ebc3c4c4da241ca966
name: python-litellm-help
arch: noarch
version: 1.55.1
epoch: 0
release: 1
summary: Development documents and examples for litellm
url: https://pypi.org/project/litellm/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-litellm-1.55.1-1.src.rpm
location_href: Packages/python-litellm-help-1.55.1-1.noarch.rpm
checksum_type: sha256
description:
  <h1 align="center">
          🚅 LiteLLM
      </h1>
      <p align="center">
          <p align="center">
          <a href="https://render.com/deploy?repo=https://github.com/BerriAI/litellm" target="_blank" rel="nofollow"><img src="https://render.com/images/deploy-to-render-button.svg" alt="Deploy to Render"></a>
          <a href="https://railway.app/template/HLP0Ub?referralCode=jch2ME">
            <img src="https://railway.app/button.svg" alt="Deploy on Railway">
          </a>
          </p>
          <p align="center">Call all LLM APIs using the OpenAI format [Bedrock, Huggingface, VertexAI, TogetherAI, Azure, OpenAI, Groq etc.]
          <br>
      </p>
  <h4 align="center"><a href="https://docs.litellm.ai/docs/simple_proxy" target="_blank">LiteLLM Proxy Server (LLM Gateway)</a> | <a href="https://docs.litellm.ai/docs/hosted" target="_blank"> Hosted Proxy (Preview)</a> | <a href="https://docs.litellm.ai/docs/enterprise"target="_blank">Enterprise Tier</a></h4>
  <h4 align="center">
      <a href="https://pypi.org/project/litellm/" target="_blank">
          <img src="https://img.shields.io/pypi/v/litellm.svg" alt="PyPI Version">
      </a>
      <a href="https://dl.circleci.com/status-badge/redirect/gh/BerriAI/litellm/tree/main" target="_blank">
          <img src="https://dl.circleci.com/status-badge/img/gh/BerriAI/litellm/tree/main.svg?style=svg" alt="CircleCI">
      </a>
      <a href="https://www.ycombinator.com/companies/berriai">
          <img src="https://img.shields.io/badge/Y%20Combinator-W23-orange?style=flat-square" alt="Y Combinator W23">
      </a>
      <a href="https://wa.link/huol9n">
          <img src="https://img.shields.io/static/v1?label=Chat%20on&message=WhatsApp&color=success&logo=WhatsApp&style=flat-square" alt="Whatsapp">
      </a>
      <a href="https://discord.gg/wuPM9dRgDw">
          <img src="https://img.shields.io/static/v1?label=Chat%20on&message=Discord&color=blue&logo=Discord&style=flat-square" alt="Discord">
      </a>
  </h4>

  LiteLLM manages:

  - Translate inputs to provider's `completion`, `embedding`, and `image_generation` endpoints
  - [Consistent output](https://docs.litellm.ai/docs/completion/output), text responses will always be available at `['choices'][0]['message']['content']`
  - Retry/fallback logic across multiple deployments (e.g. Azure/OpenAI) - [Router](https://docs.litellm.ai/docs/routing)
  - Set Budgets & Rate limits per project, api key, model [LiteLLM Proxy Server (LLM Gateway)](https://docs.litellm.ai/docs/simple_proxy)

  [**Jump to LiteLLM Proxy (LLM Gateway) Docs**](https://github.com/BerriAI/litellm?tab=readme-ov-file#openai-proxy---docs) <br>
  [**Jump to Supported LLM Providers**](https://github.com/BerriAI/litellm?tab=readme-ov-file#supported-providers-docs)

  🚨 **Stable Release:** Use docker images with the `-stable` tag. These have undergone 12 hour load tests, before being published.

  Support for more providers. Missing a provider or LLM Platform, raise a [feature request](https://github.com/BerriAI/litellm/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.yml&title=%5BFeature%5D%3A+).



  > [!IMPORTANT]
  > LiteLLM v1.0.0 now requires `openai>=1.0.0`. Migration guide [here](https://docs.litellm.ai/docs/migration)
  > LiteLLM v1.40.14+ now requires `pydantic>=2.0.0`. No changes required.

  <a target="_blank" href="https://colab.research.google.com/github/BerriAI/litellm/blob/main/cookbook/liteLLM_Getting_Started.ipynb">
    <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
  </a>

  ```shell
  pip install litellm
  ```

  ```python
  from litellm import completion
  import os


  os.environ["OPENAI_API_KEY"] = "your-openai-key"
  os.environ["COHERE_API_KEY"] = "your-cohere-key"

  messages = [{ "content": "Hello, how are you?","role": "user"}]


  response = completion(model="gpt-3.5-turbo", messages=messages)


  response = completion(model="command-nightly", messages=messages)
  print(response)
  ```

  Call any model supported by a provider, with `model=<provider_name>/<model_name>`. There might be provider-specific details here, so refer to [provider docs for more information](https://docs.litellm.ai/docs/providers)



  ```python
  from litellm import acompletion
  import asyncio

  async def test_get_response():
      user_message = "Hello, how are you?"
      messages = [{"content": user_message, "role": "user"}]
      response = await acompletion(model="gpt-3.5-turbo", messages=messages)
      return response

  response = asyncio.run(test_get_response())
  print(response)
  ```



  liteLLM supports streaming the model response back, pass `stream=True` to get a streaming iterator in response.
  Streaming is supported for all models (Bedrock, Huggingface, TogetherAI, Azure, OpenAI, etc.)

  ```python
  from litellm import completion
  response = completion(model="gpt-3.5-turbo", messages=messages, stream=True)
  for part in response:
      print(part.choices[0].delta.content or "")


  response = completion('claude-2', messages, stream=True)
  for part in response:
      print(part.choices[0].delta.content or "")
  ```



  LiteLLM exposes pre defined callbacks to send data to Lunary, Langfuse, DynamoDB, s3 Buckets, Helicone, Promptlayer, Traceloop, Athina, Slack, MLflow

  ```python
  from litellm import completion


  os.environ["LUNARY_PUBLIC_KEY"] = "your-lunary-public-key"
  os.environ["HELICONE_API_KEY"] = "your-helicone-auth-key"
  os.environ["LANGFUSE_PUBLIC_KEY"] = ""
  os.environ["LANGFUSE_SECRET_KEY"] = ""
  os.environ["ATHINA_API_KEY"] = "your-athina-api-key"

  os.environ["OPENAI_API_KEY"]


  litellm.success_callback = ["lunary", "langfuse", "athina", "helicone"] # log input/output to lunary, langfuse, supabase, athina, helicone etc


  response = completion(model="gpt-3.5-turbo", messages=[{"role": "user", "content": "Hi 👋 - i'm openai"}])
  ```



  Track spend + Load Balance across multiple projects

  [Hosted Proxy (Preview)](https://docs.litellm.ai/docs/hosted)

  The proxy provides:

  1. [Hooks for auth](https://docs.litellm.ai/docs/proxy/virtual_keys#custom-auth)
  2. [Hooks for logging](https://docs.litellm.ai/docs/proxy/logging#step-1---create-your-custom-litellm-callback-class)
  3. [Cost tracking](https://docs.litellm.ai/docs/proxy/virtual_keys#tracking-spend)
  4. [Rate Limiting](https://docs.litellm.ai/docs/proxy/users#set-rate-limits)






  ```shell
  pip install 'litellm[proxy]'
  ```



  ```shell
  $ litellm --model huggingface/bigcode/starcoder


  ```




  > [!IMPORTANT]
  > 💡 [Use LiteLLM Proxy with Langchain (Python, JS), OpenAI SDK (Python, JS) Anthropic SDK, Mistral SDK, LlamaIndex, Instructor, Curl](https://docs.litellm.ai/docs/proxy/user_keys)

  ```python
  import openai # openai v1.0.0+
  client = openai.OpenAI(api_key="anything",base_url="http://0.0.0.0:4000") # set proxy to base_url

  response = client.chat.completions.create(model="gpt-3.5-turbo", messages = [
      {
          "role": "user",
          "content": "this is a test request, write a short poem"
      }
  ])

  print(response)
  ```



  Connect the proxy with a Postgres DB to create proxy keys

  ```bash

  git clone https://github.com/BerriAI/litellm


  cd litellm


  echo 'LITELLM_MASTER_KEY="sk-1234"' > .env





  echo 'LITELLM_SALT_KEY="sk-1234"' > .env

  source .env


  docker-compose up
  ```


  UI on `/ui` on your proxy server
  ![ui_3](https://github.com/BerriAI/litellm/assets/29436595/47c97d5e-b9be-4839-b28c-43d7f4f10033)

  Set budgets and rate limits across multiple projects
  `POST /key/generate`



  ```shell
  curl 'http://0.0.0.0:4000/key/generate' \
  --header 'Authorization: Bearer sk-1234' \
  --header 'Content-Type: application/json' \
  --data-raw '{"models": ["gpt-3.5-turbo", "gpt-4", "claude-2"], "duration": "20m","metadata": {"user": "ishaan@berri.ai", "team": "core-infra"}}'
  ```



  ```shell
  {
      "key": "sk-kdEXbIqZRwEeEiHwdg7sFA", # Bearer token
      "expires": "2023-11-19T01:38:25.838000+00:00" # datetime object
  }
  ```



  | Provider                                                                            | [Completion](https://docs.litellm.ai/docs/#basic-usage) | [Streaming](https://docs.litellm.ai/docs/completion/stream#streaming-responses) | [Async Completion](https://docs.litellm.ai/docs/completion/stream#async-completion) | [Async Streaming](https://docs.litellm.ai/docs/completion/stream#async-streaming) | [Async Embedding](https://docs.litellm.ai/docs/embedding/supported_embedding) | [Async Image Generation](https://docs.litellm.ai/docs/image_generation) |
  |-------------------------------------------------------------------------------------|---------------------------------------------------------|---------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------|-------------------------------------------------------------------------|
  | [openai](https://docs.litellm.ai/docs/providers/openai)                             | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 | ✅                                                                             | ✅                                                                       |
  | [azure](https://docs.litellm.ai/docs/providers/azure)                               | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 | ✅                                                                             | ✅                                                                       |
  | [aws - sagemaker](https://docs.litellm.ai/docs/providers/aws_sagemaker)             | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 | ✅                                                                             |                                                                         |
  | [aws - bedrock](https://docs.litellm.ai/docs/providers/bedrock)                     | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 | ✅                                                                             |                                                                         |
  | [google - vertex_ai](https://docs.litellm.ai/docs/providers/vertex)                 | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 | ✅                                                                             | ✅                                                                       |
  | [google - palm](https://docs.litellm.ai/docs/providers/palm)                        | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [google AI Studio - gemini](https://docs.litellm.ai/docs/providers/gemini)          | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [mistral ai api](https://docs.litellm.ai/docs/providers/mistral)                    | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 | ✅                                                                             |                                                                         |
  | [cloudflare AI Workers](https://docs.litellm.ai/docs/providers/cloudflare_workers)  | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [cohere](https://docs.litellm.ai/docs/providers/cohere)                             | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 | ✅                                                                             |                                                                         |
  | [anthropic](https://docs.litellm.ai/docs/providers/anthropic)                       | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [empower](https://docs.litellm.ai/docs/providers/empower)                    | ✅                                                      | ✅                                                                              | ✅                                                                                  | ✅                                                                                |
  | [huggingface](https://docs.litellm.ai/docs/providers/huggingface)                   | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 | ✅                                                                             |                                                                         |
  | [replicate](https://docs.litellm.ai/docs/providers/replicate)                       | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [together_ai](https://docs.litellm.ai/docs/providers/togetherai)                    | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [openrouter](https://docs.litellm.ai/docs/providers/openrouter)                     | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [ai21](https://docs.litellm.ai/docs/providers/ai21)                                 | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [baseten](https://docs.litellm.ai/docs/providers/baseten)                           | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [vllm](https://docs.litellm.ai/docs/providers/vllm)                                 | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [nlp_cloud](https://docs.litellm.ai/docs/providers/nlp_cloud)                       | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [aleph alpha](https://docs.litellm.ai/docs/providers/aleph_alpha)                   | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [petals](https://docs.litellm.ai/docs/providers/petals)                             | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [ollama](https://docs.litellm.ai/docs/providers/ollama)                             | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 | ✅                                                                             |                                                                         |
  | [deepinfra](https://docs.litellm.ai/docs/providers/deepinfra)                       | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [perplexity-ai](https://docs.litellm.ai/docs/providers/perplexity)                  | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [Groq AI](https://docs.litellm.ai/docs/providers/groq)                              | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [Deepseek](https://docs.litellm.ai/docs/providers/deepseek)                         | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [anyscale](https://docs.litellm.ai/docs/providers/anyscale)                         | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [IBM - watsonx.ai](https://docs.litellm.ai/docs/providers/watsonx)                  | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 | ✅                                                                             |                                                                         |
  | [voyage ai](https://docs.litellm.ai/docs/providers/voyage)                          |                                                         |                                                                                 |                                                                                     |                                                                                   | ✅                                                                             |                                                                         |
  | [xinference [Xorbits Inference]](https://docs.litellm.ai/docs/providers/xinference) |                                                         |                                                                                 |                                                                                     |                                                                                   | ✅                                                                             |                                                                         |
  | [FriendliAI](https://docs.litellm.ai/docs/providers/friendliai)                              | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [Galadriel](https://docs.litellm.ai/docs/providers/galadriel)                              | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |

  [**Read the Docs**](https://docs.litellm.ai/docs/)



  To contribute: Clone the repo locally -> Make a change -> Submit a PR with the change.

  Here's how to modify the repo locally:
  Step 1: Clone the repo

  ```
  git clone https://github.com/BerriAI/litellm.git
  ```

  Step 2: Navigate into the project, and install dependencies:

  ```
  cd litellm
  poetry install -E extra_proxy -E proxy
  ```

  Step 3: Test your change:

  ```
  cd litellm/tests # pwd: Documents/litellm/litellm/tests
  poetry run flake8
  poetry run pytest .
  ```

  Step 4: Submit a PR with your changes! 🚀

  - push your fork to your GitHub repo
  - submit a PR from there



  Follow these instructions if you want to build / run the LiteLLM Docker Image yourself.

  Step 1: Clone the repo

  ```
  git clone https://github.com/BerriAI/litellm.git
  ```

  Step 2: Build the Docker Image

  Build using Dockerfile.non_root
  ```
  docker build -f docker/Dockerfile.non_root -t litellm_test_image .
  ```

  Step 3: Run the Docker Image

  Make sure config.yaml is present in the root directory. This is your litellm proxy config file.
  ```
  docker run \
      -v $(pwd)/proxy_config.yaml:/app/config.yaml \
      -e DATABASE_URL="postgresql://xxxxxxxx" \
      -e LITELLM_MASTER_KEY="sk-1234" \
      -p 4000:4000 \
      litellm_test_image \
      --config /app/config.yaml --detailed_debug
  ```


  For companies that need better security, user management and professional support

  [Talk to founders](https://calendly.com/d/4mp-gd3-k5k/litellm-1-1-onboarding-chat)

  This covers:
  - ✅ **Features under the [LiteLLM Commercial License](https://docs.litellm.ai/docs/proxy/enterprise):**
  - ✅ **Feature Prioritization**
  - ✅ **Custom Integrations**
  - ✅ **Professional Support - Dedicated discord + slack**
  - ✅ **Custom SLAs**
  - ✅ **Secure access with Single Sign-On**



  LiteLLM follows the [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html).

  We run:
  - Ruff for [formatting and linting checks](https://github.com/BerriAI/litellm/blob/e19bb55e3b4c6a858b6e364302ebbf6633a51de5/.circleci/config.yml#L320)
  - Mypy + Pyright for typing [1](https://github.com/BerriAI/litellm/blob/e19bb55e3b4c6a858b6e364302ebbf6633a51de5/.circleci/config.yml#L90), [2](https://github.com/BerriAI/litellm/blob/e19bb55e3b4c6a858b6e364302ebbf6633a51de5/.pre-commit-config.yaml#L4)
  - Black for [formatting](https://github.com/BerriAI/litellm/blob/e19bb55e3b4c6a858b6e364302ebbf6633a51de5/.circleci/config.yml#L79)
  - isort for [import sorting](https://github.com/BerriAI/litellm/blob/e19bb55e3b4c6a858b6e364302ebbf6633a51de5/.pre-commit-config.yaml#L10)


  If you have suggestions on how to improve the code quality feel free to open an issue or a PR.




  - [Schedule Demo 👋](https://calendly.com/d/4mp-gd3-k5k/berriai-1-1-onboarding-litellm-hosted-version)
  - [Community Discord 💭](https://discord.gg/wuPM9dRgDw)
  - Our numbers 📞 +1 (770) 8783-106 / ‭+1 (412) 618-6238‬
  - Our emails ✉️ ishaan@berri.ai / krrish@berri.ai



  - **Need for simplicity**: Our code started to get extremely complicated managing & translating calls between Azure, OpenAI and Cohere.



  <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
  <!-- prettier-ignore-start -->
  <!-- markdownlint-disable -->

  <!-- markdownlint-restore -->
  <!-- prettier-ignore-end -->

  <!-- ALL-CONTRIBUTORS-LIST:END -->

  <a href="https://github.com/BerriAI/litellm/graphs/contributors">
    <img src="https://contrib.rocks/image?repo=BerriAI/litellm" />
  </a>


pkgId: 50f4909e52929ef885b1ac1aa62ccac279af268386631f067b5b6507975022d7
name: python-litellm-help
arch: noarch
version: 1.55.7
epoch: 0
release: 1
summary: Development documents and examples for litellm
url: https://pypi.org/project/litellm/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-litellm-1.55.7-1.src.rpm
location_href: Packages/python-litellm-help-1.55.7-1.noarch.rpm
checksum_type: sha256
description:
  <h1 align="center">
          🚅 LiteLLM
      </h1>
      <p align="center">
          <p align="center">
          <a href="https://render.com/deploy?repo=https://github.com/BerriAI/litellm" target="_blank" rel="nofollow"><img src="https://render.com/images/deploy-to-render-button.svg" alt="Deploy to Render"></a>
          <a href="https://railway.app/template/HLP0Ub?referralCode=jch2ME">
            <img src="https://railway.app/button.svg" alt="Deploy on Railway">
          </a>
          </p>
          <p align="center">Call all LLM APIs using the OpenAI format [Bedrock, Huggingface, VertexAI, TogetherAI, Azure, OpenAI, Groq etc.]
          <br>
      </p>
  <h4 align="center"><a href="https://docs.litellm.ai/docs/simple_proxy" target="_blank">LiteLLM Proxy Server (LLM Gateway)</a> | <a href="https://docs.litellm.ai/docs/hosted" target="_blank"> Hosted Proxy (Preview)</a> | <a href="https://docs.litellm.ai/docs/enterprise"target="_blank">Enterprise Tier</a></h4>
  <h4 align="center">
      <a href="https://pypi.org/project/litellm/" target="_blank">
          <img src="https://img.shields.io/pypi/v/litellm.svg" alt="PyPI Version">
      </a>
      <a href="https://dl.circleci.com/status-badge/redirect/gh/BerriAI/litellm/tree/main" target="_blank">
          <img src="https://dl.circleci.com/status-badge/img/gh/BerriAI/litellm/tree/main.svg?style=svg" alt="CircleCI">
      </a>
      <a href="https://www.ycombinator.com/companies/berriai">
          <img src="https://img.shields.io/badge/Y%20Combinator-W23-orange?style=flat-square" alt="Y Combinator W23">
      </a>
      <a href="https://wa.link/huol9n">
          <img src="https://img.shields.io/static/v1?label=Chat%20on&message=WhatsApp&color=success&logo=WhatsApp&style=flat-square" alt="Whatsapp">
      </a>
      <a href="https://discord.gg/wuPM9dRgDw">
          <img src="https://img.shields.io/static/v1?label=Chat%20on&message=Discord&color=blue&logo=Discord&style=flat-square" alt="Discord">
      </a>
  </h4>

  LiteLLM manages:

  - Translate inputs to provider's `completion`, `embedding`, and `image_generation` endpoints
  - [Consistent output](https://docs.litellm.ai/docs/completion/output), text responses will always be available at `['choices'][0]['message']['content']`
  - Retry/fallback logic across multiple deployments (e.g. Azure/OpenAI) - [Router](https://docs.litellm.ai/docs/routing)
  - Set Budgets & Rate limits per project, api key, model [LiteLLM Proxy Server (LLM Gateway)](https://docs.litellm.ai/docs/simple_proxy)

  [**Jump to LiteLLM Proxy (LLM Gateway) Docs**](https://github.com/BerriAI/litellm?tab=readme-ov-file#openai-proxy---docs) <br>
  [**Jump to Supported LLM Providers**](https://github.com/BerriAI/litellm?tab=readme-ov-file#supported-providers-docs)

  🚨 **Stable Release:** Use docker images with the `-stable` tag. These have undergone 12 hour load tests, before being published.

  Support for more providers. Missing a provider or LLM Platform, raise a [feature request](https://github.com/BerriAI/litellm/issues/new?assignees=&labels=enhancement&projects=&template=feature_request.yml&title=%5BFeature%5D%3A+).



  > [!IMPORTANT]
  > LiteLLM v1.0.0 now requires `openai>=1.0.0`. Migration guide [here](https://docs.litellm.ai/docs/migration)
  > LiteLLM v1.40.14+ now requires `pydantic>=2.0.0`. No changes required.

  <a target="_blank" href="https://colab.research.google.com/github/BerriAI/litellm/blob/main/cookbook/liteLLM_Getting_Started.ipynb">
    <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
  </a>

  ```shell
  pip install litellm
  ```

  ```python
  from litellm import completion
  import os


  os.environ["OPENAI_API_KEY"] = "your-openai-key"
  os.environ["ANTHROPIC_API_KEY"] = "your-cohere-key"

  messages = [{ "content": "Hello, how are you?","role": "user"}]


  response = completion(model="openai/gpt-4o", messages=messages)


  response = completion(model="anthropic/claude-3-sonnet-20240229", messages=messages)
  print(response)
  ```



  ```json
  {
      "id": "chatcmpl-565d891b-a42e-4c39-8d14-82a1f5208885",
      "created": 1734366691,
      "model": "claude-3-sonnet-20240229",
      "object": "chat.completion",
      "system_fingerprint": null,
      "choices": [
          {
              "finish_reason": "stop",
              "index": 0,
              "message": {
                  "content": "Hello! As an AI language model, I don't have feelings, but I'm operating properly and ready to assist you with any questions or tasks you may have. How can I help you today?",
                  "role": "assistant",
                  "tool_calls": null,
                  "function_call": null
              }
          }
      ],
      "usage": {
          "completion_tokens": 43,
          "prompt_tokens": 13,
          "total_tokens": 56,
          "completion_tokens_details": null,
          "prompt_tokens_details": {
              "audio_tokens": null,
              "cached_tokens": 0
          },
          "cache_creation_input_tokens": 0,
          "cache_read_input_tokens": 0
      }
  }
  ```

  Call any model supported by a provider, with `model=<provider_name>/<model_name>`. There might be provider-specific details here, so refer to [provider docs for more information](https://docs.litellm.ai/docs/providers)



  ```python
  from litellm import acompletion
  import asyncio

  async def test_get_response():
      user_message = "Hello, how are you?"
      messages = [{"content": user_message, "role": "user"}]
      response = await acompletion(model="openai/gpt-4o", messages=messages)
      return response

  response = asyncio.run(test_get_response())
  print(response)
  ```



  liteLLM supports streaming the model response back, pass `stream=True` to get a streaming iterator in response.
  Streaming is supported for all models (Bedrock, Huggingface, TogetherAI, Azure, OpenAI, etc.)

  ```python
  from litellm import completion
  response = completion(model="openai/gpt-4o", messages=messages, stream=True)
  for part in response:
      print(part.choices[0].delta.content or "")


  response = completion('anthropic/claude-3-sonnet-20240229', messages, stream=True)
  for part in response:
      print(part)
  ```



  ```json
  {
      "id": "chatcmpl-2be06597-eb60-4c70-9ec5-8cd2ab1b4697",
      "created": 1734366925,
      "model": "claude-3-sonnet-20240229",
      "object": "chat.completion.chunk",
      "system_fingerprint": null,
      "choices": [
          {
              "finish_reason": null,
              "index": 0,
              "delta": {
                  "content": "Hello",
                  "role": "assistant",
                  "function_call": null,
                  "tool_calls": null,
                  "audio": null
              },
              "logprobs": null
          }
      ]
  }
  ```



  LiteLLM exposes pre defined callbacks to send data to Lunary, Langfuse, DynamoDB, s3 Buckets, Helicone, Promptlayer, Traceloop, Athina, Slack, MLflow

  ```python
  from litellm import completion


  os.environ["LUNARY_PUBLIC_KEY"] = "your-lunary-public-key"
  os.environ["HELICONE_API_KEY"] = "your-helicone-auth-key"
  os.environ["LANGFUSE_PUBLIC_KEY"] = ""
  os.environ["LANGFUSE_SECRET_KEY"] = ""
  os.environ["ATHINA_API_KEY"] = "your-athina-api-key"

  os.environ["OPENAI_API_KEY"]


  litellm.success_callback = ["lunary", "langfuse", "athina", "helicone"] # log input/output to lunary, langfuse, supabase, athina, helicone etc


  response = completion(model="anthropic/claude-3-sonnet-20240229", messages=[{"role": "user", "content": "Hi 👋 - i'm openai"}])
  ```



  Track spend + Load Balance across multiple projects

  [Hosted Proxy (Preview)](https://docs.litellm.ai/docs/hosted)

  The proxy provides:

  1. [Hooks for auth](https://docs.litellm.ai/docs/proxy/virtual_keys#custom-auth)
  2. [Hooks for logging](https://docs.litellm.ai/docs/proxy/logging#step-1---create-your-custom-litellm-callback-class)
  3. [Cost tracking](https://docs.litellm.ai/docs/proxy/virtual_keys#tracking-spend)
  4. [Rate Limiting](https://docs.litellm.ai/docs/proxy/users#set-rate-limits)






  ```shell
  pip install 'litellm[proxy]'
  ```



  ```shell
  $ litellm --model huggingface/bigcode/starcoder


  ```




  > [!IMPORTANT]
  > 💡 [Use LiteLLM Proxy with Langchain (Python, JS), OpenAI SDK (Python, JS) Anthropic SDK, Mistral SDK, LlamaIndex, Instructor, Curl](https://docs.litellm.ai/docs/proxy/user_keys)

  ```python
  import openai # openai v1.0.0+
  client = openai.OpenAI(api_key="anything",base_url="http://0.0.0.0:4000") # set proxy to base_url

  response = client.chat.completions.create(model="gpt-3.5-turbo", messages = [
      {
          "role": "user",
          "content": "this is a test request, write a short poem"
      }
  ])

  print(response)
  ```



  Connect the proxy with a Postgres DB to create proxy keys

  ```bash

  git clone https://github.com/BerriAI/litellm


  cd litellm


  echo 'LITELLM_MASTER_KEY="sk-1234"' > .env





  echo 'LITELLM_SALT_KEY="sk-1234"' > .env

  source .env


  docker-compose up
  ```


  UI on `/ui` on your proxy server
  ![ui_3](https://github.com/BerriAI/litellm/assets/29436595/47c97d5e-b9be-4839-b28c-43d7f4f10033)

  Set budgets and rate limits across multiple projects
  `POST /key/generate`



  ```shell
  curl 'http://0.0.0.0:4000/key/generate' \
  --header 'Authorization: Bearer sk-1234' \
  --header 'Content-Type: application/json' \
  --data-raw '{"models": ["gpt-3.5-turbo", "gpt-4", "claude-2"], "duration": "20m","metadata": {"user": "ishaan@berri.ai", "team": "core-infra"}}'
  ```



  ```shell
  {
      "key": "sk-kdEXbIqZRwEeEiHwdg7sFA", # Bearer token
      "expires": "2023-11-19T01:38:25.838000+00:00" # datetime object
  }
  ```



  | Provider                                                                            | [Completion](https://docs.litellm.ai/docs/#basic-usage) | [Streaming](https://docs.litellm.ai/docs/completion/stream#streaming-responses) | [Async Completion](https://docs.litellm.ai/docs/completion/stream#async-completion) | [Async Streaming](https://docs.litellm.ai/docs/completion/stream#async-streaming) | [Async Embedding](https://docs.litellm.ai/docs/embedding/supported_embedding) | [Async Image Generation](https://docs.litellm.ai/docs/image_generation) |
  |-------------------------------------------------------------------------------------|---------------------------------------------------------|---------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------|-------------------------------------------------------------------------------|-------------------------------------------------------------------------|
  | [openai](https://docs.litellm.ai/docs/providers/openai)                             | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 | ✅                                                                             | ✅                                                                       |
  | [azure](https://docs.litellm.ai/docs/providers/azure)                               | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 | ✅                                                                             | ✅                                                                       |
  | [aws - sagemaker](https://docs.litellm.ai/docs/providers/aws_sagemaker)             | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 | ✅                                                                             |                                                                         |
  | [aws - bedrock](https://docs.litellm.ai/docs/providers/bedrock)                     | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 | ✅                                                                             |                                                                         |
  | [google - vertex_ai](https://docs.litellm.ai/docs/providers/vertex)                 | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 | ✅                                                                             | ✅                                                                       |
  | [google - palm](https://docs.litellm.ai/docs/providers/palm)                        | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [google AI Studio - gemini](https://docs.litellm.ai/docs/providers/gemini)          | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [mistral ai api](https://docs.litellm.ai/docs/providers/mistral)                    | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 | ✅                                                                             |                                                                         |
  | [cloudflare AI Workers](https://docs.litellm.ai/docs/providers/cloudflare_workers)  | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [cohere](https://docs.litellm.ai/docs/providers/cohere)                             | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 | ✅                                                                             |                                                                         |
  | [anthropic](https://docs.litellm.ai/docs/providers/anthropic)                       | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [empower](https://docs.litellm.ai/docs/providers/empower)                    | ✅                                                      | ✅                                                                              | ✅                                                                                  | ✅                                                                                |
  | [huggingface](https://docs.litellm.ai/docs/providers/huggingface)                   | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 | ✅                                                                             |                                                                         |
  | [replicate](https://docs.litellm.ai/docs/providers/replicate)                       | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [together_ai](https://docs.litellm.ai/docs/providers/togetherai)                    | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [openrouter](https://docs.litellm.ai/docs/providers/openrouter)                     | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [ai21](https://docs.litellm.ai/docs/providers/ai21)                                 | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [baseten](https://docs.litellm.ai/docs/providers/baseten)                           | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [vllm](https://docs.litellm.ai/docs/providers/vllm)                                 | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [nlp_cloud](https://docs.litellm.ai/docs/providers/nlp_cloud)                       | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [aleph alpha](https://docs.litellm.ai/docs/providers/aleph_alpha)                   | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [petals](https://docs.litellm.ai/docs/providers/petals)                             | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [ollama](https://docs.litellm.ai/docs/providers/ollama)                             | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 | ✅                                                                             |                                                                         |
  | [deepinfra](https://docs.litellm.ai/docs/providers/deepinfra)                       | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [perplexity-ai](https://docs.litellm.ai/docs/providers/perplexity)                  | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [Groq AI](https://docs.litellm.ai/docs/providers/groq)                              | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [Deepseek](https://docs.litellm.ai/docs/providers/deepseek)                         | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [anyscale](https://docs.litellm.ai/docs/providers/anyscale)                         | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [IBM - watsonx.ai](https://docs.litellm.ai/docs/providers/watsonx)                  | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 | ✅                                                                             |                                                                         |
  | [voyage ai](https://docs.litellm.ai/docs/providers/voyage)                          |                                                         |                                                                                 |                                                                                     |                                                                                   | ✅                                                                             |                                                                         |
  | [xinference [Xorbits Inference]](https://docs.litellm.ai/docs/providers/xinference) |                                                         |                                                                                 |                                                                                     |                                                                                   | ✅                                                                             |                                                                         |
  | [FriendliAI](https://docs.litellm.ai/docs/providers/friendliai)                              | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |
  | [Galadriel](https://docs.litellm.ai/docs/providers/galadriel)                              | ✅                                                       | ✅                                                                               | ✅                                                                                   | ✅                                                                                 |                                                                               |                                                                         |

  [**Read the Docs**](https://docs.litellm.ai/docs/)



  To contribute: Clone the repo locally -> Make a change -> Submit a PR with the change.

  Here's how to modify the repo locally:
  Step 1: Clone the repo

  ```
  git clone https://github.com/BerriAI/litellm.git
  ```

  Step 2: Navigate into the project, and install dependencies:

  ```
  cd litellm
  poetry install -E extra_proxy -E proxy
  ```

  Step 3: Test your change:

  ```
  cd litellm/tests # pwd: Documents/litellm/litellm/tests
  poetry run flake8
  poetry run pytest .
  ```

  Step 4: Submit a PR with your changes! 🚀

  - push your fork to your GitHub repo
  - submit a PR from there



  Follow these instructions if you want to build / run the LiteLLM Docker Image yourself.

  Step 1: Clone the repo

  ```
  git clone https://github.com/BerriAI/litellm.git
  ```

  Step 2: Build the Docker Image

  Build using Dockerfile.non_root
  ```
  docker build -f docker/Dockerfile.non_root -t litellm_test_image .
  ```

  Step 3: Run the Docker Image

  Make sure config.yaml is present in the root directory. This is your litellm proxy config file.
  ```
  docker run \
      -v $(pwd)/proxy_config.yaml:/app/config.yaml \
      -e DATABASE_URL="postgresql://xxxxxxxx" \
      -e LITELLM_MASTER_KEY="sk-1234" \
      -p 4000:4000 \
      litellm_test_image \
      --config /app/config.yaml --detailed_debug
  ```


  For companies that need better security, user management and professional support

  [Talk to founders](https://calendly.com/d/4mp-gd3-k5k/litellm-1-1-onboarding-chat)

  This covers:
  - ✅ **Features under the [LiteLLM Commercial License](https://docs.litellm.ai/docs/proxy/enterprise):**
  - ✅ **Feature Prioritization**
  - ✅ **Custom Integrations**
  - ✅ **Professional Support - Dedicated discord + slack**
  - ✅ **Custom SLAs**
  - ✅ **Secure access with Single Sign-On**



  LiteLLM follows the [Google Python Style Guide](https://google.github.io/styleguide/pyguide.html).

  We run:
  - Ruff for [formatting and linting checks](https://github.com/BerriAI/litellm/blob/e19bb55e3b4c6a858b6e364302ebbf6633a51de5/.circleci/config.yml#L320)
  - Mypy + Pyright for typing [1](https://github.com/BerriAI/litellm/blob/e19bb55e3b4c6a858b6e364302ebbf6633a51de5/.circleci/config.yml#L90), [2](https://github.com/BerriAI/litellm/blob/e19bb55e3b4c6a858b6e364302ebbf6633a51de5/.pre-commit-config.yaml#L4)
  - Black for [formatting](https://github.com/BerriAI/litellm/blob/e19bb55e3b4c6a858b6e364302ebbf6633a51de5/.circleci/config.yml#L79)
  - isort for [import sorting](https://github.com/BerriAI/litellm/blob/e19bb55e3b4c6a858b6e364302ebbf6633a51de5/.pre-commit-config.yaml#L10)


  If you have suggestions on how to improve the code quality feel free to open an issue or a PR.




  - [Schedule Demo 👋](https://calendly.com/d/4mp-gd3-k5k/berriai-1-1-onboarding-litellm-hosted-version)
  - [Community Discord 💭](https://discord.gg/wuPM9dRgDw)
  - Our numbers 📞 +1 (770) 8783-106 / ‭+1 (412) 618-6238‬
  - Our emails ✉️ ishaan@berri.ai / krrish@berri.ai



  - **Need for simplicity**: Our code started to get extremely complicated managing & translating calls between Azure, OpenAI and Cohere.



  <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
  <!-- prettier-ignore-start -->
  <!-- markdownlint-disable -->

  <!-- markdownlint-restore -->
  <!-- prettier-ignore-end -->

  <!-- ALL-CONTRIBUTORS-LIST:END -->

  <a href="https://github.com/BerriAI/litellm/graphs/contributors">
    <img src="https://contrib.rocks/image?repo=BerriAI/litellm" />
  </a>


pkgId: f152f8a53a4a9e1ac99f7ec507fbfd3e9428ef0e83ee681acc5a08bebfad2e06
name: python-litestar-granian-help
arch: noarch
version: 0.9.0
epoch: 0
release: 1
summary: Development documents and examples for litestar-granian
url: https://cofin.github.io/litesatr-granian/latest/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-litestar-granian-0.9.0-1.src.rpm
location_href: Packages/python-litestar-granian-help-0.9.0-1.noarch.rpm
checksum_type: sha256
description:
  ```shell
  pip install litestar-granian
  ```



  Here is a basic application that demonstrates how to use the plugin.

  ```python
  from __future__ import annotations

  from litestar import Controller, Litestar, get

  from litestar_granian import GranianPlugin


  class SampleController(Controller):
      @get(path="/sample")
      async def sample_route(self ) -> dict[str, str]:
          """Sample Route."""
          return {"sample": "hello-world"}


  app = Litestar(plugins=[GranianPlugin()], route_handlers=[SampleController])

  ```

  Now, you can use the standard Litestar CLI and it will run with Granian instead of Uvicorn.

  ```shell
  ❯ litestar --app examples.basic:app run
  Using Litestar app from env: 'examples.basic:app'
  Starting granian server process ──────────────────────────────────────────────
  ┌──────────────────────────────┬──────────────────────┐
  │ Litestar version             │ 2.1.1                │
  │ Debug mode                   │ Disabled             │
  │ Python Debugger on exception │ Disabled             │
  │ CORS                         │ Disabled             │
  │ CSRF                         │ Disabled             │
  │ OpenAPI                      │ Enabled path=/schema │
  │ Compression                  │ Disabled             │
  └──────────────────────────────┴──────────────────────┘
  [INFO] Starting granian
  [INFO] Listening at: 127.0.0.1:8000
  [INFO] Spawning worker-1 with pid: 2719082
  [INFO] Started worker-1
  [INFO] Started worker-1 runtime-1
  ```


pkgId: aedae7c0d519cdb0416fb6146bc5459e943c901d4a1df0643a94f0ca99d55efe
name: python-litestar-msgspec-debuginfo
arch: aarch64
version: 0.19.0
epoch: 0
release: 1
summary: Debug information for package python-litestar-msgspec
url: https://jcristharif.com/msgspec/
rpm_license: BSD
rpm_group: Development/Debug
rpm_buildhost: localhost
rpm_sourcerpm: python-litestar-msgspec-0.19.0-1.src.rpm
location_href: Packages/python-litestar-msgspec-debuginfo-0.19.0-1.aarch64.rpm
checksum_type: sha256
description:
  This package provides debug information for package python-litestar-msgspec.
  Debug information is useful when developing applications that use this
  package or when debugging this package.


pkgId: 8695f8fe98dc44ef4cc71a6ba1f259c9d5bf7818247439f796da23e96fdb2a20
name: python-litestar-msgspec-debugsource
arch: aarch64
version: 0.19.0
epoch: 0
release: 1
summary: Debug sources for package python-litestar-msgspec
url: https://jcristharif.com/msgspec/
rpm_license: BSD
rpm_group: Development/Debug
rpm_buildhost: localhost
rpm_sourcerpm: python-litestar-msgspec-0.19.0-1.src.rpm
location_href: Packages/python-litestar-msgspec-debugsource-0.19.0-1.aarch64.rpm
checksum_type: sha256
description:
  This package provides debug sources for package python-litestar-msgspec.
  Debug sources are useful when developing applications that use this
  package or when debugging this package.


pkgId: c61083b1cd81b10142b808c9cf3567eb2a3c1a99a20e5c73006542e8ecb53a03
name: python-litestar-msgspec-help
arch: aarch64
version: 0.19.0
epoch: 0
release: 1
summary: Development documents and examples for litestar-msgspec
url: https://jcristharif.com/msgspec/
rpm_license: BSD
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-litestar-msgspec-0.19.0-1.src.rpm
location_href: Packages/python-litestar-msgspec-help-0.19.0-1.aarch64.rpm
checksum_type: sha256
description:
  `msgspec` may be used for serialization alone, as a faster JSON or
  MessagePack library. For the greatest benefit though, we recommend using
  `msgspec` to handle the full serialization & validation workflow:
  **Define** your message schemas using standard Python type annotations.
  ```python
  >>> import msgspec
  >>> class User(msgspec.Struct):
  ```
  **Encode** messages as JSON, or one of the many other supported protocols.
  ```python
  >>> alice = User("alice", groups={"admin", "engineering"})
  >>> alice
  User(name='alice', groups={"admin", "engineering"}, email=None)
  >>> msg = msgspec.json.encode(alice)
  >>> msg
  b'{"name":"alice","groups":["admin","engineering"],"email":null}'
  ```
  **Decode** messages back into Python objects, with optional schema validation.
  ```python
  >>> msgspec.json.decode(msg, type=User)
  User(name='alice', groups={"admin", "engineering"}, email=None)
  >>> msgspec.json.decode(b'{"name":"bob","groups":[123]}', type=User)
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  msgspec.ValidationError: Expected `str`, got `int` - at `$.groups[0]`
  ```
  `msgspec` is designed to be as performant as possible, while retaining some of
  the nicities of validation libraries like
  [pydantic](https://pydantic-docs.helpmanual.io/). For supported types,
  encoding/decoding a message with `msgspec` can be
  [~10-80x faster than alternative libraries](https://jcristharif.com/msgspec/benchmarks.html).
  <p align="center">
    <a href="https://jcristharif.com/msgspec/benchmarks.html">
      <img src="https://raw.githubusercontent.com/jcrist/msgspec/main/docs/source/_static/bench-validation.svg">
    </a>
  </p>
  See [the documentation](https://jcristharif.com/msgspec/) for more information.

  New BSD. See the
  [License File](https://github.com/jcrist/msgspec/blob/main/LICENSE).


pkgId: e1774376238bd398a652cb4df4c9caf11bddaaef6a81dcbeedc6494bfff5d3a3
name: python-litserve-help
arch: noarch
version: 0.2.5
epoch: 0
release: 1
summary: Development documents and examples for litserve
url: https://github.com/Lightning-AI/litserve
rpm_license: Apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-litserve-0.2.5-1.src.rpm
location_href: Packages/python-litserve-help-0.2.5-1.noarch.rpm
checksum_type: sha256
description:
  **LitServe** is an easy-to-use, flexible serving engine for AI models built on FastAPI. It augments FastAPI with features like batching, streaming, and GPU autoscaling eliminate the need to rebuild a FastAPI server per model.
  LitServe is at least [2x faster](#performance) than plain FastAPI due to AI-specific multi-worker handling.
  <div align='center'>
  <pre>
  ✅ (2x)+ faster serving  ✅ Easy to use          ✅ LLMs, non LLMs and more
  ✅ Bring your own model  ✅ PyTorch/JAX/TF/...   ✅ Built on FastAPI
  ✅ GPU autoscaling       ✅ Batching, Streaming  ✅ Self-host or ⚡️ managed
  ✅ Compound AI           ✅ Integrate with vLLM and more
  </pre>
  <div align='center'>
  [![Discord](https://img.shields.io/discord/1077906959069626439?label=Get%20help%20on%20Discord)](https://discord.gg/WajDThKAur)
  ![cpu-tests](https://github.com/Lightning-AI/litserve/actions/workflows/ci-testing.yml/badge.svg)
  [![codecov](https://codecov.io/gh/Lightning-AI/litserve/graph/badge.svg?token=SmzX8mnKlA)](https://codecov.io/gh/Lightning-AI/litserve)
  [![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/Lightning-AI/litserve/blob/main/LICENSE)
  </div>
  </div>
  <div align="center">
    <div style="text-align: center;">
      <a target="_blank" href="#quick-start" style="margin: 0 10px;">Quick start</a> •
      <a target="_blank" href="#featured-examples" style="margin: 0 10px;">Examples</a> •
      <a target="_blank" href="#features" style="margin: 0 10px;">Features</a> •
      <a target="_blank" href="#performance" style="margin: 0 10px;">Performance</a> •
      <a target="_blank" href="#hosting-options" style="margin: 0 10px;">Hosting</a> •
      <a target="_blank" href="https://lightning.ai/docs/litserve" style="margin: 0 10px;">Docs</a>
    </div>
  </div>
  &nbsp;
  <div align="center">
  <a target="_blank" href="https://lightning.ai/docs/litserve/home/get-started">
    <img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/get-started-badge.svg" height="36px" alt="Get started"/>
  </a>
  </div>
  &nbsp;

  Install LitServe via pip ([more options](https://lightning.ai/docs/litserve/home/install)):
  ```bash
  pip install litserve
  ```

  This toy example with 2 models (AI compound system) shows LitServe's flexibility ([see real examples](#examples)):
  ```python

  import litserve as ls

  class SimpleLitAPI(ls.LitAPI):
      def setup(self, device):
          
          self.model1 = lambda x: x**2
          self.model2 = lambda x: x**3
      def decode_request(self, request):
          
          return request["input"]
      def predict(self, x):
          
          squared = self.model1(x)
          cubed = self.model2(x)
          output = squared + cubed
          return {"output": output}
      def encode_response(self, output):
          
          return {"output": output}

  if __name__ == "__main__":
      
      server = ls.LitServer(SimpleLitAPI(), accelerator="auto", max_batch_size=1)
      server.run(port=8000)
  ```
  Now run the server via the command-line
  ```bash
  python server.py
  ```

  Run the auto-generated test client:
  ```bash
  python client.py
  ```
  Or use this terminal command:
  ```bash
  curl -X POST http://127.0.0.1:8000/predict -H "Content-Type: application/json" -d '{"input": 4.0}'
  ```

  LitServe isn’t *just* for LLMs like vLLM or Ollama; it serves any AI model with full control over internals ([learn more](https://lightning.ai/docs/litserve/features/serve-llms)).
  For easy LLM serving, integrate [vLLM with LitServe](https://lightning.ai/lightning-ai/studios/deploy-a-private-llama-3-2-rag-api), or use [LitGPT](https://github.com/Lightning-AI/litgpt?tab=readme-ov-file#deploy-an-llm) (built on LitServe).
  ```
  litgpt serve microsoft/phi-2
  ```

  - LitAPI lets you easily build complex AI systems with one or more models ([docs](https://lightning.ai/docs/litserve/api-reference/litapi)).
  - Use the setup method for one-time tasks like connecting models, DBs, and loading data ([docs](https://lightning.ai/docs/litserve/api-reference/litapi#setup)).
  - LitServer handles optimizations like batching, GPU autoscaling, streaming, etc... ([docs](https://lightning.ai/docs/litserve/api-reference/litserver)).
  - Self host on your own machines or use Lightning Studios for a fully managed deployment ([learn more](#hosting-options)).
  [Learn how to make this server 200x faster](https://lightning.ai/docs/litserve/home/speed-up-serving-by-200x).
  &nbsp;

  Use LitServe to deploy any model or AI service: (Compound AI, Gen AI, classic ML, embeddings, LLMs, vision, audio, etc...)
  <div align='center'>
    <div width='200px'>
          <video src="https://github.com/user-attachments/assets/5e73549a-bc0f-47a9-9d9c-5b54389be5de" width='200px' controls></video>
    </div>
  </div>

  <pre>
  <strong>Toy model:</strong>      <a target="_blank" href="#define-a-server">Hello world</a>
  <strong>LLMs:</strong>           <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-llama-3-2-vision-with-litserve">Llama 3.2</a>, <a target="_blank" href="https://lightning.ai/lightning-ai/studios/openai-fault-tolerant-proxy-server">LLM Proxy server</a>, <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-ai-agent-with-tool-use">Agent with tool use</a>
  <strong>RAG:</strong>            <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-a-private-llama-3-2-rag-api">vLLM RAG (Llama 3.2)</a>, <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-a-private-llama-3-1-rag-api">RAG API (LlamaIndex)</a>
  <strong>NLP:</strong>            <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-any-hugging-face-model-instantly">Hugging face</a>, <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-a-hugging-face-bert-model">BERT</a>, <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-text-embedding-api-with-litserve">Text embedding API</a>
  <strong>Multimodal:</strong>     <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-open-ai-clip-with-litserve">OpenAI Clip</a>, <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-a-multi-modal-llm-with-minicpm">MiniCPM</a>, <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-phi3-5-vision-api-with-litserve">Phi-3.5 Vision Instruct</a>, <a target="_blank" href="https://lightning.ai/bhimrajyadav/studios/deploy-and-chat-with-qwen2-vl-using-litserve">Qwen2-VL</a>, <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-a-multi-modal-llm-with-pixtral">Pixtral</a>
  <strong>Audio:</strong>          <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-open-ai-s-whisper-model">Whisper</a>, <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-an-music-generation-api-with-meta-s-audio-craft">AudioCraft</a>, <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-an-audio-generation-api">StableAudio</a>, <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-a-noise-cancellation-api-with-deepfilternet">Noise cancellation (DeepFilterNet)</a>
  <strong>Vision:</strong>         <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-a-private-api-for-stable-diffusion-2">Stable diffusion 2</a>, <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-an-image-generation-api-with-auraflow">AuraFlow</a>, <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-an-image-generation-api-with-flux">Flux</a>, <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-a-super-resolution-image-api-with-aura-sr">Image Super Resolution (Aura SR)</a>,
                  <a target="_blank" href="https://lightning.ai/bhimrajyadav/studios/deploy-background-removal-api-with-litserve">Background Removal</a>, <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-a-controlled-image-generation-api-controlnet">Control Stable Diffusion (ControlNet)</a>
  <strong>Speech:</strong>         <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-a-voice-clone-api-coqui-xtts-v2-model">Text-speech (XTTS V2)</a>, <a target="_blank" href="https://lightning.ai/bhimrajyadav/studios/deploy-a-speech-generation-api-using-parler-tts-powered-by-litserve">Parler-TTS</a>
  <strong>Classical ML:</strong>   <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-random-forest-with-litserve">Random forest</a>, <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-xgboost-with-litserve">XGBoost</a>
  <strong>Miscellaneous:</strong>  <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-an-media-conversion-api-with-ffmpeg">Media conversion API (ffmpeg)</a>, <a target="_blank" href="https://lightning.ai/lightning-ai/studios/deploy-both-pytorch-and-tensorflow-in-a-single-api">PyTorch + TensorFlow in one API</a>
  </pre>
  </pre>
  [Browse 100+ community-built templates](https://lightning.ai/studios?section=serving)
  &nbsp;

  State-of-the-art features:
  ✅ [(2x)+ faster than plain FastAPI](#performance)
  ✅ [Bring your own model](https://lightning.ai/docs/litserve/features/full-control)
  ✅ [Build compound systems (1+ models)](https://lightning.ai/docs/litserve/home)
  ✅ [GPU autoscaling](https://lightning.ai/docs/litserve/features/gpu-inference)
  ✅ [Batching](https://lightning.ai/docs/litserve/features/batching)
  ✅ [Streaming](https://lightning.ai/docs/litserve/features/streaming)
  ✅ [Worker autoscaling](https://lightning.ai/docs/litserve/features/autoscaling)
  ✅ [Self-host on your machines](https://lightning.ai/docs/litserve/features/hosting-methods#host-on-your-own)
  ✅ [Host fully managed on Lightning AI](https://lightning.ai/docs/litserve/features/hosting-methods#host-on-lightning-studios)
  ✅ [Serve all models: (LLMs, vision, etc.)](https://lightning.ai/docs/litserve/examples)
  ✅ [Scale to zero (serverless)](https://lightning.ai/docs/litserve/features/streaming)
  ✅ [Supports PyTorch, JAX, TF, etc...](https://lightning.ai/docs/litserve/features/full-control)
  ✅ [OpenAPI compliant](https://www.openapis.org/)
  ✅ [Open AI compatibility](https://lightning.ai/docs/litserve/features/open-ai-spec)
  ✅ [Authentication](https://lightning.ai/docs/litserve/features/authentication)
  ✅ [Dockerization](https://lightning.ai/docs/litserve/features/dockerization-deployment)
  [10+ features...](https://lightning.ai/docs/litserve/features)
  **Note:** We prioritize scalable, enterprise-level features over hype.
  &nbsp;

  LitServe is designed for AI workloads. Specialized multi-worker handling delivers a minimum **2x speedup over FastAPI**.
  Additional features like batching and GPU autoscaling can drive performance well beyond 2x, scaling efficiently to handle more simultaneous requests than FastAPI and TorchServe.
  Reproduce the full benchmarks [here](https://lightning.ai/docs/litserve/home/benchmarks) (higher is better).
  <div align="center">
    <img alt="LitServe" src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/ls_charts_v6.png" width="1000px" style="max-width: 100%;">
  </div>
  These results are for image and text classification ML tasks. The performance relationships hold for other ML tasks (embedding, LLM serving, audio, segmentation, object detection, summarization etc...).
  ***💡 Note on LLM serving:*** For high-performance LLM serving (like Ollama/vLLM), integrate [vLLM with LitServe](https://lightning.ai/lightning-ai/studios/deploy-a-private-llama-3-2-rag-api), use [LitGPT](https://github.com/Lightning-AI/litgpt?tab=readme-ov-file#deploy-an-llm), or build your custom vLLM-like server with LitServe. Optimizations like kv-caching, which can be done with LitServe, are needed to maximize LLM performance.
  &nbsp;

  LitServe can be hosted independently on your own machines or fully managed via Lightning Studios.
  Self-hosting is ideal for hackers, students, and DIY developers, while fully managed hosting is ideal for enterprise developers needing easy autoscaling, security, release management, and 99.995% uptime and observability.
  &nbsp;
  <div align="center">
  <a target="_blank" href="https://lightning.ai/lightning-ai/studios/litserve-hello-world">
    <img src="https://pl-bolts-doc-images.s3.us-east-2.amazonaws.com/app-2/host-on-lightning.svg" alt="Host on Lightning"/>
  </a>
  </div>
  &nbsp;
  <div align='center'>
  | Feature                          | Self Managed                      | Fully Managed on Studios            |
  |----------------------------------|-----------------------------------|-------------------------------------|
  | Deployment                       | ✅ Do it yourself deployment      | ✅ One-button cloud deploy          |
  | Load balancing                   | ❌                                | ✅                                  |
  | Autoscaling                      | ❌                                | ✅                                  |
  | Scale to zero                    | ❌                                | ✅                                  |
  | Multi-machine inference          | ❌                                | ✅                                  |
  | Authentication                   | ❌                                | ✅                                  |
  | Own VPC                          | ❌                                | ✅                                  |
  | AWS, GCP                         | ❌                                | ✅                                  |
  | Use your own cloud commits       | ❌                                | ✅                                  |
  </div>
  &nbsp;

  LitServe is a [community project accepting contributions](https://lightning.ai/docs/litserve/community) - Let's make the world's most advanced AI inference engine.
  💬 [Get help on Discord](https://discord.com/invite/XncpTy7DSt)
  📋 [License: Apache 2.0](https://github.com/Lightning-AI/litserve/blob/main/LICENSE)


pkgId: 5b2854fdb7209c5523a4b210de43f043381aa1e530fcf3e1d11359e8b68c0785
name: python-littlehorse-client-help
arch: noarch
version: 0.12.1
epoch: 0
release: 1
summary: Development documents and examples for littlehorse-client
url: https://littlehorse.dev
rpm_license: SSPL-1.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-littlehorse-client-0.12.1-1.src.rpm
location_href: Packages/python-littlehorse-client-help-0.12.1-1.noarch.rpm
checksum_type: sha256
description:
  For documentation on how to use this library, please go to [the LittleHorse website](https://littlehorse.dev).

  For examples go to the [examples](./examples/) folder.



  - Install python.
  - Install [poetry](https://python-poetry.org/): `brew install poetry`
  - Install grpc tools: `pip3 install grpcio-tools`



  ```
  poetry install
  ```



  ```
  ../local-dev/compile-proto.sh
  ```



  ```
  poetry shell
  python -m unittest discover -v
  ```



  Set python version:

  ```
  poetry env use python3.9
  ```



  Task arguments type reference:

  ```
  VariableType.JSON_OBJ: dict[str, Any]
  VariableType.JSON_ARR: list[Any]
  VariableType.DOUBLE:   float
  VariableType.BOOL:     bool
  VariableType.STR:      str
  VariableType.INT:      int
  VariableType.BYTES:    bytes
  ```


pkgId: 1df41f98279b14790a4ea1b155e71de152c926e1e707e8ced34a3042a31ca44e
name: python-livereload-help
arch: noarch
version: 2.7.1
epoch: 0
release: 1
summary: Development documents and examples for livereload
url: https://github.com/lepture/python-livereload
rpm_license: BSD
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-livereload-2.7.1-1.src.rpm
location_href: Packages/python-livereload-help-2.7.1-1.noarch.rpm
checksum_type: sha256
description:
  Reload webpages on changes, without hitting refresh in your browser.



  <!-- start install -->

  LiveReload is for web developers who know Python. It is available on [PyPI].

  ```
  $ pip install livereload
  ```

  [pypi]: https://pypi.python.org/pypi/livereload

  <!-- end install -->



  [LiveReload's documentation is hosted on ReadTheDocs][docs].

  [docs]: https://livereload.readthedocs.io/en/latest/



  To report a security vulnerability, please use the [Tidelift security contact].
  Tidelift will coordinate the fix and disclosure.

  [tidelift security contact]: https://tidelift.com/security


pkgId: d661f1c2e612f22924e83a8f6fa36bd285de13070ea92299eeeb4c287642add8
name: python-livewrapped-sdk-help
arch: noarch
version: 0.0.4
epoch: 0
release: 1
summary: Development documents and examples for livewrapped-sdk
url: https://github.com/eivl/livewrapped-sdk-python
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-livewrapped-sdk-0.0.4-1.src.rpm
location_href: Packages/python-livewrapped-sdk-help-0.0.4-1.noarch.rpm
checksum_type: sha256
description:
  [![PyPI version](https://img.shields.io/pypi/v/livewrapped_sdk.svg)](https://pypi.org/project/livewrapped_sdk/)

  The Livewrapped SDK Python library provides convenient access to the Livewrapped SDK REST API from any Python 3.8+
  application. The library includes type definitions for all request params and response fields,
  and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).




  The REST API documentation can be found on [api.livewrapped.com](https://api.livewrapped.com/index.html). The full API of this library can be found in [api.md](https://github.com/eivl/livewrapped-sdk-python/tree/main/api.md).



  ```sh

  pip install livewrapped-sdk
  ```



  The full API of this library can be found in [api.md](https://github.com/eivl/livewrapped-sdk-python/tree/main/api.md).

  ```python
  import os
  from livewrapped_sdk import LivewrappedSDK

  client = LivewrappedSDK(
      bearer_token=os.environ.get("BEARER_TOKEN"),  # This is the default and can be omitted
  )

  response = client.account.login(
      email="x",
      password="x",
  )
  ```

  While you can provide a `bearer_token` keyword argument,
  we recommend using [python-dotenv](https://pypi.org/project/python-dotenv/)
  to add `BEARER_TOKEN="My Bearer Token"` and `LIVEWRAPPED_SDK_BASE_URL=https://yourlivewrapped.url.here`to your `.env` file
  so that your Bearer Token is not stored in source control. Then you can just use `load_dotenv()` and continue as normal.



  Simply import `AsyncLivewrappedSDK` instead of `LivewrappedSDK` and use `await` with each API call:

  ```python
  import os
  import asyncio
  from livewrapped_sdk import AsyncLivewrappedSDK

  client = AsyncLivewrappedSDK(
      bearer_token=os.environ.get("BEARER_TOKEN"),  # This is the default and can be omitted
  )


  async def main() -> None:
      response = await client.account.login(
          email="x",
          password="x",
      )


  asyncio.run(main())
  ```

  Functionality between the synchronous and asynchronous clients is otherwise identical.



  Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:

  - Serializing back into JSON, `model.to_json()`
  - Converting to a dictionary, `model.to_dict()`

  Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.



  When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `livewrapped_sdk.APIConnectionError` is raised.

  When the API returns a non-success status code (that is, 4xx or 5xx
  response), a subclass of `livewrapped_sdk.APIStatusError` is raised, containing `status_code` and `response` properties.

  All errors inherit from `livewrapped_sdk.APIError`.

  ```python
  import livewrapped_sdk
  from livewrapped_sdk import LivewrappedSDK

  client = LivewrappedSDK()

  try:
      client.account.login(
          email="x",
          password="x",
      )
  except livewrapped_sdk.APIConnectionError as e:
      print("The server could not be reached")
      print(e.__cause__)  # an underlying Exception, likely raised within httpx.
  except livewrapped_sdk.RateLimitError as e:
      print("A 429 status code was received; we should back off a bit.")
  except livewrapped_sdk.APIStatusError as e:
      print("Another non-200-range status code was received")
      print(e.status_code)
      print(e.response)
  ```

  Error codes are as followed:

  | Status Code | Error Type                 |
  | ----------- | -------------------------- |
  | 400         | `BadRequestError`          |
  | 401         | `AuthenticationError`      |
  | 403         | `PermissionDeniedError`    |
  | 404         | `NotFoundError`            |
  | 422         | `UnprocessableEntityError` |
  | 429         | `RateLimitError`           |
  | >=500       | `InternalServerError`      |
  | N/A         | `APIConnectionError`       |



  Certain errors are automatically retried 2 times by default, with a short exponential backoff.
  Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
  429 Rate Limit, and >=500 Internal errors are all retried by default.

  You can use the `max_retries` option to configure or disable retry settings:

  ```python
  from livewrapped_sdk import LivewrappedSDK


  client = LivewrappedSDK(
      
      max_retries=0,
  )


  client.with_options(max_retries=5).account.login(
      email="x",
      password="x",
  )
  ```



  By default requests time out after 1 minute. You can configure this with a `timeout` option,
  which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:

  ```python
  from livewrapped_sdk import LivewrappedSDK


  client = LivewrappedSDK(
      
      timeout=20.0,
  )


  client = LivewrappedSDK(
      timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),
  )


  client.with_options(timeout=5.0).account.login(
      email="x",
      password="x",
  )
  ```

  On timeout, an `APITimeoutError` is thrown.

  Note that requests that time out are [retried twice by default](https://github.com/eivl/livewrapped-sdk-python/tree/main/#retries).





  We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.

  You can enable logging by setting the environment variable `LIVEWRAPPED_SDK_LOG` to `info`.

  ```shell
  $ export LIVEWRAPPED_SDK_LOG=info
  ```

  Or to `debug` for more verbose logging.



  In an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:

  ```py
  if response.my_field is None:
    if 'my_field' not in response.model_fields_set:
      print('Got json like {}, without a "my_field" key present at all.')
    else:
      print('Got json like {"my_field": null}.')
  ```



  The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,

  ```py
  from livewrapped_sdk import LivewrappedSDK

  client = LivewrappedSDK()
  response = client.account.with_raw_response.login(
      email="x",
      password="x",
  )
  print(response.headers.get('X-My-Header'))

  account = response.parse()  # get the object that `account.login()` would have returned
  print(account)
  ```

  These methods return an [`APIResponse`](https://github.com/eivl/livewrapped-sdk-python/tree/main/src/livewrapped_sdk/_response.py) object.

  The async client returns an [`AsyncAPIResponse`](https://github.com/eivl/livewrapped-sdk-python/tree/main/src/livewrapped_sdk/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.



  The above interface eagerly reads the full response body when you make the request, which may not always be what you want.

  To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.

  ```python
  with client.account.with_streaming_response.login(
      email="x",
      password="x",
  ) as response:
      print(response.headers.get("X-My-Header"))

      for line in response.iter_lines():
          print(line)
  ```

  The context manager is required so that the response will reliably be closed.



  This library is typed for convenient access to the documented API.

  If you need to access undocumented endpoints, params, or response properties, the library can still be used.



  To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other
  http verbs. Options on the client will be respected (such as retries) will be respected when making this
  request.

  ```py
  import httpx

  response = client.post(
      "/foo",
      cast_to=httpx.Response,
      body={"my_param": True},
  )

  print(response.headers.get("x-foo"))
  ```



  If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request
  options.



  To access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You
  can also get all the extra fields on the Pydantic model as a dict with
  [`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).



  You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:

  - Support for proxies
  - Custom transports
  - Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality

  ```python
  from livewrapped_sdk import LivewrappedSDK, DefaultHttpxClient

  client = LivewrappedSDK(
      
      base_url="http://my.test.server.example.com:8083",
      http_client=DefaultHttpxClient(
          proxies="http://my.test.proxy.example.com",
          transport=httpx.HTTPTransport(local_address="0.0.0.0"),
      ),
  )
  ```

  You can also customize the client on a per-request basis by using `with_options()`:

  ```python
  client.with_options(http_client=DefaultHttpxClient(...))
  ```



  By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.



  This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes that only affect static types, without breaking runtime behavior.
  2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
  3. Changes that we do not expect to impact the vast majority of users in practice.

  We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

  We are keen for your feedback; please open an [issue](https://www.github.com/eivl/livewrapped-sdk-python/issues) with questions, bugs, or suggestions.



  If you've upgraded to the latest version but aren't seeing any new features you were expecting then your python environment is likely still using an older version.

  You can determine the version that is being used at runtime with:

  ```py
  import livewrapped_sdk
  print(livewrapped_sdk.__version__)
  ```



  Python 3.8 or higher.



  See [the contributing documentation](https://github.com/eivl/livewrapped-sdk-python/tree/main/./CONTRIBUTING.md).


pkgId: a8883a41be7487fcbe5cc4ee137e2ef0bbfeb8aa8e66b316ae60165cb61b612e
name: python-lkj-help
arch: noarch
version: 0.1.33
epoch: 0
release: 1
summary: Development documents and examples for lkj
url: https://github.com/thorwhalen/lkj
rpm_license: apache-2.0
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-lkj-0.1.33-1.src.rpm
location_href: Packages/python-lkj-help-0.1.33-1.noarch.rpm
checksum_type: sha256
description:
  Lightweight Kit Jumpstart. A place for useful python utils built only with pure python.

  To install:	```pip install lkj```

  [Documentation](https://i2mint.github.io/lkj)

  Note: None of the tools here require anything else but pure python.
  Additionally, things are organized in such a way that these can be
  easily copy-pasted into other projects.
  That is, modules are all self contained (so can easily be copy-paste-vendored
  (do be nice and mention the source!))
  Further, many functions will contain their own imports: Those functions can even be
  copy-paste-vendored by just copying the function body.








  Conditional log

  ```python
  >>> clog(False, "logging this")
  >>> clog(True, "logging this")
  logging this
  ```

  One common usage is when there's a verbose flag that allows the user to specify
  whether they want to log or not. Instead of having to litter your code with
  `if verbose:` statements you can just do this:

  ```python
  >>> verbose = True  # say versbose is True
  >>> _clog = clog(verbose)  # makes a clog with a fixed condition
  >>> _clog("logging this")
  logging this
  ```

  You can also choose a different log function.
  Usually you'd want to use a logger object from the logging module,
  but for this example we'll just use `print` with some modification:

  ```python
  >>> _clog = clog(verbose, log_func=lambda x: print(f"hello {x}"))
  >>> _clog("logging this")
  hello logging this
  ```



  Prints with a timestamp and optional refresh.
  - input: message, and possibly args (to be placed in the message string, sprintf-style
  - output: Displays the time (HH:MM:SS), and the message
  - use: To be able to track processes (and the time they take)

  ```python
  >>> print_with_timestamp('processing element X')
  (29)09:56:36 - processing element X
  ```



  Decorator that returns traceback and local variables on error.

  This decorator is useful for debugging. It will catch any exceptions that occur
  in the decorated function, and return an ErrorInfo object with the traceback and
  local variables at the time of the error.
  - `func`: The function to decorate.
  - `caught_error_types`: The types of errors to catch.
  - `error_info_processor`: A function that processes the ErrorInfo object.

  Tip: To parametrize this decorator, you can use a functools.partial function.

  Tip: You can have your error_info_processor persist the error info to a file or
  database, or send it to a logging service.

  ```python
  >>> from lkj import return_error_info_on_error, ErrorInfo
  >>> @return_error_info_on_error
  ... def foo(x, y=2):
  ...     return x / y
  ...
  >>> t = foo(1, 2)
  >>> assert t == 0.5
  >>> t = foo(1, y=0)
  Exiting from foo with error: division by zero
  >>> if isinstance(t, ErrorInfo):
  ...     assert isinstance(t.error, ZeroDivisionError)
  ...     hasattr(t, 'traceback')
  ...     assert t.locals['args'] == (1,)
  ...     assert t.locals['kwargs'] == {'y': 0}
  ```





  Chunk an iterable into non-overlapping chunks of size chk_size.

  ```python
  chunker(a, chk_size, *, include_tail=True)
  ```

  ```python
  >>> from lkj import chunker
  >>> list(chunker(range(8), 3))
  [(0, 1, 2), (3, 4, 5), (6, 7)]
  >>> list(chunker(range(8), 3, include_tail=False))
  [(0, 1, 2), (3, 4, 5)]
  ```



  Import and return an object from a dot string path.

  ```python
  import_object(dot_path: str)
  ```

  ```python
  >>> f = import_object('os.path.join')
  >>> from os.path import join
  >>> f is join
  True
  ```


pkgId: 22f270e398516200d4db376ad806fcf7c389fc5fa31e51087e5f7686d0ce1fad
name: python-llama-index-core-help
arch: noarch
version: 0.12.6
epoch: 0
release: 1
summary: Development documents and examples for llama-index-core
url: https://llamaindex.ai
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-llama-index-core-0.12.6-1.src.rpm
location_href: Packages/python-llama-index-core-help-0.12.6-1.noarch.rpm
checksum_type: sha256
description:
  The core python package to the LlamaIndex library. Core classes and abstractions
  represent the foundational building blocks for LLM applications, most notably,
  RAG. Such building blocks include abstractions for LLMs, Vector Stores, Embeddings,
  Storage, Callables and several others.

  We've designed the core library so that it can be easily extended through subclasses.
  Building LLM applications with LlamaIndex thus involves building with LlamaIndex
  core as well as with the LlamaIndex [integrations](https://github.com/run-llama/llama_index/tree/main/llama-index-integrations) needed for your application.


pkgId: a071e7d72e931855e837eb8cd8062044e9d29b93beedc02d7068f3f7ff6877c0
name: python-llama-index-help
arch: noarch
version: 0.12.7
epoch: 0
release: 1
summary: Development documents and examples for llama-index
url: https://llamaindex.ai
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-llama-index-0.12.7-1.src.rpm
location_href: Packages/python-llama-index-help-0.12.7-1.noarch.rpm
checksum_type: sha256
description:
  [![PyPI - Downloads](https://img.shields.io/pypi/dm/llama-index)](https://pypi.org/project/llama-index/)
  [![GitHub contributors](https://img.shields.io/github/contributors/jerryjliu/llama_index)](https://github.com/jerryjliu/llama_index/graphs/contributors)
  [![Discord](https://img.shields.io/discord/1059199217496772688)](https://discord.gg/dGcwcsnxhU)
  [![Ask AI](https://img.shields.io/badge/Phorm-Ask_AI-%23F2777A.svg?&logo=data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNSIgaGVpZ2h0PSI0IiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxwYXRoIGQ9Ik00LjQzIDEuODgyYTEuNDQgMS40NCAwIDAgMS0uMDk4LjQyNmMtLjA1LjEyMy0uMTE1LjIzLS4xOTIuMzIyLS4wNzUuMDktLjE2LjE2NS0uMjU1LjIyNmExLjM1MyAxLjM1MyAwIDAgMS0uNTk1LjIxMmMtLjA5OS4wMTItLjE5Mi4wMTQtLjI3OS4wMDZsLTEuNTkzLS4xNHYtLjQwNmgxLjY1OGMuMDkuMDAxLjE3LS4xNjkuMjQ2LS4xOTFhLjYwMy42MDMgMCAwIDAgLjItLjEwNi41MjkuNTI5IDAgMCAwIC4xMzgtLjE3LjY1NC42NTQgMCAwIDAgLjA2NS0uMjRsLjAyOC0uMzJhLjkzLjkzIDAgMCAwLS4wMzYtLjI0OS41NjcuNTY3IDAgMCAwLS4xMDMtLjIuNTAyLjUwMiAwIDAgMC0uMTY4LS4xMzguNjA4LjYwOCAwIDAgMC0uMjQtLjA2N0wyLjQzNy43MjkgMS42MjUuNjcxYS4zMjIuMzIyIDAgMCAwLS4yMzIuMDU4LjM3NS4zNzUgMCAwIDAtLjExNi4yMzJsLS4xMTYgMS40NS0uMDU4LjY5Ny0uMDU4Ljc1NEwuNzA1IDRsLS4zNTctLjA3OUwuNjAyLjkwNkMuNjE3LjcyNi42NjMuNTc0LjczOS40NTRhLjk1OC45NTggMCAwIDEgLjI3NC0uMjg1Ljk3MS45NzEgMCAwIDEgLjMzNy0uMTRjLjExOS0uMDI2LjIyNy0uMDM0LjMyNS0uMDI2TDMuMjMyLjE2Yy4xNTkuMDE0LjMzNi4wMy40NTkuMDgyYTEuMTczIDEuMTczIDAgMCAxIC41NDUuNDQ3Yy4wNi4wOTQuMTA5LjE5Mi4xNDQuMjkzYTEuMzkyIDEuMzkyIDAgMCAxIC4wNzguNThsLS4wMjkuMzJaIiBmaWxsPSIjRjI3NzdBIi8+CiAgPHBhdGggZD0iTTQuMDgyIDIuMDA3YTEuNDU1IDEuNDU1IDAgMCAxLS4wOTguNDI3Yy0uMDUuMTI0LS4xMTQuMjMyLS4xOTIuMzI0YTEuMTMgMS4xMyAwIDAgMS0uMjU0LjIyNyAxLjM1MyAxLjM1MyAwIDAgMS0uNTk1LjIxNGMtLjEuMDEyLS4xOTMuMDE0LS4yOC4wMDZsLTEuNTYtLjEwOC4wMzQtLjQwNi4wMy0uMzQ4IDEuNTU5LjE1NGMuMDkgMCAuMTczLS4wMS4yNDgtLjAzM2EuNjAzLjYwMyAwIDAgMCAuMi0uMTA2LjUzMi41MzIgMCAwIDAgLjEzOS0uMTcyLjY2LjY2IDAgMCAwIC4wNjQtLjI0MWwuMDI5LS4zMjFhLjk0Ljk0IDAgMCAwLS4wMzYtLjI1LjU3LjU3IDAgMCAwLS4xMDMtLjIwMi41MDIuNTAyIDAgMCAwLS4xNjgtLjEzOC42MDUuNjA1IDAgMCAwLS4yNC0uMDY3TDEuMjczLjgyN2MtLjA5NC0uMDA4LS4xNjguMDEtLjIyMS4wNTUtLjA1My4wNDUtLjA4NC4xMTQtLjA5Mi4yMDZMLjcwNSA0IDAgMy45MzhsLjI1NS0yLjkxMUExLjAxIDEuMDEgMCAwIDEgLjM5My41NzIuOTYyLjk2MiAwIDAgMSAuNjY2LjI4NmEuOTcuOTcgMCAwIDEgLjMzOC0uMTRDMS4xMjIuMTIgMS4yMy4xMSAxLjMyOC4xMTlsMS41OTMuMTRjLjE2LjAxNC4zLjA0Ny40MjMuMWExLjE3IDEuMTcgMCAwIDEgLjU0NS40NDhjLjA2MS4wOTUuMTA5LjE5My4xNDQuMjk1YTEuNDA2IDEuNDA2IDAgMCAxIC4wNzcuNTgzbC0uMDI4LjMyMloiIGZpbGw9IndoaXRlIi8+CiAgPHBhdGggZD0iTTQuMDgyIDIuMDA3YTEuNDU1IDEuNDU1IDAgMCAxLS4wOTguNDI3Yy0uMDUuMTI0LS4xMTQuMjMyLS4xOTIuMzI0YTEuMTMgMS4xMyAwIDAgMS0uMjU0LjIyNyAxLjM1MyAxLjM1MyAwIDAgMS0uNTk1LjIxNGMtLjEuMDEyLS4xOTMuMDE0LS4yOC4wMDZsLTEuNTYtLjEwOC4wMzQtLjQwNi4wMy0uMzQ4IDEuNTU5LjE1NGMuMDkgMCAuMTczLS4wMS4yNDgtLjAzM2EuNjAzLjYwMyAwIDAgMCAuMi0uMTA2LjUzMi41MzIgMCAwIDAgLjEzOS0uMTcyLjY2LjY2IDAgMCAwIC4wNjQtLjI0MWwuMDI5LS4zMjFhLjk0Ljk0IDAgMCAwLS4wMzYtLjI1LjU3LjU3IDAgMCAwLS4xMDMtLjIwMi41MDIuNTAyIDAgMCAwLS4xNjgtLjEzOC42MDUuNjA1IDAgMCAwLS4yNC0uMDY3TDEuMjczLjgyN2MtLjA5NC0uMDA4LS4xNjguMDEtLjIyMS4wNTUtLjA1My4wNDUtLjA4NC4xMTQtLjA5Mi4yMDZMLjcwNSA0IDAgMy45MzhsLjI1NS0yLjkxMUExLjAxIDEuMDEgMCAwIDEgLjM5My41NzIuOTYyLjk2MiAwIDAgMSAuNjY2LjI4NmEuOTcuOTcgMCAwIDEgLjMzOC0uMTRDMS4xMjIuMTIgMS4yMy4xMSAxLjMyOC4xMTlsMS41OTMuMTRjLjE2LjAxNC4zLjA0Ny40MjMuMWExLjE3IDEuMTcgMCAwIDEgLjU0NS40NDhjLjA2MS4wOTUuMTA5LjE5My4xNDQuMjk1YTEuNDA2IDEuNDA2IDAgMCAxIC4wNzcuNTgzbC0uMDI4LjMyMloiIGZpbGw9IndoaXRlIi8+Cjwvc3ZnPgo=)](https://www.phorm.ai/query?projectId=c5863b56-6703-4a5d-87b6-7e6031bf16b6)

  LlamaIndex (GPT Index) is a data framework for your LLM application. Building with LlamaIndex typically involves working with LlamaIndex core and a chosen set of integrations (or plugins). There are two ways to start building with LlamaIndex in
  Python:

  1. **Starter**: [`llama-index`](https://pypi.org/project/llama-index/). A starter Python package that includes core LlamaIndex as well as a selection of integrations.

  2. **Customized**: [`llama-index-core`](https://pypi.org/project/llama-index-core/). Install core LlamaIndex and add your chosen LlamaIndex integration packages on [LlamaHub](https://llamahub.ai/)
     that are required for your application. There are over 300 LlamaIndex integration
     packages that work seamlessly with core, allowing you to build with your preferred
     LLM, embedding, and vector store providers.

  The LlamaIndex Python library is namespaced such that import statements which
  include `core` imply that the core package is being used. In contrast, those
  statements without `core` imply that an integration package is being used.

  ```python

  from llama_index.core.xxx import ClassABC  # core submodule xxx
  from llama_index.xxx.yyy import (
      SubclassABC,
  )  # integration yyy for submodule xxx


  from llama_index.core.llms import LLM
  from llama_index.llms.openai import OpenAI
  ```



  LlamaIndex.TS [(Typescript/Javascript)](https://github.com/run-llama/LlamaIndexTS)

  [Documentation](https://docs.llamaindex.ai/en/stable/)

  [Twitter](https://twitter.com/llama_index)

  [Discord](https://discord.gg/dGcwcsnxhU)



  - LlamaHub [(community library of data loaders)](https://llamahub.ai)
  - LlamaLab [(cutting-edge AGI projects using LlamaIndex)](https://github.com/run-llama/llama-lab)



  **NOTE**: This README is not updated as frequently as the documentation. Please check out the documentation above for the latest updates!



  - LLMs are a phenomenal piece of technology for knowledge generation and reasoning. They are pre-trained on large amounts of publicly available data.
  - How do we best augment LLMs with our own private data?

  We need a comprehensive toolkit to help perform this data augmentation for LLMs.



  That's where **LlamaIndex** comes in. LlamaIndex is a "data framework" to help you build LLM apps. It provides the following tools:

  - Offers **data connectors** to ingest your existing data sources and data formats (APIs, PDFs, docs, SQL, etc.).
  - Provides ways to **structure your data** (indices, graphs) so that this data can be easily used with LLMs.
  - Provides an **advanced retrieval/query interface over your data**: Feed in any LLM input prompt, get back retrieved context and knowledge-augmented output.
  - Allows easy integrations with your outer application framework (e.g. with LangChain, Flask, Docker, ChatGPT, or anything else).

  LlamaIndex provides tools for both beginner users and advanced users. Our high-level API allows beginner users to use LlamaIndex to ingest and query their data in
  5 lines of code. Our lower-level APIs allow advanced users to customize and extend any module (data connectors, indices, retrievers, query engines, reranking modules),
  to fit their needs.



  Interested in contributing? Contributions to LlamaIndex core as well as contributing
  integrations that build on the core are both accepted and highly encouraged! See our [Contribution Guide](CONTRIBUTING.md) for more details.



  Full documentation can be found [here](https://docs.llamaindex.ai/en/latest/)

  Please check it out for the most up-to-date tutorials, how-to guides, references, and other resources!



  ```sh

  pip install llama-index-core
  pip install llama-index-llms-openai
  pip install llama-index-llms-replicate
  pip install llama-index-embeddings-huggingface
  ```

  Examples are in the `docs/examples` folder. Indices are in the `indices` folder (see list of indices below).

  To build a simple vector store index using OpenAI:

  ```python
  import os

  os.environ["OPENAI_API_KEY"] = "YOUR_OPENAI_API_KEY"

  from llama_index.core import VectorStoreIndex, SimpleDirectoryReader

  documents = SimpleDirectoryReader("YOUR_DATA_DIRECTORY").load_data()
  index = VectorStoreIndex.from_documents(documents)
  ```

  To build a simple vector store index using non-OpenAI LLMs, e.g. Llama 2 hosted on [Replicate](https://replicate.com/), where you can easily create a free trial API token:

  ```python
  import os

  os.environ["REPLICATE_API_TOKEN"] = "YOUR_REPLICATE_API_TOKEN"

  from llama_index.core import Settings, VectorStoreIndex, SimpleDirectoryReader
  from llama_index.embeddings.huggingface import HuggingFaceEmbedding
  from llama_index.llms.replicate import Replicate
  from transformers import AutoTokenizer


  llama2_7b_chat = "meta/llama-2-7b-chat:8e6975e5ed6174911a6ff3d60540dfd4844201974602551e10e9e87ab143d81e"
  Settings.llm = Replicate(
      model=llama2_7b_chat,
      temperature=0.01,
      additional_kwargs={"top_p": 1, "max_new_tokens": 300},
  )


  Settings.tokenizer = AutoTokenizer.from_pretrained(
      "NousResearch/Llama-2-7b-chat-hf"
  )


  Settings.embed_model = HuggingFaceEmbedding(
      model_name="BAAI/bge-small-en-v1.5"
  )

  documents = SimpleDirectoryReader("YOUR_DATA_DIRECTORY").load_data()
  index = VectorStoreIndex.from_documents(
      documents,
  )
  ```

  To query:

  ```python
  query_engine = index.as_query_engine()
  query_engine.query("YOUR_QUESTION")
  ```

  By default, data is stored in-memory.
  To persist to disk (under `./storage`):

  ```python
  index.storage_context.persist()
  ```

  To reload from disk:

  ```python
  from llama_index.core import StorageContext, load_index_from_storage


  storage_context = StorageContext.from_defaults(persist_dir="./storage")

  index = load_index_from_storage(storage_context)
  ```



  We use poetry as the package manager for all Python packages. As a result, the
  dependencies of each Python package can be found by referencing the `pyproject.toml`
  file in each of the package's folders.

  ```bash
  cd <desired-package-folder>
  pip install poetry
  poetry install --with dev
  ```



  Reference to cite if you use LlamaIndex in a paper:

  ```
  @software{Liu_LlamaIndex_2022,
  author = {Liu, Jerry},
  doi = {10.5281/zenodo.1234},
  month = {11},
  title = {{LlamaIndex}},
  url = {https://github.com/jerryjliu/llama_index},
  year = {2022}
  }
  ```


pkgId: ba18abc208680b1b6baf4de725edb16f0902db3edcccb801241f7a8908a9d3ee
name: python-llama-index-llms-anthropic-help
arch: noarch
version: 0.6.0
epoch: 0
release: 1
summary: Development documents and examples for llama-index-llms-anthropic
url: https://pypi.org/project/llama-index-llms-anthropic/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-llama-index-llms-anthropic-0.6.0-1.src.rpm
location_href: Packages/python-llama-index-llms-anthropic-help-0.6.0-1.noarch.rpm
checksum_type: sha256
description:
  Anthropic is an AI research company focused on developing advanced language models, notably the Claude series. Their flagship model, Claude, is designed to generate human-like text while prioritizing safety and alignment with human intentions. Anthropic aims to create AI systems that are not only powerful but also responsible, addressing potential risks associated with artificial intelligence.



  ```sh
  %pip install llama-index-llms-anthropic
  !pip install llama-index
  ```

  ```




  ```



  ```py
  from llama_index.llms.anthropic import Anthropic
  from llama_index.core import Settings

  tokenizer = Anthropic().tokenizer
  Settings.tokenizer = tokenizer


  import os

  os.environ["ANTHROPIC_API_KEY"] = "YOUR ANTHROPIC API KEY"
  from llama_index.llms.anthropic import Anthropic




  llm = Anthropic(model="claude-3-opus-20240229")

  resp = llm.complete("Paul Graham is ")
  print(resp)







  ```



  ```py
  import os

  os.environ["ANTHROPIC_PROJECT_ID"] = "YOUR PROJECT ID HERE"
  os.environ["ANTHROPIC_REGION"] = "YOUR PROJECT REGION HERE"


  llm = Anthropic(
      model="claude-3-5-sonnet@20240620",
      region=os.getenv("ANTHROPIC_REGION"),
      project_id=os.getenv("ANTHROPIC_PROJECT_ID"),
  )

  resp = llm.complete("Paul Graham is ")
  print(resp)
  ```



  ```py
  from llama_index.core.llms import ChatMessage
  from llama_index.llms.anthropic import Anthropic

  messages = [
      ChatMessage(
          role="system", content="You are a pirate with a colorful personality"
      ),
      ChatMessage(role="user", content="Tell me a story"),
  ]
  resp = Anthropic(model="claude-3-opus-20240229").chat(messages)
  print(resp)
  ```



  ```py
  from llama_index.llms.anthropic import Anthropic

  llm = Anthropic(model="claude-3-opus-20240229", max_tokens=100)
  resp = llm.stream_complete("Paul Graham is ")
  for r in resp:
      print(r.delta, end="")
  ```



  ```py
  llm = Anthropic(model="claude-3-opus-20240229")
  messages = [
      ChatMessage(
          role="system", content="You are a pirate with a colorful personality"
      ),
      ChatMessage(role="user", content="Tell me a story"),
  ]
  resp = llm.stream_chat(messages)
  for r in resp:
      print(r.delta, end="")
  ```



  ```py
  from llama_index.llms.anthropic import Anthropic

  llm = Anthropic(model="claude-3-sonnet-20240229")
  resp = llm.stream_complete("Paul Graham is ")
  for r in resp:
      print(r.delta, end="")
  ```



  ```py
  from llama_index.llms.anthropic import Anthropic

  llm = Anthropic("claude-3-sonnet-20240229")
  resp = await llm.acomplete("Paul Graham is ")
  print(resp)
  ```



  ```py
  from llama_index.llms.anthropic import Anthropic
  from llama_index.core.prompts import PromptTemplate
  from llama_index.core.bridge.pydantic import BaseModel
  from typing import List


  class MenuItem(BaseModel):
      """A menu item in a restaurant."""

      course_name: str
      is_vegetarian: bool


  class Restaurant(BaseModel):
      """A restaurant with name, city, and cuisine."""

      name: str
      city: str
      cuisine: str
      menu_items: List[MenuItem]


  llm = Anthropic("claude-3-5-sonnet-20240620")
  prompt_tmpl = PromptTemplate(
      "Generate a restaurant in a given city {city_name}"
  )


  restaurant_obj = (
      llm.as_structured_llm(Restaurant)
      .complete(prompt_tmpl.format(city_name="Miami"))
      .raw
  )
  print(restaurant_obj)





  from llama_index.core.llms import ChatMessage
  from IPython.display import clear_output
  from pprint import pprint

  input_msg = ChatMessage.from_str("Generate a restaurant in San Francisco")

  sllm = llm.as_structured_llm(Restaurant)
  stream_output = sllm.stream_chat([input_msg])
  for partial_output in stream_output:
      clear_output(wait=True)
      pprint(partial_output.raw.dict())
  ```



  https://docs.llamaindex.ai/en/stable/examples/llm/anthropic/


pkgId: 8f3efe5dc8a8aa0fbc006a85a162888fa8f516d44f3dfca36e35362a3d343b31
name: python-llama-index-llms-bedrock-converse-help
arch: noarch
version: 0.4.2
epoch: 0
release: 1
summary: Development documents and examples for llama-index-llms-bedrock-converse
url: https://pypi.org/project/llama-index-llms-bedrock-converse/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-llama-index-llms-bedrock-converse-0.4.2-1.src.rpm
location_href: Packages/python-llama-index-llms-bedrock-converse-help-0.4.2-1.noarch.rpm
checksum_type: sha256
description:
  ```bash
  %pip install llama-index-llms-bedrock-converse
  !pip install llama-index
  ```



  ```py
  from llama_index.llms.bedrock_converse import BedrockConverse


  profile_name = "Your aws profile name"


  resp = BedrockConverse(
      model="anthropic.claude-3-haiku-20240307-v1:0",
      profile_name=profile_name,
  ).complete("Paul Graham is ")
  print(resp)
  ```



  ```py
  from llama_index.core.llms import ChatMessage
  from llama_index.llms.bedrock_converse import BedrockConverse

  messages = [
      ChatMessage(
          role="system", content="You are a pirate with a colorful personality"
      ),
      ChatMessage(role="user", content="Tell me a story"),
  ]

  resp = BedrockConverse(
      model="anthropic.claude-3-haiku-20240307-v1:0",
      profile_name=profile_name,
  ).chat(messages)
  print(resp)
  ```



  ```py

  from llama_index.llms.bedrock_converse import BedrockConverse

  llm = BedrockConverse(
      model="anthropic.claude-3-haiku-20240307-v1:0",
      profile_name=profile_name,
  )
  resp = llm.stream_complete("Paul Graham is ")
  for r in resp:
      print(r.delta, end="")


  from llama_index.llms.bedrock_converse import BedrockConverse

  llm = BedrockConverse(
      model="anthropic.claude-3-haiku-20240307-v1:0",
      profile_name=profile_name,
  )
  messages = [
      ChatMessage(
          role="system", content="You are a pirate with a colorful personality"
      ),
      ChatMessage(role="user", content="Tell me a story"),
  ]
  resp = llm.stream_chat(messages)
  for r in resp:
      print(r.delta, end="")
  ```



  ```py
  from llama_index.llms.bedrock_converse import BedrockConverse

  llm = BedrockConverse(
      model="anthropic.claude-3-haiku-20240307-v1:0",
      profile_name=profile_name,
  )
  resp = llm.complete("Paul Graham is ")
  print(resp)
  ```



  ```py
  from llama_index.llms.bedrock_converse import BedrockConverse

  llm = BedrockConverse(
      model="anthropic.claude-3-haiku-20240307-v1:0",
      aws_access_key_id="AWS Access Key ID to use",
      aws_secret_access_key="AWS Secret Access Key to use",
      aws_session_token="AWS Session Token to use",
      region_name="AWS Region to use, eg. us-east-1",
  )

  resp = llm.complete("Paul Graham is ")
  print(resp)
  ```



  ```py



  from llama_index.llms.bedrock_converse import BedrockConverse
  from llama_index.core.tools import FunctionTool



  def multiply(a: int, b: int) -> int:
      """Multiply two integers and return the result"""
      return a * b


  def mystery(a: int, b: int) -> int:
      """Mystery function on two integers."""
      return a * b + a + b



  mystery_tool = FunctionTool.from_defaults(fn=mystery)
  multiply_tool = FunctionTool.from_defaults(fn=multiply)


  llm = BedrockConverse(
      model="anthropic.claude-3-haiku-20240307-v1:0",
      profile_name=profile_name,
  )


  response = llm.predict_and_call(
      [mystery_tool, multiply_tool],
      user_msg="What happens if I run the mystery function on 5 and 7",
  )
  print(str(response))

  response = llm.predict_and_call(
      [mystery_tool, multiply_tool],
      user_msg=(
          """What happens if I run the mystery function on the following pairs of numbers?
          Generate a separate result for each row:
          - 1 and 2
          - 8 and 4
          - 100 and 20

          NOTE: you need to run the mystery function for all of the pairs above at the same time"""
      ),
      allow_parallel_tool_calls=True,
  )
  print(str(response))

  for s in response.sources:
      print(f"Name: {s.tool_name}, Input: {s.raw_input}, Output: {str(s)}")
  ```



  ```py
  from llama_index.llms.bedrock_converse import BedrockConverse

  llm = BedrockConverse(
      model="anthropic.claude-3-haiku-20240307-v1:0",
      aws_access_key_id="AWS Access Key ID to use",
      aws_secret_access_key="AWS Secret Access Key to use",
      aws_session_token="AWS Session Token to use",
      region_name="AWS Region to use, eg. us-east-1",
  )


  resp = await llm.acomplete("Paul Graham is ")
  print(resp)
  ```



  https://docs.llamaindex.ai/en/stable/examples/llm/bedrock_converse/


pkgId: 3f968703d60624a7e39cbc78e32391f7959b16841e5f76fe6f760b0978bf2358
name: python-llama-index-llms-bedrock-help
arch: noarch
version: 0.3.3
epoch: 0
release: 1
summary: Development documents and examples for llama-index-llms-bedrock
url: https://pypi.org/project/llama-index-llms-bedrock/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-llama-index-llms-bedrock-0.3.3-1.src.rpm
location_href: Packages/python-llama-index-llms-bedrock-help-0.3.3-1.noarch.rpm
checksum_type: sha256
description:
  ```bash
  %pip install llama-index-llms-bedrock
  !pip install llama-index
  ```



  ```py
  from llama_index.llms.bedrock import Bedrock


  profile_name = "Your aws profile name"


  resp = Bedrock(
      model="amazon.titan-text-express-v1", profile_name=profile_name
  ).complete("Paul Graham is ")
  print(resp)





  ```



  ```py
  from llama_index.core.llms import ChatMessage
  from llama_index.llms.bedrock import Bedrock

  messages = [
      ChatMessage(
          role="system", content="You are a pirate with a colorful personality"
      ),
      ChatMessage(role="user", content="Tell me a story"),
  ]

  resp = Bedrock(
      model="amazon.titan-text-express-v1", profile_name=profile_name
  ).chat(messages)
  print(resp)




  ```





  ```py
  from llama_index.llms.bedrock import Bedrock

  llm = Bedrock(model="amazon.titan-text-express-v1", profile_name=profile_name)
  resp = llm.stream_complete("Paul Graham is ")
  for r in resp:
      print(r.delta, end="")




  ```



  ```py
  from llama_index.llms.bedrock import Bedrock

  llm = Bedrock(model="amazon.titan-text-express-v1", profile_name=profile_name)
  messages = [
      ChatMessage(
          role="system", content="You are a pirate with a colorful personality"
      ),
      ChatMessage(role="user", content="Tell me a story"),
  ]
  resp = llm.stream_chat(messages)
  for r in resp:
      print(r.delta, end="")




  ```



  ```py
  from llama_index.llms.bedrock import Bedrock

  llm = Bedrock(model="amazon.titan-text-express-v1", profile_name=profile_name)
  resp = llm.complete("Paul Graham is ")
  print(resp)




  ```



  ```py
  from llama_index.llms.bedrock import Bedrock

  llm = Bedrock(
      model="amazon.titan-text-express-v1",
      aws_access_key_id="AWS Access Key ID to use",
      aws_secret_access_key="AWS Secret Access Key to use",
      aws_session_token="AWS Session Token to use",
      region_name="AWS Region to use, e.g. us-east-1",
  )

  resp = llm.complete("Paul Graham is ")
  print(resp)




  ```



  https://docs.llamaindex.ai/en/stable/examples/llm/bedrock/


pkgId: 0e4439facc50684b27e7ed5d872409cc30f48183390d36414b80dacf122333c5
name: python-llama-index-llms-cerebras-help
arch: noarch
version: 0.2.2
epoch: 0
release: 1
summary: Development documents and examples for llama-index-llms-cerebras
url: https://pypi.org/project/llama-index-llms-cerebras/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-llama-index-llms-cerebras-0.2.2-1.src.rpm
location_href: Packages/python-llama-index-llms-cerebras-help-0.2.2-1.noarch.rpm
checksum_type: sha256
description:
  At Cerebras, we've developed the world's largest and fastest AI processor, the Wafer-Scale Engine-3 (WSE-3). The Cerebras CS-3 system, powered by the WSE-3, represents a new class of AI supercomputer that sets the standard for generative AI training and inference with unparalleled performance and scalability.

  With Cerebras as your inference provider, you can:

  - Achieve unprecedented speed for AI inference workloads
  - Build commercially with high throughput
  - Effortlessly scale your AI workloads with our seamless clustering technology

  Our CS-3 systems can be quickly and easily clustered to create the largest AI supercomputers in the world, making it simple to place and run the largest models. Leading corporations, research institutions, and governments are already using Cerebras solutions to develop proprietary models and train popular open-source models.

  Want to experience the power of Cerebras? Check out our [website](https://cerebras.net) for more resources and explore options for accessing our technology through the Cerebras Cloud or on-premise deployments!

  For more information about Cerebras Cloud, visit [cloud.cerebras.ai](https://cloud.cerebras.ai/). Our API reference is available at [inference-docs.cerebras.ai](https://inference-docs.cerebras.ai/).



  using poetry:

  ```shell
  poetry add llama-index-llms-cerebras
  ```

  or using pip:

  ```shell
  pip install llama-index-llms-cerebras
  ```



  Get an API Key from [cloud.cerebras.ai](https://cloud.cerebras.ai/) and add it to your environment variables:

  ```
  export CEREBRAS_API_KEY=<your api key>
  ```

  Then try out one of these examples:

  ```python
  import os

  from llama_index.core.llms import ChatMessage
  from llama_index.llms.cerebras import Cerebras

  llm = Cerebras(model="llama-3.3-70b", api_key=os.environ["CEREBRAS_API_KEY"])

  messages = [
      ChatMessage(
          role="system", content="You are a pirate with a colorful personality"
      ),
      ChatMessage(role="user", content="What is your name"),
  ]
  resp = llm.chat(messages)
  print(resp)
  ```

  Or alternatively with streaming:

  ```python
  import os

  from llama_index.llms.cerebras import Cerebras

  llm = Cerebras(model="llama-3.3-70b", api_key=os.environ["CEREBRAS_API_KEY"])

  response = llm.stream_complete("What is Generative AI?")
  for r in response:
      print(r.delta, end="")
  ```


pkgId: 7b78a27deffa677400bcb94c5a60a91221d8b6c4de74f3b018d384ec6d144134
name: python-llama-index-llms-gemini-help
arch: noarch
version: 0.4.2
epoch: 0
release: 1
summary: Development documents and examples for llama-index-llms-gemini
url: https://pypi.org/project/llama-index-llms-gemini/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-llama-index-llms-gemini-0.4.2-1.src.rpm
location_href: Packages/python-llama-index-llms-gemini-help-0.4.2-1.noarch.rpm
checksum_type: sha256
description:
  1. Install the required Python packages:

     ```bash
     %pip install llama-index-llms-gemini
     !pip install -q llama-index google-generativeai
     ```

  2. Set the Google API key as an environment variable:

     ```bash
     %env GOOGLE_API_KEY=your_api_key_here
     ```





  To generate a poem using the Gemini model, use the following code:

  ```python
  from llama_index.llms.gemini import Gemini

  resp = Gemini().complete("Write a poem about a magic backpack")
  print(resp)
  ```



  To simulate a conversation, send a list of messages:

  ```python
  from llama_index.core.llms import ChatMessage
  from llama_index.llms.gemini import Gemini

  messages = [
      ChatMessage(role="user", content="Hello friend!"),
      ChatMessage(role="assistant", content="Yarr what is shakin' matey?"),
      ChatMessage(
          role="user", content="Help me decide what to have for dinner."
      ),
  ]
  resp = Gemini().chat(messages)
  print(resp)
  ```



  To stream content responses in real-time:

  ```python
  from llama_index.llms.gemini import Gemini

  llm = Gemini()
  resp = llm.stream_complete(
      "The story of Sourcrust, the bread creature, is really interesting. It all started when..."
  )
  for r in resp:
      print(r.text, end="")
  ```

  To stream chat responses:

  ```python
  from llama_index.llms.gemini import Gemini
  from llama_index.core.llms import ChatMessage

  llm = Gemini()
  messages = [
      ChatMessage(role="user", content="Hello friend!"),
      ChatMessage(role="assistant", content="Yarr what is shakin' matey?"),
      ChatMessage(
          role="user", content="Help me decide what to have for dinner."
      ),
  ]
  resp = llm.stream_chat(messages)
  ```



  To find suitable models available in the Gemini model site:

  ```python
  import google.generativeai as genai

  for m in genai.list_models():
      if "generateContent" in m.supported_generation_methods:
          print(m.name)
  ```



  To use a specific model, you can configure it like this:

  ```python
  from llama_index.llms.gemini import Gemini

  llm = Gemini(model="models/gemini-pro")
  resp = llm.complete("Write a short, but joyous, ode to LlamaIndex")
  print(resp)
  ```



  To use the asynchronous completion API:

  ```python
  from llama_index.llms.gemini import Gemini

  llm = Gemini()
  resp = await llm.acomplete("Llamas are famous for ")
  print(resp)
  ```

  For asynchronous streaming of responses:

  ```python
  resp = await llm.astream_complete("Llamas are famous for ")
  async for chunk in resp:
      print(chunk.text, end="")
  ```



  https://docs.llamaindex.ai/en/stable/examples/llm/gemini/


pkgId: 1e3d3b08964df58a67d1acecb41b78825e8f8d8682470153e6ae45247d19bf75
name: python-llama-index-llms-keywordsai-help
arch: noarch
version: 1.0.0
epoch: 0
release: 1
summary: Development documents and examples for llama-index-llms-keywordsai
url: https://pypi.org/project/llama-index-llms-keywordsai/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-llama-index-llms-keywordsai-1.0.0-1.src.rpm
location_href: Packages/python-llama-index-llms-keywordsai-help-1.0.0-1.noarch.rpm
checksum_type: sha256
description:
  To install the required package, run:

  ```bash
  %pip install llama-index-llms-keywordsai
  ```



  1. Set your KeywordsAI API key as an environment variable. You can replace `"sk-..."` with your actual API key:

  ```python
  import os

  os.environ["OPENAI_API_KEY"] = "sk-..."
  ```





  To generate a completion for a prompt, use the `complete` method:

  ```python
  from llama_index.llms.keywordsai import KeywordsAI

  resp = KeywordsAI().complete("Paul Graham is ")
  print(resp)
  ```



  To send a chat message and receive a response, create a list of `ChatMessage` instances and use the `chat` method:

  ```python
  from llama_index.core.llms import ChatMessage

  messages = [
      ChatMessage(
          role="system", content="You are a pirate with a colorful personality."
      ),
      ChatMessage(role="user", content="What is your name?"),
  ]
  resp = KeywordsAI().chat(messages)
  print(resp)
  ```





  To stream responses for a prompt, use the `stream_complete` method:

  ```python
  from llama_index.llms.keywordsai import KeywordsAI

  llm = KeywordsAI()
  resp = llm.stream_complete("Paul Graham is ")
  for r in resp:
      print(r.delta, end="")
  ```



  To stream chat responses, use the `stream_chat` method:

  ```python
  from llama_index.llms.keywordsai import KeywordsAI
  from llama_index.core.llms import ChatMessage

  llm = KeywordsAI()
  messages = [
      ChatMessage(
          role="system", content="You are a pirate with a colorful personality."
      ),
      ChatMessage(role="user", content="What is your name?"),
  ]
  resp = llm.stream_chat(messages)
  for r in resp:
      print(r.delta, end="")
  ```



  You can specify a particular model when creating the `KeywordsAI` instance:

  ```python
  llm = KeywordsAI(model="gpt-3.5-turbo")
  resp = llm.complete("Paul Graham is ")
  print(resp)

  messages = [
      ChatMessage(
          role="system", content="You are a pirate with a colorful personality."
      ),
      ChatMessage(role="user", content="What is your name?"),
  ]
  resp = llm.chat(messages)
  print(resp)
  ```



  You can also use asynchronous methods for completion:

  ```python
  from llama_index.llms.keywordsai import KeywordsAI

  llm = KeywordsAI(model="gpt-3.5-turbo")
  resp = await llm.acomplete("Paul Graham is ")
  print(resp)
  ```



  If desired, you can have separate LLM instances use different API keys:

  ```python
  from llama_index.llms.keywordsai import KeywordsAI

  llm = KeywordsAI(model="gpt-3.5-turbo", api_key="BAD_KEY")
  resp = KeywordsAI().complete("Paul Graham is ")
  print(resp)
  ```



  https://docs.llamaindex.ai/en/stable/examples/llm/keywordsai/


pkgId: 3d4d9534966ae6340f492b4b6c8846843a0d5f43aa634a8f067bb1eac5cf16a3
name: python-llama-index-llms-mistralai-help
arch: noarch
version: 0.3.1
epoch: 0
release: 1
summary: Development documents and examples for llama-index-llms-mistralai
url: https://pypi.org/project/llama-index-llms-mistralai/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-llama-index-llms-mistralai-0.3.1-1.src.rpm
location_href: Packages/python-llama-index-llms-mistralai-help-0.3.1-1.noarch.rpm
checksum_type: sha256
description:
  Install the required packages using the following commands:

  ```bash
  %pip install llama-index-llms-mistralai
  !pip install llama-index
  ```





  To use the MistralAI model, create an instance and provide your API key:

  ```python
  from llama_index.llms.mistralai import MistralAI

  llm = MistralAI(api_key="<replace-with-your-key>")
  ```



  To generate a text completion for a prompt, use the `complete` method:

  ```python
  resp = llm.complete("Paul Graham is ")
  print(resp)
  ```



  You can also chat with the model using a list of messages. Here’s an example:

  ```python
  from llama_index.core.llms import ChatMessage

  messages = [
      ChatMessage(role="system", content="You are CEO of MistralAI."),
      ChatMessage(role="user", content="Tell me the story about La plateforme"),
  ]
  resp = MistralAI().chat(messages)
  print(resp)
  ```



  To set a random seed for reproducibility, initialize the model with the `random_seed` parameter:

  ```python
  resp = MistralAI(random_seed=42).chat(messages)
  print(resp)
  ```





  You can stream responses using the `stream_complete` method:

  ```python
  resp = llm.stream_complete("Paul Graham is ")
  for r in resp:
      print(r.delta, end="")
  ```



  To stream chat messages, use the following code:

  ```python
  messages = [
      ChatMessage(role="system", content="You are CEO of MistralAI."),
      ChatMessage(role="user", content="Tell me the story about La plateforme"),
  ]
  resp = llm.stream_chat(messages)
  for r in resp:
      print(r.delta, end="")
  ```



  To use a specific model configuration, initialize the model with the desired model name:

  ```python
  llm = MistralAI(model="mistral-medium")
  resp = llm.stream_complete("Paul Graham is ")
  for r in resp:
      print(r.delta, end="")
  ```



  You can call functions from the model by defining tools. Here’s an example:

  ```python
  from llama_index.llms.mistralai import MistralAI
  from llama_index.core.tools import FunctionTool


  def multiply(a: int, b: int) -> int:
      """Multiply two integers and return the result."""
      return a * b


  def mystery(a: int, b: int) -> int:
      """Mystery function on two integers."""
      return a * b + a + b


  mystery_tool = FunctionTool.from_defaults(fn=mystery)
  multiply_tool = FunctionTool.from_defaults(fn=multiply)

  llm = MistralAI(model="mistral-large-latest")
  response = llm.predict_and_call(
      [mystery_tool, multiply_tool],
      user_msg="What happens if I run the mystery function on 5 and 7",
  )
  print(str(response))
  ```



  https://docs.llamaindex.ai/en/stable/examples/llm/mistralai/


pkgId: 2c76025f64a89ced312f2ec26d83f2f668720565e2d4ee66f29b4299f8ded71c
name: python-llama-index-llms-openai-help
arch: noarch
version: 0.3.11
epoch: 0
release: 1
summary: Development documents and examples for llama-index-llms-openai
url: https://pypi.org/project/llama-index-llms-openai/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-llama-index-llms-openai-0.3.11-1.src.rpm
location_href: Packages/python-llama-index-llms-openai-help-0.3.11-1.noarch.rpm
checksum_type: sha256
description:
  To install the required package, run:

  ```bash
  %pip install llama-index-llms-openai
  ```



  1. Set your OpenAI API key as an environment variable. You can replace `"sk-..."` with your actual API key:

  ```python
  import os

  os.environ["OPENAI_API_KEY"] = "sk-..."
  ```





  To generate a completion for a prompt, use the `complete` method:

  ```python
  from llama_index.llms.openai import OpenAI

  resp = OpenAI().complete("Paul Graham is ")
  print(resp)
  ```



  To send a chat message and receive a response, create a list of `ChatMessage` instances and use the `chat` method:

  ```python
  from llama_index.core.llms import ChatMessage

  messages = [
      ChatMessage(
          role="system", content="You are a pirate with a colorful personality."
      ),
      ChatMessage(role="user", content="What is your name?"),
  ]
  resp = OpenAI().chat(messages)
  print(resp)
  ```





  To stream responses for a prompt, use the `stream_complete` method:

  ```python
  from llama_index.llms.openai import OpenAI

  llm = OpenAI()
  resp = llm.stream_complete("Paul Graham is ")
  for r in resp:
      print(r.delta, end="")
  ```



  To stream chat responses, use the `stream_chat` method:

  ```python
  from llama_index.llms.openai import OpenAI
  from llama_index.core.llms import ChatMessage

  llm = OpenAI()
  messages = [
      ChatMessage(
          role="system", content="You are a pirate with a colorful personality."
      ),
      ChatMessage(role="user", content="What is your name?"),
  ]
  resp = llm.stream_chat(messages)
  for r in resp:
      print(r.delta, end="")
  ```



  You can specify a particular model when creating the `OpenAI` instance:

  ```python
  llm = OpenAI(model="gpt-3.5-turbo")
  resp = llm.complete("Paul Graham is ")
  print(resp)

  messages = [
      ChatMessage(
          role="system", content="You are a pirate with a colorful personality."
      ),
      ChatMessage(role="user", content="What is your name?"),
  ]
  resp = llm.chat(messages)
  print(resp)
  ```



  You can also use asynchronous methods for completion:

  ```python
  from llama_index.llms.openai import OpenAI

  llm = OpenAI(model="gpt-3.5-turbo")
  resp = await llm.acomplete("Paul Graham is ")
  print(resp)
  ```



  If desired, you can have separate LLM instances use different API keys:

  ```python
  from llama_index.llms.openai import OpenAI

  llm = OpenAI(model="gpt-3.5-turbo", api_key="BAD_KEY")
  resp = OpenAI().complete("Paul Graham is ")
  print(resp)
  ```



  https://docs.llamaindex.ai/en/stable/examples/llm/openai/


pkgId: 1ce269a111c71770dd31a656084cead15922288284df7a4f6e6f09e98811c1c0
name: python-llama-index-readers-confluence-help
arch: noarch
version: 0.3.1
epoch: 0
release: 1
summary: Development documents and examples for llama-index-readers-confluence
url: https://pypi.org/project/llama-index-readers-confluence/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-llama-index-readers-confluence-0.3.1-1.src.rpm
location_href: Packages/python-llama-index-readers-confluence-help-0.3.1-1.noarch.rpm
checksum_type: sha256
description:
  ```bash
  pip install llama-index-readers-confluence
  ```

  This loader loads pages from a given Confluence cloud instance. The user needs to specify the base URL for a Confluence
  instance to initialize the ConfluenceReader - base URL needs to end with `/wiki`.

  The user can optionally specify OAuth 2.0 credentials to authenticate with the Confluence instance. If no credentials are
  specified, the loader will look for `CONFLUENCE_API_TOKEN` or `CONFLUENCE_USERNAME`/`CONFLUENCE_PASSWORD` environment variables
  to proceed with basic authentication.

  > [!NOTE]
  > Keep in mind `CONFLUENCE_PASSWORD` is not your actual password, but an API Token obtained here: https://id.atlassian.com/manage-profile/security/api-tokens.

  The following order is used for checking authentication credentials:

  1. `oauth2`
  2. `api_token`
  3. `cookies`
  4. `user_name` and `password`
  5. Environment variable `CONFLUENCE_API_TOKEN`
  6. Environment variable `CONFLUENCE_USERNAME` and `CONFLUENCE_PASSWORD`

  For more on authenticating using OAuth 2.0, checkout:

  - https://atlassian-python-api.readthedocs.io/index.html
  - https://developer.atlassian.com/cloud/confluence/oauth-2-3lo-apps/

  Confluence pages are obtained through one of 4 four mutually exclusive ways:

  1. `page_ids`: Load all pages from a list of page ids
  2. `space_key`: Load all pages from a space
  3. `label`: Load all pages with a given label
  4. `cql`: Load all pages that match a given CQL query (Confluence Query Language https://developer.atlassian.com/cloud/confluence/advanced-searching-using-cql/ ).

  When `page_ids` is specified, `include_children` will cause the loader to also load all descendent pages.
  When `space_key` is specified, `page_status` further specifies the status of pages to load: None, 'current', 'archived', 'draft'.

  limit (int): Deprecated, use `max_num_results` instead.

  max_num_results (int): Maximum number of results to return. If None, return all results. Requests are made in batches to achieve the desired number of results.

  start(int): Which offset we should jump to when getting pages, only works with space_key

  cursor(str): An alternative to start for cql queries, the cursor is a pointer to the next "page" when searching atlassian products. The current one after a search can be found with `get_next_cursor()`

  User can also specify a boolean `include_attachments` to
  include attachments, this is set to `False` by default, if set to `True` all attachments will be downloaded and
  ConfluenceReader will extract the text from the attachments and add it to the Document object.
  Currently supported attachment types are: PDF, PNG, JPEG/JPG, SVG, Word and Excel.

  Hint: `space_key` and `page_id` can both be found in the URL of a page in Confluence - https://yoursite.atlassian.com/wiki/spaces/<space_key>/pages/<page_id>



  Here's an example usage of the ConfluenceReader.

  ```python

  from llama_index.readers.confluence import ConfluenceReader

  token = {"access_token": "<access_token>", "token_type": "<token_type>"}
  oauth2_dict = {"client_id": "<client_id>", "token": token}

  base_url = "https://yoursite.atlassian.com/wiki"

  page_ids = ["<page_id_1>", "<page_id_2>", "<page_id_3"]
  space_key = "<space_key>"

  reader = ConfluenceReader(
      base_url=base_url,
      oauth2=oauth2_dict,
      client_args={"backoff_and_retry": True},
  )
  documents = reader.load_data(
      space_key=space_key, include_attachments=True, page_status="current"
  )
  documents.extend(
      reader.load_data(
          page_ids=page_ids, include_children=True, include_attachments=True
      )
  )
  ```

  ```python

  from llama_index.readers.confluence import ConfluenceReader

  token = {"access_token": "<access_token>", "token_type": "<token_type>"}
  oauth2_dict = {"client_id": "<client_id>", "token": token}

  base_url = "https://yoursite.atlassian.com/wiki"

  space_key = "<space_key>"

  reader = ConfluenceReader(base_url=base_url, oauth2=oauth2_dict)
  documents = reader.load_data(
      space_key=space_key,
      include_attachments=True,
      page_status="current",
      start=0,
      max_num_results=5,
  )
  documents.extend(
      reader.load_data(
          space_key=space_key,
          include_children=True,
          include_attachments=True,
          start=5,
          max_num_results=5,
      )
  )
  ```

  ```python

  from llama_index.readers.confluence import ConfluenceReader

  token = {"access_token": "<access_token>", "token_type": "<token_type>"}
  oauth2_dict = {"client_id": "<client_id>", "token": token}

  base_url = "https://yoursite.atlassian.com/wiki"

  cql = f'type="page" AND label="devops"'

  reader = ConfluenceReader(base_url=base_url, oauth2=oauth2_dict)
  documents = reader.load_data(cql=cql, max_num_results=5)
  cursor = reader.get_next_cursor()
  documents.extend(reader.load_data(cql=cql, cursor=cursor, max_num_results=5))
  ```

  This loader is designed to be used as a way to load data into [LlamaIndex](https://github.com/run-llama/llama_index/).


pkgId: bcd1ee80d81873edeca4c8ccf8793c8299b3839554943acc841225cffe6b5bfb
name: python-llama-index-vector-stores-azurecosmosnosql-help
arch: noarch
version: 1.3.0
epoch: 0
release: 1
summary: Development documents and examples for llama-index-vector-stores-azurecosmosnosql
url: https://pypi.org/project/llama-index-vector-stores-azurecosmosnosql/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-llama-index-vector-stores-azurecosmosnosql-1.3.0-1.src.rpm
location_href: Packages/python-llama-index-vector-stores-azurecosmosnosql-help-1.3.0-1.noarch.rpm
checksum_type: sha256
description:
  This integration makes possible to use [Azure Cosmos DB for NoSQL](https://learn.microsoft.com/en-us/azure/cosmos-db/nosql/)
  as a vector store in LlamaIndex.



  Install the integration with:

  ```sh
  pip install llama-index-vector-stores-azurecosmosnosql
  ```

  Create the CosmosDB client:

  ```python
  URI = "AZURE_COSMOSDB_URI"
  KEY = "AZURE_COSMOSDB_KEY"
  client = CosmosClient(URI, credential=KEY)
  ```

  Specify the vector store properties:

  ```python
  indexing_policy = {
      "indexingMode": "consistent",
      "includedPaths": [{"path": "/*"}],
      "excludedPaths": [{"path": '/"_etag"/?'}],
      "vectorIndexes": [{"path": "/embedding", "type": "quantizedFlat"}],
  }

  vector_embedding_policy = {
      "vectorEmbeddings": [
          {
              "path": "/embedding",
              "dataType": "float32",
              "distanceFunction": "cosine",
              "dimensions": 3072,
          }
      ]
  }
  ```

  Create the vector store:

  ```python
  store = AzureCosmosDBNoSqlVectorSearch(
      cosmos_client=client,
      vector_embedding_policy=vector_embedding_policy,
      indexing_policy=indexing_policy,
      cosmos_container_properties={"partition_key": PartitionKey(path="/id")},
      cosmos_database_properties={},
      create_container=True,
  )
  ```

  Finally, create the index from a list containing documents:

  ```python
  storage_context = StorageContext.from_defaults(vector_store=store)

  index = VectorStoreIndex.from_documents(
      documents, storage_context=storage_context
  )
  ```


pkgId: e9cde31a96d947a47d56138165cac3f865ed953d45892028086d34f2962993d0
name: python-llama-models-help
arch: noarch
version: 0.0.62
epoch: 0
release: 1
summary: Development documents and examples for llama-models
url: https://github.com/meta-llama/llama-models
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-llama-models-0.0.62-1.src.rpm
location_href: Packages/python-llama-models-help-0.0.62-1.noarch.rpm
checksum_type: sha256
description:
  Llama is an accessible, open large language model (LLM) designed for developers, researchers, and businesses to build, experiment, and responsibly scale their generative AI ideas. Part of a foundational system, it serves as a bedrock for innovation in the global community. A few key aspects:
  1. **Open access**: Easy accessibility to cutting-edge large language models, fostering collaboration and advancements among developers, researchers, and organizations
  2. **Broad ecosystem**: Llama models have been downloaded hundreds of millions of times, there are thousands of community projects built on Llama and platform support is broad from cloud providers to startups - the world is building with Llama!
  3. **Trust & safety**: Llama models are part of a comprehensive approach to trust and safety, releasing models and tools that are designed to enable community collaboration and encourage the standardization of the development and usage of trust and safety tools for generative AI
  Our mission is to empower individuals and industry through this opportunity while fostering an environment of discovery and ethical AI advancements. The model weights are licensed for researchers and commercial entities, upholding the principles of openness.

  [![PyPI - Downloads](https://img.shields.io/pypi/dm/llama-models)](https://pypi.org/project/llama-models/)
  [![Discord](https://img.shields.io/discord/1257833999603335178)](https://discord.gg/TZAAYNVtrU)
  |  **Model** | **Launch date** | **Model sizes** | **Context Length** | **Tokenizer** | **Acceptable use policy**  |  **License** | **Model Card** |
  | :----: | :----: | :----: | :----:|:----:|:----:|:----:|:----:|
  | Llama 2 | 7/18/2023 | 7B, 13B, 70B | 4K | Sentencepiece | [Use Policy](models/llama2/USE_POLICY.md) | [License](models/llama2/LICENSE) | [Model Card](models/llama2/MODEL_CARD.md) |
  | Llama 3 | 4/18/2024 | 8B, 70B | 8K | TikToken-based | [Use Policy](models/llama3/USE_POLICY.md) | [License](models/llama3/LICENSE) | [Model Card](models/llama3/MODEL_CARD.md) |
  | Llama 3.1 | 7/23/2024 | 8B, 70B, 405B | 128K | TikToken-based | [Use Policy](models/llama3_1/USE_POLICY.md) | [License](models/llama3_1/LICENSE) | [Model Card](models/llama3_1/MODEL_CARD.md) |
  | Llama 3.2 | 9/25/2024 | 1B, 3B | 128K | TikToken-based | [Use Policy](models/llama3_2/USE_POLICY.md) | [License](models/llama3_2/LICENSE) | [Model Card](models/llama3_2/MODEL_CARD.md) |
  | Llama 3.2-Vision | 9/25/2024 | 11B, 90B | 128K | TikToken-based | [Use Policy](models/llama3_2/USE_POLICY.md) | [License](models/llama3_2/LICENSE) | [Model Card](models/llama3_2/MODEL_CARD_VISION.md) |

  To download the model weights and tokenizer:
  1. Visit the [Meta Llama website](https://llama.meta.com/llama-downloads/).
  2. Read and accept the license.
  3. Once your request is approved you will receive a signed URL via email.
  4. Install the [Llama CLI](https://github.com/meta-llama/llama-stack): `pip install llama-stack`. (**<-- Start Here if you have received an email already.**)
  5. Run `llama model list` to show the latest available models and determine the model ID you wish to download. **NOTE**:
  If you want older versions of models, run `llama model list --show-all` to show all the available Llama models.
  6. Run: `llama download --source meta --model-id CHOSEN_MODEL_ID`
  7. Pass the URL provided when prompted to start the download.
  Remember that the links expire after 24 hours and a certain amount of downloads. You can always re-request a link if you start seeing errors such as `403: Forbidden`.

  You need to install the following dependencies (in addition to the `requirements.txt` in the root directory of this repository) to run the models:
  ```
  pip install torch fairscale fire blobfile
  ```
  After installing the dependencies, you can run the example scripts (within `llama_models/scripts/` sub-directory) as follows:
  ```bash

  CHECKPOINT_DIR=~/.llama/checkpoints/Meta-Llama3.1-8B-Instruct
  PYTHONPATH=$(git rev-parse --show-toplevel) torchrun llama_models/scripts/example_chat_completion.py $CHECKPOINT_DIR
  ```
  The above script should be used with an Instruct (Chat) model. For a Base model, use the script `llama_models/scripts/example_text_completion.py`. Note that you can use these scripts with both Llama3 and Llama3.1 series of models.
  For running larger models with tensor parallelism, you should modify as:
  ```bash

  NGPUS=8
  PYTHONPATH=$(git rev-parse --show-toplevel) torchrun \
    --nproc_per_node=$NGPUS \
    llama_models/scripts/example_chat_completion.py $CHECKPOINT_DIR \
    --model_parallel_size $NGPUS
  ```
  For more flexibility in running inference (including running FP8 inference), please see the [`Llama Stack`](https://github.com/meta-llama/llama-stack) repository.

  We also provide downloads on [Hugging Face](https://huggingface.co/meta-llama), in both transformers and native `llama3` formats. To download the weights from Hugging Face, please follow these steps:
  - Visit one of the repos, for example [meta-llama/Meta-Llama-3.1-8B-Instruct](https://huggingface.co/meta-llama/Meta-Llama-3.1-8B-Instruct).
  - Read and accept the license. Once your request is approved, you'll be granted access to all Llama 3.1 models as well as previous versions. Note that requests used to take up to one hour to get processed.
  - To download the original native weights to use with this repo, click on the "Files and versions" tab and download the contents of the `original` folder. You can also download them from the command line if you `pip install huggingface-hub`:
  ```bash
  huggingface-cli download meta-llama/Meta-Llama-3.1-8B-Instruct --include "original/*" --local-dir meta-llama/Meta-Llama-3.1-8B-Instruct
  ```
  **NOTE** The original native weights of meta-llama/Meta-Llama-3.1-405B would not be available through this HugginFace repo.
  - To use with transformers, the following [pipeline](https://huggingface.co/docs/transformers/en/main_classes/pipelines) snippet will download and cache the weights:
    ```python
    import transformers
    import torch
    model_id = "meta-llama/Meta-Llama-3.1-8B-Instruct"
    pipeline = transformers.pipeline(
      "text-generation",
      model="meta-llama/Meta-Llama-3.1-8B-Instruct",
      model_kwargs={"torch_dtype": torch.bfloat16},
      device="cuda",
    )
    ```

  You can install this repository as a [package](https://pypi.org/project/llama-models/) by just doing `pip install llama-models`

  Llama models are a new technology that carries potential risks with use. Testing conducted to date has not — and could not — cover all scenarios.
  To help developers address these risks, we have created the [Responsible Use Guide](https://ai.meta.com/static-resource/responsible-use-guide/).

  Please report any software “bug” or other problems with the models through one of the following means:
  - Reporting issues with the model: [https://github.com/meta-llama/llama-models/issues](https://github.com/meta-llama/llama-models/issues)
  - Reporting risky content generated by the model: [developers.facebook.com/llama_output_feedback](http://developers.facebook.com/llama_output_feedback)
  - Reporting bugs and security concerns: [facebook.com/whitehat/info](http://facebook.com/whitehat/info)

  For common questions, the FAQ can be found [here](https://llama.meta.com/faq), which will be updated over time as new questions arise.


pkgId: 88248d48c5bed7de56d5014f1d1e32251fb7c62b29c87df1fa1afbc0ee659631
name: python-llama-parse-help
arch: noarch
version: 0.5.18
epoch: 0
release: 1
summary: Development documents and examples for llama-parse
url: https://pypi.org/project/llama-parse/
rpm_license: MIT
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-llama-parse-0.5.18-1.src.rpm
location_href: Packages/python-llama-parse-help-0.5.18-1.noarch.rpm
checksum_type: sha256
description:
  [![PyPI - Downloads](https://img.shields.io/pypi/dm/llama-parse)](https://pypi.org/project/llama-parse/)
  [![GitHub contributors](https://img.shields.io/github/contributors/run-llama/llama_parse)](https://github.com/run-llama/llama_parse/graphs/contributors)
  [![Discord](https://img.shields.io/discord/1059199217496772688)](https://discord.gg/dGcwcsnxhU)

  LlamaParse is a **GenAI-native document parser** that can parse complex document data for any downstream LLM use case (RAG, agents).

  It is really good at the following:

  - ✅ **Broad file type support**: Parsing a variety of unstructured file types (.pdf, .pptx, .docx, .xlsx, .html) with text, tables, visual elements, weird layouts, and more.
  - ✅ **Table recognition**: Parsing embedded tables accurately into text and semi-structured representations.
  - ✅ **Multimodal parsing and chunking**: Extracting visual elements (images/diagrams) into structured formats and return image chunks using the latest multimodal models.
  - ✅ **Custom parsing**: Input custom prompt instructions to customize the output the way you want it.

  LlamaParse directly integrates with [LlamaIndex](https://github.com/run-llama/llama_index).

  The free plan is up to 1000 pages a day. Paid plan is free 7k pages per week + 0.3c per additional page by default. There is a sandbox available to test the API [**https://cloud.llamaindex.ai/parse ↗**](https://cloud.llamaindex.ai/parse).

  Read below for some quickstart information, or see the [full documentation](https://docs.cloud.llamaindex.ai/).

  If you're a company interested in enterprise RAG solutions, and/or high volume/on-prem usage of LlamaParse, come [talk to us](https://www.llamaindex.ai/contact).



  First, login and get an api-key from [**https://cloud.llamaindex.ai/api-key ↗**](https://cloud.llamaindex.ai/api-key).

  Then, make sure you have the latest LlamaIndex version installed.

  **NOTE:** If you are upgrading from v0.9.X, we recommend following our [migration guide](https://pretty-sodium-5e0.notion.site/v0-10-0-Migration-Guide-6ede431dcb8841b09ea171e7f133bd77), as well as uninstalling your previous version first.

  ```
  pip uninstall llama-index  # run this if upgrading from v0.9.x or older
  pip install -U llama-index --upgrade --no-cache-dir --force-reinstall
  ```

  Lastly, install the package:

  `pip install llama-parse`

  Now you can parse your first PDF file using the command line interface. Use the command `llama-parse [file_paths]`. See the help text with `llama-parse --help`.

  ```bash
  export LLAMA_CLOUD_API_KEY='llx-...'


  llama-parse my_file.pdf --result-type text --output-file output.txt


  llama-parse my_file.pdf --result-type markdown --output-file output.md


  llama-parse my_file.pdf --output-raw-json --output-file output.json
  ```

  You can also create simple scripts:

  ```python
  import nest_asyncio

  nest_asyncio.apply()

  from llama_parse import LlamaParse

  parser = LlamaParse(
      api_key="llx-...",  # can also be set in your env as LLAMA_CLOUD_API_KEY
      result_type="markdown",  # "markdown" and "text" are available
      num_workers=4,  # if multiple files passed, split in `num_workers` API calls
      verbose=True,
      language="en",  # Optionally you can define a language, default=en
  )


  documents = parser.load_data("./my_file.pdf")


  documents = parser.load_data(["./my_file1.pdf", "./my_file2.pdf"])


  documents = await parser.aload_data("./my_file.pdf")


  documents = await parser.aload_data(["./my_file1.pdf", "./my_file2.pdf"])
  ```



  You can parse a file object directly:

  ```python
  import nest_asyncio

  nest_asyncio.apply()

  from llama_parse import LlamaParse

  parser = LlamaParse(
      api_key="llx-...",  # can also be set in your env as LLAMA_CLOUD_API_KEY
      result_type="markdown",  # "markdown" and "text" are available
      num_workers=4,  # if multiple files passed, split in `num_workers` API calls
      verbose=True,
      language="en",  # Optionally you can define a language, default=en
  )

  file_name = "my_file1.pdf"
  extra_info = {"file_name": file_name}

  with open(f"./{file_name}", "rb") as f:
      
      documents = parser.load_data(f, extra_info=extra_info)


  with open(f"./{file_name}", "rb") as f:
      file_bytes = f.read()
      
      documents = parser.load_data(file_bytes, extra_info=extra_info)
  ```



  You can also integrate the parser as the default PDF loader in `SimpleDirectoryReader`:

  ```python
  import nest_asyncio

  nest_asyncio.apply()

  from llama_parse import LlamaParse
  from llama_index.core import SimpleDirectoryReader

  parser = LlamaParse(
      api_key="llx-...",  # can also be set in your env as LLAMA_CLOUD_API_KEY
      result_type="markdown",  # "markdown" and "text" are available
      verbose=True,
  )

  file_extractor = {".pdf": parser}
  documents = SimpleDirectoryReader(
      "./data", file_extractor=file_extractor
  ).load_data()
  ```

  Full documentation for `SimpleDirectoryReader` can be found on the [LlamaIndex Documentation](https://docs.llamaindex.ai/en/stable/module_guides/loading/simpledirectoryreader.html).



  Several end-to-end indexing examples can be found in the examples folder

  - [Getting Started](examples/demo_basic.ipynb)
  - [Advanced RAG Example](examples/demo_advanced.ipynb)
  - [Raw API Usage](examples/demo_api.ipynb)



  [https://docs.cloud.llamaindex.ai/](https://docs.cloud.llamaindex.ai/)



  See the [Terms of Service Here](./TOS.pdf).



  LlamaParse is part of LlamaCloud, our e2e enterprise RAG platform that provides out-of-the-box, production-ready connectors, indexing, and retrieval over your complex data sources. We offer SaaS and VPC options.

  LlamaCloud is currently available via waitlist (join by [creating an account](https://cloud.llamaindex.ai/)). If you're interested in state-of-the-art quality and in centralizing your RAG efforts, come [get in touch with us](https://www.llamaindex.ai/contact).


pkgId: 0541b6cf8c9fb45d7295c7cc03fc9c11cf52d718cdd7da782eaaca82bae94f04
name: python-llama-stack-client-help
arch: noarch
version: 0.0.62
epoch: 0
release: 1
summary: Development documents and examples for llama-stack-client
url: https://github.com/stainless-sdks/llama-stack-python
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-llama-stack-client-0.0.62-1.src.rpm
location_href: Packages/python-llama-stack-client-help-0.0.62-1.noarch.rpm
checksum_type: sha256
description:
  [![PyPI version](https://img.shields.io/pypi/v/llama_stack_client.svg)](https://pypi.org/project/llama_stack_client/) [![PyPI - Downloads](https://img.shields.io/pypi/dm/llama-stack-client)](https://pypi.org/project/llama-stack-client/)
  [![Discord](https://img.shields.io/discord/1257833999603335178)](https://discord.gg/llama-stack)

  The Llama Stack Client Python library provides convenient access to the Llama Stack Client REST API from any Python 3.7+
  application. The library includes type definitions for all request params and response fields,
  and offers both synchronous and asynchronous clients powered by [httpx](https://github.com/encode/httpx).

  It is generated with [Stainless](https://www.stainlessapi.com/).



  For starting up a Llama Stack server, please checkout our guides in our [llama-stack](https://github.com/meta-llama/llama-stack/blob/main/docs/resources/llama-stack-spec.html) repo.

  The REST API documentation can be found on our [llama-stack OpenAPI spec](https://github.com/meta-llama/llama-stack/blob/main/docs/resources/llama-stack-spec.html). The full API of this library can be found in [api.md](https://github.com/stainless-sdks/llama-stack-python/tree/main/api.md).

  You can find more example apps with client SDKs to talk with the Llama Stack server in our [llama-stack-apps](https://github.com/meta-llama/llama-stack-apps/tree/main) repo.



  ```sh
  pip install llama-stack-client
  ```



  The full API of this library can be found in [api.md](https://github.com/stainless-sdks/llama-stack-python/tree/main/api.md). You may find basic client examples in our [llama-stack-apps](https://github.com/meta-llama/llama-stack-apps/tree/main) repo.

  ```python
  from llama_stack_client import LlamaStackClient
  from llama_stack_client.types import UserMessage

  client = LlamaStackClient(
      base_url=f"http://{host}:{port}",
  )

  response = client.inference.chat_completion(
      messages=[
          UserMessage(
              content="hello world, write me a 2 sentence poem about the moon",
              role="user",
          ),
      ],
      model="meta-llama/Llama-3.2-3B-Instruct",
      stream=False,
  )
  print(response)
  ```

  After installing the `llama-stack-client` package, you can also use the [`llama-stack-client` CLI](https://github.com/meta-llama/llama-stack/tree/main/llama-stack-client) to interact with the Llama Stack server.
  ```bash
  llama-stack-client inference chat-completion --message "hello, what model are you"
  ```

  ```python
  ChatCompletionResponse(
      completion_message=CompletionMessage(
          content="Hello! I'm an AI model, and I'm based on a large language model architecture. My knowledge cutoff is December 2023, which means I was trained on a dataset that was current up to that point in time.\n\nI don't have a specific model name, but I'm similar to other
  conversational AI models like LLaMA, Bard, or ChatGPT. My primary function is to understand and respond to human language, generating human-like text based on the input I receive.\n\nI'm designed to be helpful and informative, and I can assist with a wide range of topics and tasks,
  from answering questions and providing information to generating text and completing tasks. How can I help you today?",
          role='assistant',
          stop_reason='end_of_turn',
          tool_calls=[]
      ),
      logprobs=None
  )
  ```



  Simply import `AsyncLlamaStackClient` instead of `LlamaStackClient` and use `await` with each API call:

  ```python
  import asyncio
  from llama_stack_client import AsyncLlamaStackClient

  client = AsyncLlamaStackClient(
      
      environment="sandbox",
  )


  async def main() -> None:
      session = await client.agents.sessions.create(
          agent_id="agent_id",
          session_name="session_name",
      )
      print(session.session_id)


  asyncio.run(main())
  ```

  Functionality between the synchronous and asynchronous clients is otherwise identical.



  Nested request parameters are [TypedDicts](https://docs.python.org/3/library/typing.html#typing.TypedDict). Responses are [Pydantic models](https://docs.pydantic.dev) which also provide helper methods for things like:

  - Serializing back into JSON, `model.to_json()`
  - Converting to a dictionary, `model.to_dict()`

  Typed requests and responses provide autocomplete and documentation within your editor. If you would like to see type errors in VS Code to help catch bugs earlier, set `python.analysis.typeCheckingMode` to `basic`.



  When the library is unable to connect to the API (for example, due to network connection problems or a timeout), a subclass of `llama_stack_client.APIConnectionError` is raised.

  When the API returns a non-success status code (that is, 4xx or 5xx
  response), a subclass of `llama_stack_client.APIStatusError` is raised, containing `status_code` and `response` properties.

  All errors inherit from `llama_stack_client.APIError`.

  ```python
  import llama_stack_client
  from llama_stack_client import LlamaStackClient

  client = LlamaStackClient()

  try:
      client.agents.sessions.create(
          agent_id="agent_id",
          session_name="session_name",
      )
  except llama_stack_client.APIConnectionError as e:
      print("The server could not be reached")
      print(e.__cause__)  # an underlying Exception, likely raised within httpx.
  except llama_stack_client.RateLimitError as e:
      print("A 429 status code was received; we should back off a bit.")
  except llama_stack_client.APIStatusError as e:
      print("Another non-200-range status code was received")
      print(e.status_code)
      print(e.response)
  ```

  Error codes are as followed:

  | Status Code | Error Type                 |
  | ----------- | -------------------------- |
  | 400         | `BadRequestError`          |
  | 401         | `AuthenticationError`      |
  | 403         | `PermissionDeniedError`    |
  | 404         | `NotFoundError`            |
  | 422         | `UnprocessableEntityError` |
  | 429         | `RateLimitError`           |
  | >=500       | `InternalServerError`      |
  | N/A         | `APIConnectionError`       |



  Certain errors are automatically retried 2 times by default, with a short exponential backoff.
  Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict,
  429 Rate Limit, and >=500 Internal errors are all retried by default.

  You can use the `max_retries` option to configure or disable retry settings:

  ```python
  from llama_stack_client import LlamaStackClient


  client = LlamaStackClient(
      
      max_retries=0,
  )


  client.with_options(max_retries=5).agents.sessions.create(
      agent_id="agent_id",
      session_name="session_name",
  )
  ```



  By default requests time out after 1 minute. You can configure this with a `timeout` option,
  which accepts a float or an [`httpx.Timeout`](https://www.python-httpx.org/advanced/#fine-tuning-the-configuration) object:

  ```python
  from llama_stack_client import LlamaStackClient


  client = LlamaStackClient(
      
      timeout=20.0,
  )


  client = LlamaStackClient(
      timeout=httpx.Timeout(60.0, read=5.0, write=10.0, connect=2.0),
  )


  client.with_options(timeout=5.0).agents.sessions.create(
      agent_id="agent_id",
      session_name="session_name",
  )
  ```

  On timeout, an `APITimeoutError` is thrown.

  Note that requests that time out are [retried twice by default](https://github.com/stainless-sdks/llama-stack-python/tree/main/#retries).





  We use the standard library [`logging`](https://docs.python.org/3/library/logging.html) module.

  You can enable logging by setting the environment variable `LLAMA_STACK_CLIENT_LOG` to `debug`.

  ```shell
  $ export LLAMA_STACK_CLIENT_LOG=debug
  ```



  In an API response, a field may be explicitly `null`, or missing entirely; in either case, its value is `None` in this library. You can differentiate the two cases with `.model_fields_set`:

  ```py
  if response.my_field is None:
    if 'my_field' not in response.model_fields_set:
      print('Got json like {}, without a "my_field" key present at all.')
    else:
      print('Got json like {"my_field": null}.')
  ```



  The "raw" Response object can be accessed by prefixing `.with_raw_response.` to any HTTP method call, e.g.,

  ```py
  from llama_stack_client import LlamaStackClient

  client = LlamaStackClient()
  response = client.agents.sessions.with_raw_response.create(
      agent_id="agent_id",
      session_name="session_name",
  )
  print(response.headers.get('X-My-Header'))

  session = response.parse()  # get the object that `agents.sessions.create()` would have returned
  print(session.session_id)
  ```

  These methods return an [`APIResponse`](https://github.com/stainless-sdks/llama-stack-python/tree/main/src/llama_stack_client/_response.py) object.

  The async client returns an [`AsyncAPIResponse`](https://github.com/stainless-sdks/llama-stack-python/tree/main/src/llama_stack_client/_response.py) with the same structure, the only difference being `await`able methods for reading the response content.



  The above interface eagerly reads the full response body when you make the request, which may not always be what you want.

  To stream the response body, use `.with_streaming_response` instead, which requires a context manager and only reads the response body once you call `.read()`, `.text()`, `.json()`, `.iter_bytes()`, `.iter_text()`, `.iter_lines()` or `.parse()`. In the async client, these are async methods.

  ```python
  with client.agents.sessions.with_streaming_response.create(
      agent_id="agent_id",
      session_name="session_name",
  ) as response:
      print(response.headers.get("X-My-Header"))

      for line in response.iter_lines():
          print(line)
  ```

  The context manager is required so that the response will reliably be closed.



  This library is typed for convenient access to the documented API.

  If you need to access undocumented endpoints, params, or response properties, the library can still be used.



  To make requests to undocumented endpoints, you can make requests using `client.get`, `client.post`, and other
  http verbs. Options on the client will be respected (such as retries) will be respected when making this
  request.

  ```py
  import httpx

  response = client.post(
      "/foo",
      cast_to=httpx.Response,
      body={"my_param": True},
  )

  print(response.headers.get("x-foo"))
  ```



  If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` request
  options.



  To access undocumented response properties, you can access the extra fields like `response.unknown_prop`. You
  can also get all the extra fields on the Pydantic model as a dict with
  [`response.model_extra`](https://docs.pydantic.dev/latest/api/base_model/#pydantic.BaseModel.model_extra).



  You can directly override the [httpx client](https://www.python-httpx.org/api/#client) to customize it for your use case, including:

  - Support for proxies
  - Custom transports
  - Additional [advanced](https://www.python-httpx.org/advanced/clients/) functionality

  ```python
  from llama_stack_client import LlamaStackClient, DefaultHttpxClient

  client = LlamaStackClient(
      
      base_url="http://my.test.server.example.com:8083",
      http_client=DefaultHttpxClient(
          proxies="http://my.test.proxy.example.com",
          transport=httpx.HTTPTransport(local_address="0.0.0.0"),
      ),
  )
  ```

  You can also customize the client on a per-request basis by using `with_options()`:

  ```python
  client.with_options(http_client=DefaultHttpxClient(...))
  ```



  By default the library closes underlying HTTP connections whenever the client is [garbage collected](https://docs.python.org/3/reference/datamodel.html#object.__del__). You can manually close the client using the `.close()` method if desired, or with a context manager that closes when exiting.



  This package generally follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes that only affect static types, without breaking runtime behavior.
  2. Changes to library internals which are technically public but not intended or documented for external use. _(Please open a GitHub issue to let us know if you are relying on such internals)_.
  3. Changes that we do not expect to impact the vast majority of users in practice.

  We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

  We are keen for your feedback; please open an [issue](https://www.github.com/stainless-sdks/llama-stack-python/issues) with questions, bugs, or suggestions.



  If you've upgraded to the latest version but aren't seeing any new features you were expecting then your python environment is likely still using an older version.

  You can determine the version that is being used at runtime with:

  ```py
  import llama_stack_client
  print(llama_stack_client.__version__)
  ```



  Python 3.7 or higher.


pkgId: 8da6ca5c83c2bca81b93faa3077757e74a5317f196d53a96188285de83b0b50f
name: python-llama-stack-help
arch: noarch
version: 0.0.62
epoch: 0
release: 1
summary: Development documents and examples for llama-stack
url: https://github.com/meta-llama/llama-stack
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-llama-stack-0.0.62-1.src.rpm
location_href: Packages/python-llama-stack-help-0.0.62-1.noarch.rpm
checksum_type: sha256
description:
  [![PyPI version](https://img.shields.io/pypi/v/llama_stack.svg)](https://pypi.org/project/llama_stack/)
  [![PyPI - Downloads](https://img.shields.io/pypi/dm/llama-stack)](https://pypi.org/project/llama-stack/)
  [![Discord](https://img.shields.io/discord/1257833999603335178)](https://discord.gg/llama-stack)

  [**Quick Start**](https://llama-stack.readthedocs.io/en/latest/getting_started/index.html) | [**Documentation**](https://llama-stack.readthedocs.io/en/latest/index.html) | [**Zero-to-Hero Guide**](https://github.com/meta-llama/llama-stack/tree/main/docs/zero_to_hero_guide)

  Llama Stack defines and standardizes the set of core building blocks needed to bring generative AI applications to market. These building blocks are presented in the form of interoperable APIs with a broad set of Service Providers providing their implementations.

  <div style="text-align: center;">
    <img
      src="https://github.com/user-attachments/assets/33d9576d-95ea-468d-95e2-8fa233205a50"
      width="480"
      title="Llama Stack"
      alt="Llama Stack"
    />
  </div>

  Our goal is to provide pre-packaged implementations which can be operated in a variety of deployment environments: developers start iterating with Desktops or their mobile devices and can seamlessly transition to on-prem or public cloud deployments. At every point in this transition, the same set of APIs and the same developer experience is available.

  > ⚠️ **Note**
  > The Stack APIs are rapidly improving, but still very much work in progress and we invite feedback as well as direct contributions.




  We have working implementations of the following APIs today:
  - Inference
  - Safety
  - Memory
  - Agents
  - Eval
  - Telemetry

  Alongside these APIs, we also related APIs for operating with associated resources (see [Concepts](https://llama-stack.readthedocs.io/en/latest/concepts/index.html#resources)):

  - Models
  - Shields
  - Memory Banks
  - Eval Tasks
  - Datasets
  - Scoring Functions

  We are also working on the following APIs which will be released soon:

  - Post Training
  - Synthetic Data Generation
  - Reward Scoring

  Each of the APIs themselves is a collection of REST endpoints.





  Unlike other frameworks, Llama Stack is built with a service-oriented, REST API-first approach. Such a design not only allows for seamless transitions from a local to remote deployments, but also forces the design to be more declarative. We believe this restriction can result in a much simpler, robust developer experience. This will necessarily trade-off against expressivity however if we get the APIs right, it can lead to a very powerful platform.



  We expect the set of APIs we design to be composable. An Agent abstractly depends on { Inference, Memory, Safety } APIs but does not care about the actual implementation details. Safety itself may require model inference and hence can depend on the Inference API.



  We expect to provide turnkey solutions for popular deployment scenarios. It should be easy to deploy a Llama Stack server on AWS or on a private data center. Either of these should allow a developer to get started with powerful agentic apps, model evaluations or fine-tuning services in a matter of minutes. They should all result in the same uniform observability and developer experience.



  As a Meta initiated project, we have started by explicitly focusing on Meta's Llama series of models. Supporting the broad set of open models is no easy task and we want to start with models we understand best.



  There is a vibrant ecosystem of Providers which provide efficient inference or scalable vector stores or powerful observability solutions. We want to make sure it is easy for developers to pick and choose the best implementations for their use cases. We also want to make sure it is easy for new Providers to onboard and participate in the ecosystem.

  Additionally, we have designed every element of the Stack such that APIs as well as Resources (like Models) can be federated.




  |                                  **API Provider Builder**                                  |    **Environments**    |     **Agents**     |   **Inference**    |     **Memory**     |     **Safety**     |   **Telemetry**    |
  |:------------------------------------------------------------------------------------------:|:----------------------:|:------------------:|:------------------:|:------------------:|:------------------:|:------------------:|
  |                                       Meta Reference                                       |      Single Node       | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |
  |                                          Cerebras                                          |         Hosted         |                    | :heavy_check_mark: |                    |                    |                    |
  |                                         Fireworks                                          |         Hosted         | :heavy_check_mark: | :heavy_check_mark: | :heavy_check_mark: |                    |                    |
  |                                        AWS Bedrock                                         |         Hosted         |                    | :heavy_check_mark: |                    | :heavy_check_mark: |                    |
  |                                          Together                                          |         Hosted         | :heavy_check_mark: | :heavy_check_mark: |                    | :heavy_check_mark: |                    |
  |                                           Ollama                                           |      Single Node       |                    | :heavy_check_mark: |                    |                    |                    |
  |                                            TGI                                             | Hosted and Single Node |                    | :heavy_check_mark: |                    |                    |                    |
  | [NVIDIA NIM](https://build.nvidia.com/nim?filters=nimType%3Anim_type_run_anywhere&q=llama) | Hosted and Single Node |                    | :heavy_check_mark: |                    |                    |                    |
  |                                           Chroma                                           |      Single Node       |                    |                    | :heavy_check_mark: |                    |                    |
  |                                         PG Vector                                          |      Single Node       |                    |                    | :heavy_check_mark: |                    |                    |
  |                                     PyTorch ExecuTorch                                     |     On-device iOS      | :heavy_check_mark: | :heavy_check_mark: |                    |                    |                    |
  |                        [vLLM](https://github.com/vllm-project/vllm)                        | Hosted and Single Node |                    | :heavy_check_mark: |                    |                    |                    |



  |               **Distribution**                |                                                                    **Llama Stack Docker**                                                                     |                                                 Start This Distribution                                                  |
  |:---------------------------------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------------------:|
  |                Meta Reference                 |           [llamastack/distribution-meta-reference-gpu](https://hub.docker.com/repository/docker/llamastack/distribution-meta-reference-gpu/general)           |      [Guide](https://llama-stack.readthedocs.io/en/latest/distributions/self_hosted_distro/meta-reference-gpu.html)      |
  |           Meta Reference Quantized            | [llamastack/distribution-meta-reference-quantized-gpu](https://hub.docker.com/repository/docker/llamastack/distribution-meta-reference-quantized-gpu/general) | [Guide](https://llama-stack.readthedocs.io/en/latest/distributions/self_hosted_distro/meta-reference-quantized-gpu.html) |
  |                   Cerebras                    |                     [llamastack/distribution-cerebras](https://hub.docker.com/repository/docker/llamastack/distribution-cerebras/general)                     |   [Guide](https://llama-stack.readthedocs.io/en/latest/getting_started/distributions/self_hosted_distro/cerebras.html)   |
  |                    Ollama                     |                       [llamastack/distribution-ollama](https://hub.docker.com/repository/docker/llamastack/distribution-ollama/general)                       |            [Guide](https://llama-stack.readthedocs.io/en/latest/distributions/self_hosted_distro/ollama.html)            |
  |                      TGI                      |                          [llamastack/distribution-tgi](https://hub.docker.com/repository/docker/llamastack/distribution-tgi/general)                          |             [Guide](https://llama-stack.readthedocs.io/en/latest/distributions/self_hosted_distro/tgi.html)              |
  |                   Together                    |                     [llamastack/distribution-together](https://hub.docker.com/repository/docker/llamastack/distribution-together/general)                     |           [Guide](https://llama-stack.readthedocs.io/en/latest/distributions/self_hosted_distro/together.html)           |
  |                   Fireworks                   |                    [llamastack/distribution-fireworks](https://hub.docker.com/repository/docker/llamastack/distribution-fireworks/general)                    |          [Guide](https://llama-stack.readthedocs.io/en/latest/distributions/self_hosted_distro/fireworks.html)           |
  | [vLLM](https://github.com/vllm-project/vllm)  |                  [llamastack/distribution-remote-vllm](https://hub.docker.com/repository/docker/llamastack/distribution-remote-vllm/general)                  |         [Guide](https://llama-stack.readthedocs.io/en/latest/distributions/self_hosted_distro/remote-vllm.html)          |



  You have two ways to install this repository:

  1. **Install as a package**:
     You can install the repository directly from [PyPI](https://pypi.org/project/llama-stack/) by running the following command:
     ```bash
     pip install llama-stack
     ```

  2. **Install from source**:
     If you prefer to install from the source code, make sure you have [conda installed](https://docs.conda.io/projects/conda/en/stable).
     Then, follow these steps:
     ```bash
      mkdir -p ~/local
      cd ~/local
      git clone git@github.com:meta-llama/llama-stack.git

      conda create -n stack python=3.10
      conda activate stack

      cd llama-stack
      $CONDA_PREFIX/bin/pip install -e .
     ```



  Please checkout our [Documentation](https://llama-stack.readthedocs.io/en/latest/index.html) page for more details.

  * [CLI reference](https://llama-stack.readthedocs.io/en/latest/references/llama_cli_reference/index.html)
      * Guide using `llama` CLI to work with Llama models (download, study prompts), and building/starting a Llama Stack distribution.
  * [Getting Started](https://llama-stack.readthedocs.io/en/latest/getting_started/index.html)
      * Quick guide to start a Llama Stack server.
      * [Jupyter notebook](./docs/notebooks/Llama_Stack_Building_AI_Applications.ipynb) to walk-through how to use simple text and vision inference llama_stack_client APIs
      * The complete Llama Stack lesson [Colab notebook](https://colab.research.google.com/drive/1dtVmxotBsI4cGZQNsJRYPrLiDeT0Wnwt) of the new [Llama 3.2 course on Deeplearning.ai](https://learn.deeplearning.ai/courses/introducing-multimodal-llama-3-2/lesson/8/llama-stack).
      * A [Zero-to-Hero Guide](https://github.com/meta-llama/llama-stack/tree/main/docs/zero_to_hero_guide) that guide you through all the key components of llama stack with code samples.
  * [Contributing](CONTRIBUTING.md)
      * [Adding a new API Provider](https://llama-stack.readthedocs.io/en/latest/contributing/new_api_provider.html) to walk-through how to add a new API provider.



  |  **Language** |  **Client SDK** | **Package** |
  | :----: | :----: | :----: |
  | Python |  [llama-stack-client-python](https://github.com/meta-llama/llama-stack-client-python) | [![PyPI version](https://img.shields.io/pypi/v/llama_stack_client.svg)](https://pypi.org/project/llama_stack_client/)
  | Swift  | [llama-stack-client-swift](https://github.com/meta-llama/llama-stack-client-swift) | [![Swift Package Index](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fmeta-llama%2Fllama-stack-client-swift%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/meta-llama/llama-stack-client-swift)
  | Node   | [llama-stack-client-node](https://github.com/meta-llama/llama-stack-client-node) | [![NPM version](https://img.shields.io/npm/v/llama-stack-client.svg)](https://npmjs.org/package/llama-stack-client)
  | Kotlin | [llama-stack-client-kotlin](https://github.com/meta-llama/llama-stack-client-kotlin) | [![Maven version](https://img.shields.io/maven-central/v/com.llama.llamastack/llama-stack-client-kotlin)](https://central.sonatype.com/artifact/com.llama.llamastack/llama-stack-client-kotlin)

  Check out our client SDKs for connecting to Llama Stack server in your preferred language, you can choose from [python](https://github.com/meta-llama/llama-stack-client-python), [node](https://github.com/meta-llama/llama-stack-client-node), [swift](https://github.com/meta-llama/llama-stack-client-swift), and [kotlin](https://github.com/meta-llama/llama-stack-client-kotlin) programming languages to quickly build your applications.

  You can find more example scripts with client SDKs to talk with the Llama Stack server in our [llama-stack-apps](https://github.com/meta-llama/llama-stack-apps/tree/main/examples) repo.


pkgId: 94e0530a66d63b1c80b5ec387d79d2972f0636d4345ee1c1a74ed2bc236b1d46
name: python-llamabot-help
arch: noarch
version: 0.10.4
epoch: 0
release: 1
summary: Development documents and examples for llamabot
url: https://pypi.org/project/llamabot/
rpm_license: None
rpm_group: Unspecified
rpm_buildhost: localhost
rpm_sourcerpm: python-llamabot-0.10.4-1.src.rpm
location_href: Packages/python-llamabot-help-0.10.4-1.noarch.rpm
checksum_type: sha256
description:
  LlamaBot implements a Pythonic interface to LLMs,
  making it much easier to experiment with LLMs in a Jupyter notebook
  and build Python apps that utilize LLMs.
  All models supported by [LiteLLM](https://github.com/BerriAI/litellm) are supported by LlamaBot.



  To install LlamaBot:

  ```python
  pip install llamabot==0.10.4
  ```





  LlamaBot supports using local models through Ollama.
  To do so, head over to the [Ollama website](https://ollama.ai) and install Ollama.
  Then follow the instructions below.





  If you have an OpenAI API key, then configure LlamaBot to use the API key by running:

  ```bash
  export OPENAI_API_KEY="sk-your1api2key3goes4here"
  ```



  If you have a Mistral API key, then configure LlamaBot to use the API key by running:

  ```bash
  export MISTRAL_API_KEY="your-api-key-goes-here"
  ```



  Other API providers will usually specify an environment variable to set.
  If you have an API key, then set the environment variable accordingly.





  The simplest use case of LlamaBot
  is to create a `SimpleBot` that keeps no record of chat history.
  This is effectively the same as a _stateless function_
  that you program with natural language instructions rather than code.
  This is useful for prompt experimentation,
  or for creating simple bots that are preconditioned on an instruction to handle texts
  and are then called upon repeatedly with different texts.



  For example, to create a Bot that explains a given chunk of text
  like Richard Feynman would:

  ```python
  from llamabot import SimpleBot

  system_prompt = "You are Richard Feynman. You will be given a difficult concept, and your task is to explain it back."
  feynman = SimpleBot(
    system_prompt,
    model_name="gpt-3.5-turbo"
  )
  ```

  For using GPT, you need to have the `OPENAI_API_KEY` environment variable configured. If you want to use `SimpleBot` with a local Ollama model, [check out this example](#using-simplebot-with-a-local-ollama-model)

  Now, `feynman` is callable on any arbitrary chunk of text and will return a rephrasing of that text in Richard Feynman's style (or more accurately, according to the style prescribed by the `system_prompt`).
  For example:

  ```python
  prompt = """
  Enzyme function annotation is a fundamental challenge, and numerous computational tools have been developed.
  However, most of these tools cannot accurately predict functional annotations,
  such as enzyme commission (EC) number,
  for less-studied proteins or those with previously uncharacterized functions or multiple activities.
  We present a machine learning algorithm named CLEAN (contrastive learning–enabled enzyme annotation)
  to assign EC numbers to enzymes with better accuracy, reliability,
  and sensitivity compared with the state-of-the-art tool BLASTp.
  The contrastive learning framework empowers CLEAN to confidently (i) annotate understudied enzymes,
  (ii) correct mislabeled enzymes, and (iii) identify promiscuous enzymes with two or more EC numbers—functions
  that we demonstrate by systematic in silico and in vitro experiments.
  We anticipate that this tool will be widely used for predicting the functions of uncharacterized enzymes,
  thereby advancing many fields, such as genomics, synthetic biology, and biocatalysis.
  """
  feynman(prompt)
  ```

  This will return something that looks like:

  ```text
  Alright, let's break this down.

  Enzymes are like little biological machines that help speed up chemical reactions in our
  bodies. Each enzyme has a specific job, or function, and we use something called an
  Enzyme Commission (EC) number to categorize these functions.

  Now, the problem is that we don't always know what function an enzyme has, especially if
  it's a less-studied or new enzyme. This is where computational tools come in. They try
  to predict the function of these enzymes, but they often struggle to do so accurately.

  So, the folks here have developed a new tool called CLEAN, which stands for contrastive
  learning–enabled enzyme annotation. This tool uses a machine learning algorithm, which
  is a type of artificial intelligence that learns from data to make predictions or
  decisions.

  CLEAN uses a method called contrastive learning. Imagine you have a bunch of pictures of
  cats and dogs, and you want to teach a machine to tell the difference. You'd show it
  pairs of pictures, some of the same animal (two cats or two dogs) and some of different
  animals (a cat and a dog). The machine would learn to tell the difference by contrasting
  the features of the two pictures. That's the basic idea behind contrastive learning.

  CLEAN uses this method to predict the EC numbers of enzymes more accurately than
  previous tools. It can confidently annotate understudied enzymes, correct mislabeled
  enzymes, and even identify enzymes that have more than one function.

  The creators of CLEAN have tested it with both computer simulations and lab experiments,
  and they believe it will be a valuable tool for predicting the functions of unknown
  enzymes. This could have big implications for fields like genomics, synthetic biology,
  and biocatalysis, which all rely on understanding how enzymes work.
  ```



  If you want to use an Ollama model hosted locally,
  then you would use the following syntax:

  ```python
  from llamabot import SimpleBot

  system_prompt = "You are Richard Feynman. You will be given a difficult concept, and your task is to explain it back."
  bot = SimpleBot(
      system_prompt,
      model_name="ollama_chat/llama2:13b"
  )
  ```

  Simply specify the `model_name` keyword argument following the `<provider>/<model name>` format. For example:

  * `ollama_chat/` as the prefix, and
  * a model name from the [Ollama library of models](https://ollama.ai/library)

  All you need to do is make sure Ollama is running locally;
  see the [Ollama documentation](https://ollama.ai/) for more details.
  (The same can be done for the `ChatBot` and `QueryBot` classes below!)

  The `model_name` argument is optional. If you don't provide it, Llamabot will try to use the default model. You can configure that in the `DEFAULT_LANGUAGE_MODEL` environment variable.



  To experiment with a Chat Bot in the Jupyter Notebook,
  we also provide the ChatBot interface.
  This interface automagically keeps track of chat history
  for as long as your Jupyter session is alive.
  Doing so allows you to use your own local Jupyter Notebook as a chat interface.

  For example:

  ```python
  from llamabot import ChatBot

  system_prompt="You are Richard Feynman. You will be given a difficult concept, and your task is to explain it back."
  feynman = ChatBot(
    system_prompt,
    session_name="feynman_chat",
    
    
    
    
  )
  ```

  For more explanation about the `model_name`, see [the examples with `SimpleBot`](#using-simplebot-with-a-local-ollama-model).

  Now, that you have a `ChatBot` instance, you can start a conversation with it.

  ```python
  prompt = """
  Enzyme function annotation is a fundamental challenge, and numerous computational tools have been developed.
  However, most of these tools cannot accurately predict functional annotations,
  such as enzyme commission (EC) number,
  for less-studied proteins or those with previously uncharacterized functions or multiple activities.
  We present a machine learning algorithm named CLEAN (contrastive learning–enabled enzyme annotation)
  to assign EC numbers to enzymes with better accuracy, reliability,
  and sensitivity compared with the state-of-the-art tool BLASTp.
  The contrastive learning framework empowers CLEAN to confidently (i) annotate understudied enzymes,
  (ii) correct mislabeled enzymes, and (iii) identify promiscuous enzymes with two or more EC numbers—functions
  that we demonstrate by systematic in silico and in vitro experiments.
  We anticipate that this tool will be widely used for predicting the functions of uncharacterized enzymes,
  thereby advancing many fields, such as genomics, synthetic biology, and biocatalysis.
  """
  feynman(prompt)
  ```

  With the chat history available, you can ask a follow-up question:

  ```python
  feynman("Is there a simpler way to rephrase the text such that a high schooler would understand it?")
  ```

  And your bot will work with the chat history to respond.



  The final bot provided is a QueryBot.
  This bot lets you query a collection of documents.
  To use it, you have two options:

  1. Pass in a list of paths to text files and make Llamabot create a new collection for them, or
  2. Pass in the `collection_name` of a previously instantiated `QueryBot` model. (This will load the previously-computed text index into memory.)

  An illustrative example creating a new collection:

  ```python
  from llamabot import QueryBot
  from pathlib import Path

  bot = QueryBot(
    system_prompt="You are an expert on Eric Ma's blog.",
    collection_name="eric_ma_blog",
    document_paths=[
      Path("/path/to/blog/post1.txt"),
      Path("/path/to/blog/post2.txt"),
      ...,
    ],
    
    
    
    
  ) # This creates a new embedding for my blog text.
  result = bot("Do you have any advice for me on career development?")
  ```

  An illustrative example using an already existing collection:

  ```python
  from llamabot import QueryBot

  bot = QueryBot(
    system_prompt="You are an expert on Eric Ma's blog",
    collection_name="eric_ma_blog",
    
    
    
    
  )  # This loads my previously-embedded blog text.
  result = bot("Do you have any advice for me on career development?")
  ```

  For more explanation about the `model_name`, see [the examples with `SimpleBot`](#using-simplebot-with-a-local-ollama-model).



  With the release of the OpenAI API updates,
  as long as you have an OpenAI API key,
  you can generate images with LlamaBot:

  ```python
  from llamabot import ImageBot

  bot = ImageBot()

  url = bot("A painting of a dog.")


  filepath = bot("A painting of a dog.")


  ```

  If you're in a Jupyter Notebook,
  you'll see the image show up magically as part of the output cell as well.



  Automagically record your prompt experimentation locally on your system
  by using llamabot's `Experiment` context manager:

  ```python
  from llamabot import Experiment, prompt, metric

  @prompt
  def sysprompt():
      """You are a funny llama."""

  @prompt
  def joke_about(topic):
      """Tell me a joke about {{ topic }}."""

  @metric
  def response_length(response) -> int:
      return len(response.content)

  with Experiment(name="llama_jokes") as exp:
      
      bot = SimpleBot(sysprompt(), model_name="gpt-4o")
      response = bot(joke_about("cars"))
      _ = response_length(response)
  ```

  And now they will be viewable in the locally-stored message logs:

  ![](./docs/cli/log-viewer/experiments.webp)



  Llamabot comes with CLI demos of what can be built with it and a bit of supporting code.

  Here is one where I expose a chatbot directly at the command line using `llamabot chat`:

  [![Watch the terminal session on Asciinema](https://asciinema.org/a/594332.png)](https://asciinema.org/a/594332)

  And here is another one where `llamabot` is used as part of the backend of a CLI app
  to chat with one's Zotero library using `llamabot zotero chat`:

  [![Watch the terminal session on Asciinema](https://asciinema.org/a/594326.png)](https://asciinema.org/a/594326)


  And finally, here is one where I use `llamabot`'s `SimpleBot` to create a bot
  that automatically writes commit messages for me.

  [![Watch the terminal session on Asciinema](https://asciinema.org/a/594334.png)](https://asciinema.org/a/594334)



  LlamaBot uses a caching mechanism to improve performance and reduce unnecessary API calls. By default, all cache entries expire after 1 day (86400 seconds). This behavior is implemented using the `diskcache` library.



  The cache is automatically configured when you use any of the bot classes (`SimpleBot`, `ChatBot`, or `QueryBot`). You don't need to set up the cache manually.



  The default cache directory is located at:

  ```
  ~/.llamabot/cache
  ```



  The cache timeout can be configured using the `LLAMABOT_CACHE_TIMEOUT` environment variable. By default, the cache timeout is set to 1 day (86400 seconds). To customize the cache timeout, set the `LLAMABOT_CACHE_TIMEOUT` environment variable to the desired value in seconds. For example:

  ```
  export LLAMABOT_CACHE_TIMEOUT=3600
  ```

  This will set the cache timeout to 1 hour (3600 seconds).





  New features are welcome!
  These are early and exciting days for users of large language models.
  Our development goals are to keep the project as simple as possible.
  Features requests that come with a pull request will be prioritized;
  the simpler the implementation of a feature (in terms of maintenance burden),
  the more likely it will be approved.



  Please submit a bug report using the issue tracker.



  Please use the issue tracker on GitHub.



  <!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
  <!-- prettier-ignore-start -->
  <!-- markdownlint-disable -->
  <table>
    <tbody>
      <tr>
        <td align="center" valign="top" width="14.28%"><a href="https://github.com/RenaLu"><img src="https://avatars.githubusercontent.com/u/12033704?v=4?s=100" width="100px;" alt="Rena Lu"/><br /><sub><b>Rena Lu</b></sub></a><br /><a href="#code-RenaLu" title="Code">💻</a></td>
        <td align="center" valign="top" width="14.28%"><a href="http://giessel.com"><img src="https://avatars.githubusercontent.com/u/1160997?v=4?s=100" width="100px;" alt="andrew giessel"/><br /><sub><b>andrew giessel</b></sub></a><br /><a href="#ideas-andrewgiessel" title="Ideas, Planning, & Feedback">🤔</a> <a href="#design-andrewgiessel" title="Design">🎨</a> <a href="#code-andrewgiessel" title="Code">💻</a></td>
        <td align="center" valign="top" width="14.28%"><a href="https://github.com/aidanbrewis"><img src="https://avatars.githubusercontent.com/u/83365064?v=4?s=100" width="100px;" alt="Aidan Brewis"/><br /><sub><b>Aidan Brewis</b></sub></a><br /><a href="#code-aidanbrewis" title="Code">💻</a></td>
        <td align="center" valign="top" width="14.28%"><a href="https://ericmjl.github.io/"><img src="https://avatars.githubusercontent.com/u/2631566?v=4?s=100" width="100px;" alt="Eric Ma"/><br /><sub><b>Eric Ma</b></sub></a><br /><a href="#ideas-ericmjl" title="Ideas, Planning, & Feedback">🤔</a> <a href="#design-ericmjl" title="Design">🎨</a> <a href="#code-ericmjl" title="Code">💻</a></td>
        <td align="center" valign="top" width="14.28%"><a href="http://stackoverflow.com/users/116/mark-harrison"><img src="https://avatars.githubusercontent.com/u/7154?v=4?s=100" width="100px;" alt="Mark Harrison"/><br /><sub><b>Mark Harrison</b></sub></a><br /><a href="#ideas-marhar" title="Ideas, Planning, & Feedback">🤔</a></td>
        <td align="center" valign="top" width="14.28%"><a href="https://github.com/reka"><img src="https://avatars.githubusercontent.com/u/382113?v=4?s=100" width="100px;" alt="reka"/><br /><sub><b>reka</b></sub></a><br /><a href="#doc-reka" title="Documentation">📖</a> <a href="#code-reka" title="Code">💻</a></td>
        <td align="center" valign="top" width="14.28%"><a href="https://github.com/anujsinha3"><img src="https://avatars.githubusercontent.com/u/21972901?v=4?s=100" width="100px;" alt="anujsinha3"/><br /><sub><b>anujsinha3</b></sub></a><br /><a href="#code-anujsinha3" title="Code">��</a> <a href="#doc-anujsinha3" title="Documentation">📖</a></td>
      </tr>
      <tr>
        <td align="center" valign="top" width="14.28%"><a href="https://github.com/ElliotSalisbury"><img src="https://avatars.githubusercontent.com/u/2605537?v=4?s=100" width="100px;" alt="Elliot Salisbury"/><br /><sub><b>Elliot Salisbury</b></sub></a><br /><a href="#doc-ElliotSalisbury" title="Documentation">📖</a></td>
        <td align="center" valign="top" width="14.28%"><a href="http://eefricker.github.io"><img src="https://avatars.githubusercontent.com/u/65178728?v=4?s=100" width="100px;" alt="Ethan Fricker, PhD"/><br /><sub><b>Ethan Fricker, PhD</b></sub></a><br /><a href="#doc-eefricker" title="Documentation">📖</a></td>
        <td align="center" valign="top" width="14.28%"><a href="https://speakerdeck.com/eltociear"><img src="https://avatars.githubusercontent.com/u/22633385?v=4?s=100" width="100px;" alt="Ikko Eltociear Ashimine"/><br /><sub><b>Ikko Eltociear Ashimine</b></sub></a><br /><a href="#doc-eltociear" title="Documentation">📖</a></td>
        <td align="center" valign="top" width="14.28%"><a href="https://github.com/amirmolavi"><img src="https://avatars.githubusercontent.com/u/19491452?v=4?s=100" width="100px;" alt="Amir Molavi"/><br /><sub><b>Amir Molavi</b></sub></a><br /><a href="#infra-amirmolavi" title="Infrastructure (Hosting, Build-Tools, etc)">🚇</a> <a href="#doc-amirmolavi" title="Documentation">📖</a></td>
      </tr>
    </tbody>
  </table>

  <!-- markdownlint-restore -->
  <!-- prettier-ignore-end -->

  <!-- ALL-CONTRIBUTORS-LIST:END -->


