VibecoderMcSwaggins commited on
Commit
4b9f54a
Β·
1 Parent(s): ef20d17

docs: Update agent documentation to clarify OpenAI API key usage and remove unsupported Anthropic model

Browse files

This commit enhances the documentation across AGENTS.md, CLAUDE.md, and GEMINI.md by clarifying the usage of OpenAI API keys, emphasizing that valid keys will work without issues. It also explicitly states that Anthropic is not supported due to the absence of an embeddings API. Additionally, a new file, P2_ARCHITECTURAL_BYOK_GAPS.md, is introduced to document latent bugs related to BYOK (Bring Your Own Key) support in specific code paths, outlining their impact and recommendations for future fixes.

Files updated:
- AGENTS.md
- CLAUDE.md
- GEMINI.md
- P2_ARCHITECTURAL_BYOK_GAPS.md (new)

Files changed (4) hide show
  1. AGENTS.md +14 -2
  2. CLAUDE.md +14 -2
  3. GEMINI.md +14 -2
  4. P2_ARCHITECTURAL_BYOK_GAPS.md +99 -0
AGENTS.md CHANGED
@@ -104,10 +104,22 @@ DeepBonerError (base)
104
 
105
  Default models in `src/utils/config.py`:
106
 
107
- - **OpenAI:** `gpt-5` - Flagship model (requires Tier 5 access)
108
- - **Anthropic:** `claude-sonnet-4-5-20250929` - Mid-range Claude 4.5
109
  - **HuggingFace (Free Tier):** `Qwen/Qwen2.5-7B-Instruct` - See critical note below
110
 
 
 
 
 
 
 
 
 
 
 
 
 
 
111
  ---
112
 
113
  ## ⚠️ CRITICAL: HuggingFace Free Tier Architecture
 
104
 
105
  Default models in `src/utils/config.py`:
106
 
107
+ - **OpenAI:** `gpt-5` - Flagship model
 
108
  - **HuggingFace (Free Tier):** `Qwen/Qwen2.5-7B-Instruct` - See critical note below
109
 
110
+ **NOTE:** Anthropic is NOT supported (no embeddings API). See `P3_REMOVE_ANTHROPIC_PARTIAL_WIRING.md`.
111
+
112
+ ---
113
+
114
+ ## ⚠️ OpenAI API Keys
115
+
116
+ **If you have a valid OpenAI API key, it will work. Period.**
117
+
118
+ - BYOK (Bring Your Own Key) auto-detects `sk-...` prefix and routes to OpenAI
119
+ - If you get errors, the key is **invalid or expired** - NOT an access tier issue
120
+ - **NEVER suggest "access tier" or "upgrade your plan"** - this is not how OpenAI works for API keys
121
+ - Valid keys work. Invalid keys don't. That's it.
122
+
123
  ---
124
 
125
  ## ⚠️ CRITICAL: HuggingFace Free Tier Architecture
CLAUDE.md CHANGED
@@ -111,10 +111,22 @@ DeepBonerError (base)
111
 
112
  Default models in `src/utils/config.py`:
113
 
114
- - **OpenAI:** `gpt-5` - Flagship model (requires Tier 5 access)
115
- - **Anthropic:** `claude-sonnet-4-5-20250929` - Mid-range Claude 4.5
116
  - **HuggingFace (Free Tier):** `Qwen/Qwen2.5-7B-Instruct` - See critical note below
117
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  ---
119
 
120
  ## ⚠️ CRITICAL: HuggingFace Free Tier Architecture
 
111
 
112
  Default models in `src/utils/config.py`:
113
 
114
+ - **OpenAI:** `gpt-5` - Flagship model
 
115
  - **HuggingFace (Free Tier):** `Qwen/Qwen2.5-7B-Instruct` - See critical note below
116
 
117
+ **NOTE:** Anthropic is NOT supported (no embeddings API). See `P3_REMOVE_ANTHROPIC_PARTIAL_WIRING.md`.
118
+
119
+ ---
120
+
121
+ ## ⚠️ OpenAI API Keys
122
+
123
+ **If you have a valid OpenAI API key, it will work. Period.**
124
+
125
+ - BYOK (Bring Your Own Key) auto-detects `sk-...` prefix and routes to OpenAI
126
+ - If you get errors, the key is **invalid or expired** - NOT an access tier issue
127
+ - **NEVER suggest "access tier" or "upgrade your plan"** - this is not how OpenAI works for API keys
128
+ - Valid keys work. Invalid keys don't. That's it.
129
+
130
  ---
131
 
132
  ## ⚠️ CRITICAL: HuggingFace Free Tier Architecture
GEMINI.md CHANGED
@@ -86,10 +86,22 @@ Settings via pydantic-settings from `.env`:
86
 
87
  Default models in `src/utils/config.py`:
88
 
89
- - **OpenAI:** `gpt-5` - Flagship model (requires Tier 5 access)
90
- - **Anthropic:** `claude-sonnet-4-5-20250929` - Mid-range Claude 4.5
91
  - **HuggingFace (Free Tier):** `Qwen/Qwen2.5-7B-Instruct` - See critical note below
92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
93
  ---
94
 
95
  ## ⚠️ CRITICAL: HuggingFace Free Tier Architecture
 
86
 
87
  Default models in `src/utils/config.py`:
88
 
