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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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