이 문서는 Pipeshift chat models를 시작하는 데 도움을 드립니다. 모든 ChatPipeshift 기능과 구성에 대한 자세한 문서는 API reference를 참조하세요.

Overview

Integration details

ClassPackageLocalSerializableJS supportDownloadsVersion
ChatPipeshiftlangchain-pipeshift-PyPI - DownloadsPyPI - Version

Model features

Tool callingStructured outputJSON modeImage inputAudio inputVideo inputToken-level streamingNative asyncToken usageLogprobs
-

Setup

Pipeshift 모델에 액세스하려면 Pipeshift에서 계정을 생성하고 API key를 받은 다음 langchain-pipeshift integration package를 설치해야 합니다.

Credentials

Pipeshift로 이동하여 가입하고 API key를 생성하세요. 완료한 후 PIPESHIFT_API_KEY environment variable을 설정하세요:
import getpass
import os

if not os.getenv("PIPESHIFT_API_KEY"):
    os.environ["PIPESHIFT_API_KEY"] = getpass.getpass("Enter your Pipeshift API key: ")
모델 호출에 대한 자동 추적을 원하시면 아래 주석을 해제하여 LangSmith API key를 설정할 수도 있습니다:
os.environ["LANGSMITH_TRACING"] = "true"
os.environ["LANGSMITH_API_KEY"] = getpass.getpass("Enter your LangSmith API key: ")

Installation

LangChain Pipeshift integration은 langchain-pipeshift package에 있습니다:
pip install -qU langchain-pipeshift
Note: you may need to restart the kernel to use updated packages.

Instantiation

이제 model object를 인스턴스화하고 chat completion을 생성할 수 있습니다:
from langchain_pipeshift import ChatPipeshift

llm = ChatPipeshift(
    model="meta-llama/Meta-Llama-3.1-8B-Instruct",
    temperature=0,
    max_tokens=512,
    # other params...
)

Invocation

messages = [
    (
        "system",
        "You are a helpful assistant that translates English to French. Translate the user sentence.",
    ),
    ("human", "I love programming."),
]
ai_msg = llm.invoke(messages)
ai_msg
AIMessage(content='Here is the translation:\n\nJe suis amoureux du programme. \n\nHowever, a more common translation would be:\n\nJ\'aime programmer.\n\nNote that "Je suis amoureux" typically implies romantic love, whereas "J\'aime" is a more casual way to express affection or enjoyment for an activity, in this case, programming.', additional_kwargs={}, response_metadata={}, id='run-5cad8e5c-d089-44a8-8dcd-22736cde7d7b-0')
print(ai_msg.content)
Here is the translation:

Je suis amoureux du programme.

However, a more common translation would be:

J'aime programmer.

Note that "Je suis amoureux" typically implies romantic love, whereas "J'aime" is a more casual way to express affection or enjoyment for an activity, in this case, programming.

API reference

모든 ChatPipeshift 기능과 구성에 대한 자세한 문서는 API reference를 참조하세요: dashboard.pipeshift.com/docs
Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.
I