Skip to main content

LangChain components for Dartmouth-hosted models.

Project description

Dartmouth LangChain

LangChain components for Dartmouth-hosted models.

Getting started

  1. Install the package:
pip install dartmouth-langchain
  1. Obtain a Dartmouth API key from developer.dartmouth.edu
  2. Store the API key as an environment variable called DARTMOUTH_API_KEY:
export DARTMOUTH_API_KEY=<your_key_here>

Using the library

Using a Dartmouth-hosted chat model:

from dartmouth_langchain import DartmouthChatModel


llm = DartmouthChatModel()

llm.invoke("<s>[INST] Hi there! [/INST]")

Note: Many chat models require the prompts to have a particular formatting to work correctly! The default model is a chat model from the Llama 2 family and thus requires the tags shown in the example above.

Using a Dartmouth-hosted embeddings model:

from dartmouth_langchain import DartmouthEmbeddingsModel


embeddings = DartmouthEmbeddingsModel()

embeddings.embed_query("Hello? Is there anybody in there?")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dartmouth_langchain-0.0.7.tar.gz (6.6 kB view hashes)

Uploaded Source

Built Distribution

dartmouth_langchain-0.0.7-py3-none-any.whl (8.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page