FastDoc AI is a VS Code extension that generates inline documentation for JavaScript, TypeScript, JSX, TSX, and Python functions using a local or remote LLM backend.
Features
- Generate JSDoc or Python docstrings from the command palette, editor context menu, keyboard shortcut, or FastDoc sidebar.
- Use local Ollama by default so source code stays on your machine.
- Optionally connect to OpenAI-compatible APIs or Anthropic Claude.
- Store remote API keys securely in VS Code SecretStorage.
- Detect existing documentation and ask before overwriting it.
- Preview and edit generated documentation before insertion.
- Generate 1-3 variants and compare them in the sidebar.
- Remember the last provider/model per workspace.
Quick Start
- Install FastDoc AI from the VS Code Marketplace.
- Open a JavaScript, TypeScript, JSX, TSX, or Python file.
- Place your cursor on a function, or within 3 lines of one.
- Run FastDoc: Generate Documentation from the Command Palette.
- Review the generated documentation and insert it.
Keyboard shortcut:
- macOS:
Cmd+Shift+D - Windows/Linux:
Ctrl+Shift+D
Backend Setup
FastDoc needs an LLM backend.
Local Ollama
Ollama is the default backend.
ollama pull gpt-oss:20b
ollama serve
FastDoc connects to http://localhost:11434 by default.
Remote Providers
Use FastDoc: Open Settings to configure:
- OpenAI-compatible API URL, for example
https://api.openai.com/v1 - Anthropic API, with the URL left blank for
https://api.anthropic.com - Model name
- API key
- Variant count
- Request timeout
API keys are stored in VS Code SecretStorage. Use FastDoc: Clear API Key to remove the stored key.
Commands
| Command | Description |
|---|---|
| FastDoc: Generate Documentation | Generate documentation for the nearest function. |
| FastDoc: Set API Key | Store a remote provider API key securely. |
| FastDoc: Clear API Key | Remove the stored API key. |
| FastDoc: Open Settings | Open the FastDoc settings panel. |
Settings
| Setting | Default | Description |
|---|---|---|
fastdoc.llm.provider |
ollama |
ollama, openai, or anthropic. The legacy value remote maps to openai. |
fastdoc.llm.model |
gpt-oss:20b |
Model name used for generation. |
fastdoc.llm.ollamaUrl |
http://localhost:11434 |
Ollama API base URL. |
fastdoc.llm.remoteUrl |
empty | Remote provider base URL. |
fastdoc.llm.apiKey |
empty | Deprecated fallback. Use SecretStorage through the commands/settings panel. |
fastdoc.llm.variantCount |
1 |
Number of variants to generate, from 1 to 3. |
fastdoc.llm.timeoutMs |
30000 |
Request timeout in milliseconds. |
Troubleshooting
| Symptom | Fix |
|---|---|
| No function found | Move the cursor onto the function name or within 3 lines of the signature. |
| Ollama connection fails | Confirm Ollama is running and fastdoc.llm.ollamaUrl is correct. |
| Remote 401/403 error | Update the stored API key. |
| Remote model error | Check that the selected model is valid for the provider. |
| Generic documentation | Try a stronger model or provide more source context around the function. |
Privacy
The default Ollama backend runs locally. Remote providers send the selected source context to the configured provider, and FastDoc shows a privacy warning before remote generation.
License
MIT