Examples

May 30, 2026 · View on GitHub

This directory contains various examples demonstrating different capabilities of the deepseek-go library.

#Example NameDescription
0Using External ProvidersSupports external providers through baseURL extension. Missing model constants can be reported via issues or pull requests.
1Basic Chat ExampleDemonstrates basic chat functionality.
2Chat with StreamingImplements streaming chat responses, including ReasoningContent with V4 models.
3Fill-in-Middle (FIM)Example of fill-in-middle completion with streaming support.
4JSON ModeDemonstrates JSON mode for structured responses. This is a client-specific feature.
5Multi-ChatExample of handling multiple concurrent chat sessions.
6Bad Multi-ChatDemonstrates incorrect handling of multiple chats (for educational purposes).
7Balance ExampleShows balance-related functionality.
8Client with OptionsDemonstrates creating a client with custom options.
9Prefix CompletionExample of prefix-based completion.
10Token Usage EstimationDemonstrates how to estimate and track token usage for requests (based on Deepseek’s documentation).
11List Supported ModelsShows how to list all supported models through the Deepseek API.
12Function CallingDemonstrates function calling capabilities.
13OpenRouter ImagesExample usage with OpenRouter images.
14Reasoning EffortDemonstrates reasoning_effort parameter ("high" vs "max") for V4 thinking mode.
15User ID IsolationMulti-tenant isolation using the user_id parameter.
16Strict Tool CallingStrict function calling (beta) with automatic /beta routing.
17Anthropic APIAnthropic-compatible endpoint with Claude model mapping, thinking, tool use, and streaming.

Ollama

Ollama docs are located here.