Skip to main content

Run prompts against LLMs hosted by Moonshot

Project description

llm-moonshot

LLM plugin for Moonshot AI’s models

PyPI Changelog License: MIT

LLM plugin for models hosted by Moonshot AI.

Installation

First, install the LLM command-line utility.

Now install this plugin in the same environment as LLM:

llm install llm-moonshot

Configuration

You’ll need an API key from Moonshot. Grab one at platform.moonshot.cn.

Set it as an environment variable MOONSHOT_API_KEY, or stash it in LLM’s keyring:

llm keys set moonshot
Enter key: <paste key here>

Usage

List what’s on the menu:

llm models list

You’ll see something like:

Moonshot: moonshot/kimi-latest
Moonshot: moonshot/moonshot-v1-auto
Moonshot: moonshot/moonshot-v1-128k-vision-preview
Moonshot: moonshot/kimi-k2-0711-preview
Moonshot: moonshot/moonshot-v1-128k
Moonshot: moonshot/moonshot-v1-32k-vision-preview
Moonshot: moonshot/moonshot-v1-8k-vision-preview
Moonshot: moonshot/moonshot-v1-8k
Moonshot: moonshot/kimi-thinking-preview
Moonshot: moonshot/moonshot-v1-32k
...

Fire up a chat:

llm chat -m moonshot/kimi-k2-0711-preview
Chatting with  moonshot/kimi-k2-0711-preview
Type 'exit' or 'quit' to exit
Type '!multi' to enter multiple lines, then '!end' to finish
> yo moonie
你好!有什么可以帮你的吗?
>

Need raw completion?

llm -m moonshot/moonshot-v1-8k "Finish this haiku: Neon city rain"
Neon city rain,
Glistening streets, a symphony,
Echoes of the night.

Aliases

Save your wrists:

llm aliases set kimi moonshot/kimi-latest

Now:

llm -m kimi "tell me a dark joke"

Development

Clone, venv, deps—same dance:

git clone https://github.com/ghostofpokemon/llm-moonshot.git
cd llm-moonshot
python3 -m venv venv
source venv/bin/activate
pip install -e .

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

llm_moonshot-0.2.1.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

llm_moonshot-0.2.1-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

File details

Details for the file llm_moonshot-0.2.1.tar.gz.

File metadata

  • Download URL: llm_moonshot-0.2.1.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.6

File hashes

Hashes for llm_moonshot-0.2.1.tar.gz
Algorithm Hash digest
SHA256 a28fbb09a4bdd08cbb896c2a32104f7974e7194177ec9474568cdef662475fac
MD5 cce68a4965462ad75ca97db44f6fc1ae
BLAKE2b-256 0ffdb4e28c10b8554d6d3832f6f4cead2538b5d536dca7d3d337472ed07674d2

See more details on using hashes here.

File details

Details for the file llm_moonshot-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: llm_moonshot-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 3.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.6

File hashes

Hashes for llm_moonshot-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0d1829d25fc10d87325819a0059361b6e121e4a2d04efa210c440875166e35c0
MD5 6419eab392dc0ecad9d89dd258435e71
BLAKE2b-256 b6146a9dedefff38475b334b67d841a0ee309ead8bc83ef9e8e8ea64beb060e5

See more details on using hashes here.

Supported by

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