LangChain components for Dartmouth-hosted models.
Project description
Dartmouth LangChain
LangChain components for Dartmouth-hosted models.
Getting started
- Install the package:
pip install dartmouth-langchain
- Obtain a Dartmouth API key from developer.dartmouth.edu
- 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
Built Distribution
Close
Hashes for dartmouth_langchain-0.0.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b37bff4f9e4d9c8cc3e13f2da2f959e81a571cb38996a1fc6809fff60d85014 |
|
MD5 | 185ff35aca8504cd1a0dfa9877a5a87d |
|
BLAKE2b-256 | 011dad76f9e4518da813794578c21413bdc49d07d7890bf26c46db485c0b926e |
Close
Hashes for dartmouth_langchain-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 492dd8c26109e4b309db720d1a1500ee9fb584e9c7af2caa390bf1c5bb9cd705 |
|
MD5 | 0882922b2454c346ec8cf3aca8a5f07a |
|
BLAKE2b-256 | 9dec81aa7ecf594ab0d426981d6854ca2bedc2614f438bda3d26e8fb94d976ae |