Skip to main content
Archived

This project has been archived by its maintainers, and is no longer receiving any updates.

langchain-gradientai

This package contains the LangChain integration with DigitalOcean

Installation

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.
  3. Click on Create model access key, enter a name, and create the key.
  4. 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

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

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.

Metadata

Release files for langchain-gradientai-narsi 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-gradientai-narsi 0.1.3
File Size Uploaded Provenance
langchain_gradientai_narsi-0.1.3.tar.gz 5.6 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-gradientai-narsi 0.1.3
File Interpreter ABI Platform
langchain_gradientai_narsi-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 12.2 kB

Release files / langchain_gradientai_narsi-0.1.3.tar.gz

Download URL langchain_gradientai_narsi-0.1.3.tar.gz
Size 5.6 kB
Tags Source
SHA-256 checksum
How to use checksums
c6bc4932acd69822019a31eba51d35c6ef1e76c1a64349eb288cfe51adbdae71
BLAKE2b-256 checksum
How to use checksums
d2ff4456c6c75980170bc94f4e4e89513ed3a72d1556943115114c74452d3002
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.13.5 Darwin/24.5.0

Release files / langchain_gradientai_narsi-0.1.3-py3-none-any.whl

Download URL langchain_gradientai_narsi-0.1.3-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1d717b944b8b31b038afd2f241900f82accf66db6acb24b08384d21f41a32083
BLAKE2b-256 checksum
How to use checksums
fd042cb2c74a30971b48c53e227ba565e40d7384c472f24adfd47296109daf51
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/2.1.3 CPython/3.13.5 Darwin/24.5.0

Security for langchain-gradientai-narsi 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page