semvec/pypi-packages huggingface dataset:
langchain-gradientai-narsi 0.1.3
An integration package connecting Digitalocean and LangChain
License: MIT
Requires Python: <4.0,>=3.9

# langchain-gradientai

This package contains the LangChain integration with DigitalOcean

## Installation

```bash
pip install -U langchain-gradientai
```

And you should configure credentials by setting the `DIGITALOCEAN_INFERENCE_KEY` environment variable:

1. Log in to the DigitalOcean Cloud console
2. Go to the **GradienAI Platform** and navigate to **Serverless Inference**.
2. Click on **Create model access key**, enter a name, and create the key.
3. Use the generated key as your `DIGITALOCEAN_INFERENCE_KEY`:   


Create .env file with your access key:  
```DIGITALOCEAN_INFERENCE_KEY=your_access_key_here```

## Chat Models

`ChatGradientAI` class exposes chat models from langchain-gradientai.

### Invoke

```python
import os
from dotenv import load_dotenv
from langchain_gradientai import ChatGradientAI

load_dotenv()

llm = ChatGradientAI(
    model="llama3.3-70b-instruct",
    api_key=os.getenv("DIGITALOCEAN_INFERENCE_KEY")
)

result = llm.invoke("What is the capital of France?.")
print(result)
```

### Stream

```python
import os
from dotenv import load_dotenv
from langchain_gradientai import ChatGradientAI

load_dotenv()

llm = ChatGradientAI(
    model="llama3.3-70b-instruct",
    api_key=os.getenv("DIGITALOCEAN_INFERENCE_KEY")
)

for chunk in llm.stream("Tell me what happened to the Dinosaurs?"):
    print(chunk.content, end="", flush=True)
```

More features coming soon.
Huster 0.0.6
HTTP Uploading Server Tool.
License: MIT

# Huster

HTTP Uploading Server Tool


![](https://img.shields.io/badge/python2-passing-brightgreen)
![](https://img.shields.io/badge/python3-passing-brightgreen)


## Install

You can install it from pip or source code.

- install from pip

    ```bash
    pip install huster
    ```

- install from github
    ```bash
    pip install git+https://github.com/ZQPei/Huster.git@master
    ```

- install from source code

    ```bash
    git clone https://github.com/ZQPei/Huster.git
    cd Huster
    python setup.py install # use sudo if necessary
    ```


## Usage

```bash
build_server --port [port=8000] --base_dir [base_dir="/"]
```

or

```bash
python -m huster.server --port [port=8000] --base_dir [base_dir="/"]
```

For simplification, the following command can redirect the output to `/dev/null`.
```bash
nohup build_server --port 8000 >/dev/null 2>&1 &
```


## Example
If you have built a server on your machine, you can assess it by browsing `http://xxx.xxx.xxx.xxx:8000`. 

It provides a button to upload file from local to server.

![bash](./demo/huster_demo_bash.png)

![demo](./demo/huster_demo.png)