Skip to main content

LLM access to DeepSeek's API

Project description

llm-deepseek

GitHub release (latest by date including pre-releases) License

LLM access to DeepSeek's API

Installation

Install this plugin in the same environment as LLM.

llm install llm-deepseek-xtreme

Usage

First, set an API key for DeepSeek:

llm keys set deepseek
# Paste key here

Run llm models to list the models, and llm models --options to include a list of their options.

Running Prompts

Run prompts like this:

llm -m deepseek-chat "Describe a futuristic city on Mars"
llm -m deepseek-chat-completion "The AI began to dream, and in its dreams," -o echo true
llm -m deepseek-coder "Write a Python function to sort a list of numbers"
llm -m deepseek-coder-completion "IDENTIFICATION DIVISION. PROGRAM-ID. skynet." -o echo true

New Features

Prefill

The prefill option allows you to provide initial text for the model's response. This is useful for guiding the model's output.

Example:

llm -m deepseek-chat "What are some wild and crazy activities for a holiday party?" -o prefill "Here are some off-the-wall ideas to make your holiday party unforgettable [warning: these may not be suitable for work holiday parties]:"

JSON Response Format

The response_format option allows you to specify that the model should output its response in JSON format. To ensure the model outputs valid JSON, include the word "json" in the system or user prompt. Optionally, you can provide an example of the desired JSON format to guide the model.

Example:

llm -m deepseek-chat "What are some fun activities for a holiday party?" -o response_format json_object --system "json"

To guide the model further, you can provide an example JSON structure:

llm -m deepseek-chat "What are some way to tell if a holiday party is fun?" -o response_format json_object --system 'EXAMPLE JSON OUTPUT: {"event": "holiday_party_fun", "success_metric": ["..."]}'

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd llm-deepseek
python3 -m venv venv
source venv/bin/activate

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_deepseek_xtreme-0.1.0.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

llm_deepseek_xtreme-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file llm_deepseek_xtreme-0.1.0.tar.gz.

File metadata

  • Download URL: llm_deepseek_xtreme-0.1.0.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for llm_deepseek_xtreme-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b8c5aa54c89014b952d4c282c50443ee5b24459b290265419d6f4107675d0da8
MD5 2d732e0da1319e07d3d33b0e7546d16c
BLAKE2b-256 91ac4b22190afda1183f6332778bc3e5c7e4c3d7fd2a87a6dd458c72695ddde1

See more details on using hashes here.

File details

Details for the file llm_deepseek_xtreme-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for llm_deepseek_xtreme-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71bb5e11790ffc83dcbb83f66ba3a2bb82f50e67c3751c7362ee07265a78f4bf
MD5 5c3cb475072805228ff2c625d86fac3c
BLAKE2b-256 eff7118ee2c5313fe72511e9b0773e5004c51a3c9b69c0c6eb754b7a9eadf3ef

See more details on using hashes here.

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