Skip to main content
Glama

DeepSeek FIM Completion

deepseek_fim

Provide a prefix and optional suffix to generate missing text in between. Ideal for code completion and content infilling.

Instructions

Fill-in-the-Middle (FIM) completion with DeepSeek V4. Provide a prompt (prefix) and an optional suffix; the model completes the text in between. Ideal for code completion and content infilling. Runs in non-thinking mode on the Beta endpoint; output is capped at 4K tokens. Aliases deepseek-chat and deepseek-reasoner resolve to deepseek-v4-flash (FIM has no thinking mode). Includes automatic cost tracking and model fallback with circuit breaker resilience.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stopNoOptional stop sequence(s). Generation stops when any is produced. A single string or an array of up to 16 strings.
modelNoModel to use. deepseek-v4-flash (default, fast/economical) or deepseek-v4-pro (most capable). Aliases deepseek-chat / deepseek-reasoner resolve to v4-flash. FIM is always non-thinking.deepseek-v4-flash
promptYesThe prefix text that comes before the content to generate. Required. For code completion, this is the code up to the cursor.
suffixNoOptional suffix text that comes after the content to generate. The model fills the gap between prompt and suffix.
max_tokensNoMaximum tokens to generate. FIM completions are capped at 4096 tokens by the API.
temperatureNoSampling temperature (0-2). Higher = more random. Default: 1.0.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYes
modelYes
usageYes
cost_usdNo
routed_fromNo
finish_reasonYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden. It discloses non-thinking mode, Beta endpoint, 4K token cap, aliases resolution, automatic cost tracking, and model fallback with circuit breaker resilience.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise at three sentences, covering key points without fluff. However, it could be slightly better structured by front-loading the core purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the presence of an output schema (so return values need not be explained) and the description covering cost tracking and resilience, it is sufficiently complete for the complexity of the tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so baseline is 3. The description adds context like 'Ideal for code completion' but does not add meaning beyond what the schema provides for parameters.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it is for Fill-in-the-Middle completion with DeepSeek V4, suitable for code completion and content infilling. It distinguishes itself from siblings by noting it has no thinking mode, but does not explicitly differentiate from deepseek_chat or deepseek_sessions.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides context for when to use (code completion, content infilling) and mentions it runs in non-thinking mode, implying that for thinking tasks, deepseek_chat should be used. However, it does not explicitly state when not to use or compare to deepseek_sessions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/arikusi/deepseek-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server