docs: align project documentation with ollama provider
This commit is contained in:
+35
-1
@@ -133,6 +133,40 @@ Decoupled tool handlers from OpenAI implementation via a provider abstraction la
|
||||
- No `chat.openai.com` references in codebase — only `chatgpt.com`
|
||||
- MCP initialize handshake succeeds with chatgpt-mcp v0.1.0
|
||||
|
||||
## Completed (Phase 9) — Ollama Provider ✅
|
||||
|
||||
### src/providers/ollama.js
|
||||
- `ollamaProvider.send(reviewRequest, config)` — local AI provider using Ollama `/api/chat` endpoint
|
||||
- Uses native `fetch()` for HTTP calls — zero new dependencies
|
||||
- Implements same provider interface as openai and manual: `{ send(request, config) => Promise<{ content: string }> }`
|
||||
|
||||
### Provider details
|
||||
- **Request format**: OpenAI-compatible chat API (`model`, `messages`, `stream`, `options`)
|
||||
- **Response parsing**: Extracts `data.message.content` from Ollama response
|
||||
- **Error categories**: `OllamaTimeoutError`, `OllamaModelNotFoundError` (404), `OllamaValidationError` (422), `OllamaApiNotAvailableError` (501), `OllamaRequestError` (fallback)
|
||||
- **Base URL normalization**: Strips trailing slashes for safe path concatenation
|
||||
|
||||
### Environment variables
|
||||
| Variable | Default | Description |
|
||||
|----------|---------|-------------|
|
||||
| `OLLAMA_BASE_URL` | `http://localhost:11434` | Ollama API endpoint |
|
||||
| `OLLAMA_MODEL` | `qwen3:latest` | Model name for chat requests |
|
||||
| `OLLAMA_TEMPERATURE` | `0.2` | Sampling temperature |
|
||||
| `OLLAMA_TIMEOUT` | `60` | Request timeout in seconds |
|
||||
|
||||
### Factory integration
|
||||
- `"ollama"` added to SUPPORTED_PROVIDERS whitelist in `src/providers/factory.js`: `Set(["openai", "manual", "ollama"])`
|
||||
- `CHATGPT_MCP_PROVIDER=ollama` switches all tool handlers to local Ollama mode
|
||||
- Defaults to `"openai"` when not set — OpenAI behaviour unchanged
|
||||
- Same provider interface as openai and manual providers
|
||||
|
||||
### Current provider status
|
||||
| Provider | Env Value | Type | Requires API key? |
|
||||
|----------|-----------|------|-------------------|
|
||||
| `openai` | `CHATGPT_MCP_PROVIDER=openai` | Cloud (OpenAI Responses API) | Yes (`OPENAI_API_KEY`) |
|
||||
| `manual` | `CHATGPT_MCP_PROVIDER=manual` | Local (copy-paste) | No |
|
||||
| `ollama` | `CHATGPT_MCP_PROVIDER=ollama` | Local (Ollama /api/chat) | No |
|
||||
|
||||
## Completed (Phase 5)
|
||||
|
||||
**All five MCP tools registered:** ask_chatgpt, review_plan, review_code, debug_issue, architecture_review.
|
||||
@@ -208,7 +242,7 @@ Project-local Claude Code discovery configured:
|
||||
|
||||
## Next Pending
|
||||
|
||||
No pending tasks. MVP complete. Future work: additional providers (Ollama, Anthropic), streaming responses, cost tracking, Dockerfile, CI pipeline, safe project summary generation.
|
||||
No pending tasks. MVP complete. Future work: Anthropic provider, streaming responses, cost tracking, Dockerfile, CI pipeline, safe project summary generation.
|
||||
|
||||
## General Rules
|
||||
|
||||
|
||||
Reference in New Issue
Block a user