Enterprise backend and full-stack engineers operating within strict compliance perimeters—such as financial technology, healthcare systems, and critical infrastructure—face a persistent dilemma. While artificial intelligence code assistants accelerate daily development, enterprise security policies strictly prohibit dispatching proprietary source code over public networks to third-party software-as-a-service (SaaS) APIs.
Furthermore, existing tutorials disproportionately target Visual Studio Code, leaving JetBrains power users (working in IntelliJ IDEA, PyCharm, WebStorm, or GoLand) to navigate fragmented documentation, socket port conflicts, and ambiguous indexing behaviors.
This technical guide delivers an end-to-end setup for integrating the Code GPT plugin in JetBrains IDEs with a local Ollama runtime. It details how to achieve full multi-file semantic codebase indexing and invoke context-aware quick actions—such as refactoring, test generation, and code explanation—in a zero-egress, fully offline environment.
365Finds Institutional Verdict & Recommendations
At 365Finds, our research leads to three firm operational judgments regarding local AI copilots in enterprise IDEs:
- Local Copilots Require Deliberate Model Selection, Not Compromise: For local offline software engineering, 365Finds recommends selecting parameter-specialized coding models rather than general chat models. We specifically favor
qwen2.5-coder:7bfor developer laptops (16 GB to 32 GB RAM) andqwen2.5-coder:14bordeepseek-coder:basefor high-end workstations. Sub-7B models lack the architectural understanding required for cross-module refactoring and reliable unit test mocking, whereas unquantized 32B+ models introduce unacceptable typing and streaming latency in JetBrains tool windows. - Multi-File Indexing Is Non-Negotiable for Complex Enterprise Projects: Highlighting isolated code snippets only serves trivial syntax queries. In multi-layered enterprise repositories (such as domain-driven Spring Boot or Django apps), engineers need semantic context spanning interfaces, entity mappings, and utility layers. Code GPT's codebase vectorization provides this architectural awareness entirely in local memory, keeping proprietary repositories air-gapped.
- Adopt a Defensive Workflow with Profile Modes: Running local models locally introduces occasional hallucinations in edge-case code generations. 365Finds explicitly advises developers to use Search Mode for read-only repository exploration and architecture discovery, while reserving Agent Mode for file-modifying tasks coupled with strict Git version control and diff inspection. Never allow automated file changes without explicit line-by-line diff review.
Technical Prerequisites and Architecture Overview
Before commencing configuration, verify that your development workstation meets these baseline requirements:
| Component | Minimum Requirement | Recommended Specification | Enterprise Rationale |
|---|---|---|---|
| JetBrains IDE | 2023.2 or newer (IntelliJ, PyCharm, WebStorm, GoLand) | Latest Stable (2024.x or 2025.x) | Modern plugin runtime APIs; optimized background task scheduling |
| Local Hardware | 16 GB RAM; 4-core modern CPU | 32 GB unified memory (Apple Silicon) or NVIDIA GPU (8 GB+ VRAM) | Sustains concurrent IDE indexing and local LLM tensor operations |
| Local Runtime | Ollama CLI (Linux, macOS, Windows) | Latest Ollama release with GPU acceleration enabled | Manages local model quantization and OpenAI-compatible API serving |
| Local Ports | 11434 (Ollama), 54112 / 54113 (Code GPT bridge) | Ensure ports are open on localhost (127.0.0.1) | Avoid socket collisions with local corporate proxies or microservices |
┌────────────────────────────────────────────────────────┐
│ JetBrains IDE │
│ (IntelliJ IDEA / PyCharm / WebStorm / GoLand) │
│ │
│ ┌──────────────────────────────────────────────────┐ │
│ │ Code GPT Plugin │ │
│ │ │ │
│ │ ┌────────────────────┐ ┌───────────────────┐ │ │
│ │ │ Context Indexer │ │ Quick Action Menu │ │ │
│ │ │ (Local Vector DB) │ │ Refactor / Tests │ │ │
│ │ └─────────┬──────────┘ └─────────┬─────────┘ │ │
│ └────────────┼────────────────────────┼────────────┘ │
│ │ │ │
│ Port: 54112 / 54113 │ │
└───────────────┼────────────────────────┼───────────────┘
│ │
│ HTTP API Requests │
│ (http://localhost:11434)
▼ ▼
┌────────────────────────────────────────────────────────┐
│ Ollama Runtime │
│ ┌──────────────────────────────────────────────────┐ │
│ │ Local Model Tensor Execution (Air-Gapped) │ │
│ │ - qwen2.5-coder:7b │ │
│ │ - deepseek-coder / codestral │ │
│ └──────────────────────────────────────────────────┘ │
└────────────────────────────────────────────────────────┘
Step 1: Install and Initialize Ollama for Offline Coding
Ollama serves as the local inference engine that runs quantized weights on local compute units without sending tokens outside the machine perimeter.
1. Download and Verify Ollama Installation
Download and install the appropriate runtime package for your operating system from ollama.ai (or ollama.com). Verify that the binary is available in your shell environment:
ollama --version
2. Pull Recommended Enterprise Coding Models
In your terminal, execute the pull command for your target model. Pulling downloads model weights without locking terminal input into an interactive chat session:
# Recommended baseline for 16GB RAM workstations
ollama pull qwen2.5-coder:7b
# Alternative for specialized test and syntax operations
ollama pull deepseek-coder:base
# High-performance alternative for dedicated workstations (32GB+ RAM)
ollama pull codestral:latest
Wait until the progress bar reaches 100% and confirms checksum verification.
3. Verify Local API Connectivity and Endpoint Binding
Ollama binds by default to http://localhost:11434. Verify that the REST API responds correctly:
curl http://localhost:11434/api/tags
The response returns a JSON payload listing available local models.
Troubleshooting Note: If the service fails to connect or returns connection refused errors, check whether an existing system environment variable named
OLLAMA_HOSTis overriding the localhost binding. Remove or reset any invalidOLLAMA_HOSTvariable and restart the daemon to restore default localhost routing.
Step 2: Install Code GPT in Your JetBrains Environment
Code GPT provides the IDE integration layer, handling context injection, tool windows, editor context menus, and AST-level inspections.
1. Installation via JetBrains Marketplace
- Launch IntelliJ IDEA, PyCharm, WebStorm, or your respective JetBrains IDE.
- Open Settings:
- macOS:
IntelliJ IDEA(or IDE name) >Settings/Preferences(Shortcut:Cmd + ,). - Windows / Linux:
File>Settings(Shortcut:Ctrl + Alt + S).
- macOS:
- Select Plugins from the left navigation tree.
- Select the Marketplace tab at the top.
- In the search box, enter
Code GPT. - Locate the plugin and click Install.
- When prompted, restart your IDE to ensure that service listeners and background daemons initialize cleanly.
2. Alternative Manual Installation from Disk
In strictly offline, air-gapped development machines without marketplace access:
- Download the plugin package archive (
.zipor.jar) on an authorized external transfer workstation. - Transfer the archive to the secure workstation.
- In the Plugins pane, click the gear icon (
⚙️) in the upper-right corner. - Select Install Plugin from Disk..., browse to your file, click OK, and restart the IDE.
3. Socket Port Verification
Code GPT utilizes local internal communication ports (such as 54112 or 54113) for its UI-to-daemon bridge. Ensure no local dev servers, Docker containers, or internal firewalls reserve these ports.
Step 3: Connect Code GPT to the Local Ollama Provider
Once installed, configure the plugin to point to your offline Ollama endpoint rather than public cloud APIs.
- Open the Code GPT Tool Window: Click the Code GPT icon in the right-hand or left-hand tool window dock.
- Open Model Management: Click the gear icon (
⚙️) or select Manage Models in the chat panel header. - Select Provider Category: In the model configuration panel, select the Local LLMs (or Local) tab.
- Choose Ollama: Select Ollama from the list of available local providers.
- Configure Server Address: Enter the server URL where Ollama is listening:
(If your enterprise hosts an on-premise dedicated inference server on an isolated subnet, enter that server's internal IP address, e.g.,http://localhost:11434http://10.20.30.40:11434). - Select Your Downloaded Model: Select your pulled model (e.g.,
qwen2.5-coder:7bordeepseek-coder:base) from the model dropdown menu. - Save & Test Connectivity: Click outside the settings panel and enter a quick diagnostic query in the chat window, such as
"Ping: Confirm local execution."The response will stream directly from your local hardware with zero external network traffic.
Step 4: Configure Multi-File Context Indexing (Local Codebase Index)
The primary failure mode of local AI assistants in enterprise environments is context starvation. A single open file rarely contains the domain models, dependency injection containers, or helper functions required for accurate code synthesis.
Code GPT resolves this through Codebase Indexing, creating an embedded semantic vector database directly on your local workstation.
Enterprise Project Root
├── .codegptignore <-- Excludes build directories, logs, credentials
├── src/main/java
│ ├── controller/ <-- Parsed and Vectorized
│ ├── service/ <-- Parsed and Vectorized
│ └── model/ <-- Parsed and Vectorized
└── target/ / build/ <-- Bypassed during local indexing
1. Initializing Codebase Indexing
- In the Code GPT tool panel, locate and click the Codebase (or Augmented Context) button.
- Click Create Codebase Index.
- Select your project root directory or the specific microservice module you are actively developing.
- Allow the local indexing process to complete. The indexer parses file trees, tokenizes text, and stores semantic embeddings in a local vector store.
2. Configuring Exclusion Boundaries (.codegptignore)
To avoid consuming local RAM with build artifacts, minified scripts, and lockfiles, place a .codegptignore file at the root of your project:
# Build outputs and dependency stores
target/
build/
dist/
node_modules/
.gradle/
# Internal documentation and binary artifacts
*.class
*.jar
*.bin
*.pdf
# Environment secrets and local configurations
.env
.env.*
*.pem
*.key
3. Referencing Multi-File Context in Prompts
Once indexed, you can inject codebase-wide intelligence into queries:
- Workspace Mention: Use
@codebasein your chat prompts:"Analyze @codebase to explain how the payment processing pipeline handles idempotency across the OrderController and PaymentService." - Selective File Mentioning: For targeted multi-file debugging, use
#or the+ Add Contextbutton to attach specific interfaces and their corresponding implementations without re-indexing the entire workspace.
Step 5: Utilizing Profile Modes for Safe Development
Code GPT introduces three distinct Profile Modes that govern how the assistant interacts with your project files:
| Profile Mode | Primary Capability | Operation Type | Recommended Enterprise Use Case |
|---|---|---|---|
| 💬 Chat Mode | Isolated conversation; copy-pasted snippets | Zero Project Access | Answering general algorithmic questions; explaining standard library APIs |
| 🔍 Search Mode | Deep codebase semantic traversal | Read-Only | Architecture discovery; tracking cross-file call hierarchies and contracts |
| 🤖 Agent Mode | Multi-file edits; iterative refactoring; commands | Read & Write | Implementing features across controller, service, and test suites |
Operational Strategy for Engineers
- Start in Search Mode when diagnosing cross-module behavior (e.g.,
"Where are authentication tokens validated in our filter chain?"). This prevents inadvertent file modifications while exploring complex legacy architectures. - Switch to Agent Mode only when you have defined a precise scope of modification.
- Keep the IDE's built-in Git staging window open. Because local models may occasionally introduce minor formatting inconsistencies, evaluate every suggested modification in JetBrains's side-by-side diff view before committing.
Step 6: Leveraging In-Editor Quick Actions
Rather than manually copying and pasting code blocks into chat windows, JetBrains developers can invoke Code GPT's specialized routines directly from the editor's contextual menu.
1. Code Explanation (Explain CodeGPT)
When inspecting unfamiliar legacy logic:
- Highlight the class, method, or complex algorithmic loop.
- Right-click and navigate to
Code GPT>Explain CodeGPT(or type/Explainin the interactive chat prompt). - The local model breaks down parameter assumptions, edge cases, and asynchronous lifecycle flows, drawing from indexed project models.
2. Intelligent Refactoring (Refactor CodeGPT)
To improve maintainability, reduce cyclomatic complexity, or modernize syntax:
- Highlight the target code block.
- Right-click and select
Code GPT>Refactor CodeGPT(or execute/Refactor). - Enter your specific requirement, such as:
"Extract the nested database transaction into a separate private method with explicit rollback annotations." - Review the generated refactoring and use the diff stream to merge clean edits into your active buffer.
3. Unit Test Generation (Unit Test CodeGPT)
Writing comprehensive unit tests is often the most time-consuming task in enterprise sprints. Code GPT generates test suites tailored to your local test framework:
- Highlight the target service method.
- Right-click and select
Code GPT>Unit Test(or type/Unit Test). - The local model analyzes the method signature and referenced domain objects via the codebase index, producing test fixtures that match your project's existing testing idioms (such as JUnit 5 with Mockito in Java, or pytest with pytest-mock in Python).
// Example: Highlighting a payment execution method and invoking /Unit Test
// Generated test fixture automatically mocks indexed dependencies:
@ExtendWith(MockitoExtension.class)
class PaymentExecutionServiceTest {
@Mock
private PaymentGatewayClient paymentGatewayClient;
@Mock
private TransactionAuditRepository auditRepository;
@InjectMocks
private PaymentExecutionService executionService;
@Test
void executePayment_ValidRequest_RecordsAuditAndCompletes() {
// Automatically populated with realistic domain DTOs from @codebase
PaymentCommand command = new PaymentCommand("TX-1002", new BigDecimal("150.00"), "USD");
when(paymentGatewayClient.authorize(command)).thenReturn(PaymentResponse.success());
PaymentResult result = executionService.process(command);
assertThat(result.isSuccess()).isTrue();
verify(auditRepository).saveAuditRecord(any(AuditRecord.class));
}
}
Step 7: Enterprise Compliance and Security Hardening
To satisfy strict internal security auditing (e.g., SOC 2 Type II, ISO 27001, or banking regulatory compliance), confirm the following checklist:
- Strict Loopback Binding: Verify that Ollama is bound exclusively to
127.0.0.1or internal isolated subnets. Prevent the Ollama daemon from listening on0.0.0.0unless protected by mutual TLS and zero-trust perimeter network rules. - Audit Outbound IDE Traffic: Run a local network packet capture (e.g.,
tcpdumpor Wireshark) while generating code and indexing repositories. Confirm that zero HTTP/HTTPS egress packets leave your workstation toward external cloud AI domains. - Disable Cloud Fallback Settings: In Code GPT settings, ensure that automatic failover to third-party cloud APIs (such as OpenAI or Anthropic) is strictly disabled, leaving Ollama as the sole configured provider.
- Git Hygiene: Always use
.codegptignoreto prevent proprietary configuration files, client certificates, and corporate keystores from entering the local vector database.
By following this architecture, software developers and enterprise architects operating in JetBrains environments can unlock the full productivity advantages of modern AI-assisted engineering while preserving total data sovereignty.
References
- ProxyAI - IntelliJ IDEs Plugin | Marketplace
- GitHub - carlrobertoh/ProxyAI: The leading open-source AI copilot for JetBrains. Connect to any model in any environment, and customize your coding experience in any way you like. · GitHub
- AI inside your IDE | CodeGPT
- 👋 Welcome | CodeGPT
- ⚡️ Quick Start | CodeGPT
- Installation | CodeGPT
- Configuration | CodeGPT
- Ollama | CodeGPT
- 🛠️ Features | CodeGPT
- Profile Modes | CodeGPT
- Unit Test | CodeGPT
- Refactor CodeGPT | CodeGPT