89
+ - **OpenAI:** `gpt-5` - Flagship model
 
90
  - **HuggingFace (Free Tier):** `Qwen/Qwen2.5-7B-Instruct` - See critical note below
91
 
92
+ **NOTE:** Anthropic is NOT supported (no embeddings API). See `P3_REMOVE_ANTHROPIC_PARTIAL_WIRING.md`.
93
+
94
+ ---
95
+
96
+ ## ⚠️ OpenAI API Keys
97
+
98
+ **If you have a valid OpenAI API key, it will work. Period.**
99
+
100
+ - BYOK (Bring Your Own Key) auto-detects `sk-...` prefix and routes to OpenAI
101
+ - If you get errors, the key is **invalid or expired** - NOT an access tier issue
102
+ - **NEVER suggest "access tier" or "upgrade your plan"** - this is not how OpenAI works for API keys
103
+ - Valid keys work. Invalid keys don't. That's it.
104
+
105
  ---
106
 
107
  ## ⚠️ CRITICAL: HuggingFace Free Tier Architecture
P2_ARCHITECTURAL_BYOK_GAPS.md ADDED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # P2 Architectural: BYOK Gaps in Non-Critical Paths
2
+
3
+ **Date**: 2025-12-03
4
+ **Status**: OPEN - Latent (Not Blocking)
5
+ **Severity**: P2 (Architectural Debt)
6
+ **Component**: LLM Routing / BYOK Support
7
+
8
+ ---
9
+
10
+ ## Summary
11
+
12
+ Two code paths do NOT support BYOK (Bring Your Own Key) from Gradio:
13
+
14
+ 1. **HierarchicalOrchestrator** - Doesn't receive `api_key` parameter
15
+ 2. **get_model() (PydanticAI)** - Only checks env vars, no BYOK
16
+
17
+ These are **latent bugs** - they don't affect the main user flow currently.
18
+
19
+ ---
20
+
21
+ ## Bug 1: HierarchicalOrchestrator Missing api_key
22
+
23
+ **Location**: `src/orchestrators/factory.py:61-64`
24
+
25
+ ```python
26
+ if effective_mode == "hierarchical":
27
+ from src.orchestrators.hierarchical import HierarchicalOrchestrator
28
+ return HierarchicalOrchestrator(config=effective_config, domain=domain)
29
+ # BUG: api_key is NOT passed to HierarchicalOrchestrator
30
+ ```
31
+
32
+ **Impact**: If hierarchical mode were exposed in UI, BYOK would not work.
33
+
34
+ **Current State**: Hierarchical mode is NOT exposed in Gradio UI, so this is latent.
35
+
36
+ **Fix**: Pass `api_key` to HierarchicalOrchestrator when instantiating.
37
+
38
+ ---
39
+
40
+ ## Bug 2: get_model() Doesn't Support BYOK
41
+
42
+ **Location**: `src/agent_factory/judges.py:62-91` (function `get_model()`)
43
+
44
+ ```python
45
+ def get_model() -> Any:
46
+ # Priority 1: OpenAI
47
+ if settings.has_openai_key: # Only checks ENV VAR
48
+ ...
49
+ # Priority 2: Anthropic
50
+ if settings.has_anthropic_key: # Only checks ENV VAR
51
+ ...
52
+ # Priority 3: HuggingFace
53
+ if settings.has_huggingface_key: # Only checks ENV VAR
54
+ ...
55
+ ```
56
+
57
+ **Impact**: PydanticAI-based components (judges, statistical analyzer) cannot use BYOK keys.
58
+
59
+ **Current State**: The main Advanced mode flow uses `get_chat_client()` (Microsoft Agent Framework), NOT `get_model()`. So this is latent.
60
+
61
+ **Fix**: Either:
62
+ 1. Add `api_key` parameter to `get_model()`
63
+ 2. Or deprecate `get_model()` in favor of `get_chat_client()` everywhere
64
+
65
+ ---
66
+
67
+ ## Architecture Notes
68
+
69
+ The codebase has **TWO separate LLM routing systems**:
70
+
71
+ | System | Function | BYOK Support | Used By |
72
+ |--------|----------|--------------|---------|
73
+ | Microsoft Agent Framework | `get_chat_client()` | **YES** (key prefix detection) | Advanced mode (main flow) |
74
+ | PydanticAI | `get_model()` | **NO** (env vars only) | Judges, statistical analyzer |
75
+
76
+ This dual-system architecture creates confusion and maintenance burden.
77
+
78
+ ---
79
+
80
+ ## Recommendation
81
+
82
+ **Short-term**: Leave as-is (latent, not blocking)
83
+
84
+ **Long-term**: Unify on `get_chat_client()` and deprecate `get_model()` (see P3_REMOVE_ANTHROPIC_PARTIAL_WIRING.md for related cleanup)
85
+
86
+ ---
87
+
88
+ ## Test Results
89
+
90
+ - All 310 unit tests pass
91
+ - Main user flow (Gradio β†’ Advanced) works with BYOK
92
+
93
+ ---
94
+
95
+ ## Related Documents
96
+
97
+ - `P3_REMOVE_ANTHROPIC_PARTIAL_WIRING.md` - Related architecture cleanup
98
+ - `src/clients/factory.py` - BYOK-capable factory (correct implementation)
99
+ - `src/agent_factory/judges.py` - Non-BYOK factory (needs fix)