A VS Code extension that automatically generates inline documentation (JSDoc / Python docstrings) for functions — powered by a local or remote LLM.
Features
One-command doc generation — Place your cursor on or near a function, run FastDoc: Generate Documentation, and a properly formatted doc block is inserted above the function.
Language-aware — Detects JavaScript, TypeScript (including JSX/TSX), and Python, and applies the correct format (JSDoc or docstring).
LLM-powered — Uses a large language model to generate meaningful, context-aware documentation.
Privacy first — Defaults to a locally running Ollama instance so no source code leaves your machine.
Remote LLM opt-in — Optionally connect to any remote OpenAI-compatible API with a data-privacy warning shown on each use.
Smart detection — Recognises existing documentation and prompts before overwriting (no silent data loss).
Install the extension from the VS Code Marketplace.
Open a .ts, .js, .jsx, .tsx, or .py file.
Place the cursor on or within 3 lines of a function.
Press Ctrl+Shift+D (Cmd+Shift+D on Mac) — or open the Command Palette and run FastDoc: Generate Documentation.
Review the generated doc block in the preview panel, edit if needed, then click Insert.
Setting Up a Backend
FastDoc needs an LLM backend to generate documentation. Choose one:
Local — Ollama (default, no data sent externally)
# Install from https://ollama.com/download, then:
ollama pull gpt-oss:20b
ollama serve
FastDoc will connect to http://localhost:11434 automatically.
Remote — OpenAI-compatible API
Open the Command Palette and run FastDoc: Open Settings for a graphical configuration panel, or:
Open VS Code Settings (Ctrl+, / Cmd+,) and search for FastDoc.
Set Provider to remote.
Enter your Remote URL (e.g. https://api.openai.com/v1).
Store your API Key securely by running FastDoc: Set API Key from the Command Palette (the key is stored in VS Code SecretStorage, not in settings.json).
Set the Model name (e.g. gpt-4o).
A data-privacy warning is shown every time documentation is generated with a remote provider.
Commands
Command
Description
FastDoc: Generate Documentation
Generate a doc block for the nearest function (Ctrl+Shift+D)
FastDoc: Set API Key
Securely store your remote LLM API key in VS Code SecretStorage
FastDoc: Open Settings
Open a graphical settings panel for configuring the LLM backend
Extension Settings
Setting
Default
Description
fastdoc.llm.provider
ollama
ollama (local) or remote
fastdoc.llm.model
gpt-oss:20b
Model name (e.g. codellama:latest, gpt-4o)
fastdoc.llm.ollamaUrl
http://localhost:11434
Ollama API base URL
fastdoc.llm.remoteUrl
(empty)
Remote LLM API base URL
fastdoc.llm.apiKey
(empty)
Deprecated — use FastDoc: Set API Key instead. API key is now stored in SecretStorage.
fastdoc.llm.variantCount
1
Number of variants to generate (1–3). When > 1, a Quick Pick lets you choose before insertion.
How It Works
FastDoc validates the active editor and detects the file language.
It scans outward from the cursor for a function within ±3 lines.
It checks for an existing doc block and prompts before overwriting.
It builds an LLM prompt (optionally generating multiple variants in parallel).
The generated block is shown in a preview panel — you can edit it freely.
The approved block is validated for structural correctness (JSDoc /** */ markers or Python """ delimiters) and inserted above the function.
The session counter in the status bar increments, and the model/provider is saved for this workspace.
Troubleshooting
Symptom
Fix
command not found: ollama
Install Ollama and restart your terminal / VS Code.
"No function found at cursor"
Move the cursor onto the function name or within 3 lines of it.
Nothing inserted, no error
Check the FastDoc AI output channel and confirm a backend is configured.
Remote: 401 / 403 error
Your API key is invalid or expired — update it in VS Code Settings.
Remote: connection refused
Check the Remote URL in VS Code Settings.
Generated doc looks generic
The extension will automatically retry once with a stricter prompt. If it still fails, try a larger model.