Skip to main content


Moonshot is a Chinese startup that provides LLM service for companies and individuals.

This example goes over how to use LangChain to interact with Moonshot.

from langchain_community.llms.moonshot import Moonshot
API Reference:Moonshot
import os

# Generate your api key from:
llm = Moonshot()
# or use a specific model
# Available models:
# llm = Moonshot(model="moonshot-v1-128k")
# Prompt the model
llm.invoke("What is the difference between panda and bear?")

Was this page helpful?

You can leave detailed feedback on GitHub.