feat(arch): implement 'Code as Thought' architecture and formalize PSF Consensus Loop
This commit is contained in:
@@ -1 +0,0 @@
|
||||
../system/skills/org-skill-provider-openrouter.org
|
||||
72
notes/org-skill-provider-openrouter.org
Normal file
72
notes/org-skill-provider-openrouter.org
Normal file
@@ -0,0 +1,72 @@
|
||||
#+TITLE: SKILL: OpenRouter Provider Agent (Universal Literate Note)
|
||||
#+ID: skill-provider-openrouter
|
||||
#+STARTUP: content
|
||||
#+FILETAGS: :llm:provider:openrouter:unified:psf:
|
||||
|
||||
* Overview
|
||||
The **OpenRouter Provider Agent** acts as a unified gateway to hundreds of LLMs. It provides flexibility by dynamically switching between models based on intelligence tiers while maintaining architectural alignment.
|
||||
|
||||
* Phase A: Demand (PRD)
|
||||
:PROPERTIES:
|
||||
:STATUS: FROZEN
|
||||
:END:
|
||||
|
||||
** 1. Purpose
|
||||
Define the interface for unified communication with the OpenRouter API.
|
||||
|
||||
** 2. User Needs
|
||||
- **Abstraction:** OpenAI-compatible interface for all OpenRouter models.
|
||||
- **Dynamic Routing:** Support for intelligence tiers (:POWERFUL, :FAST, :FREE).
|
||||
- **Resilience:** Leverage auto-routing fallbacks.
|
||||
- **Transparency:** Proper identification via Referer and Title headers.
|
||||
|
||||
** 3. Success Criteria
|
||||
*** TODO Tiered Model Resolution
|
||||
*** TODO OpenAI-Compatible Payload Generation
|
||||
*** TODO Header Compliance Verification
|
||||
|
||||
* Phase B: Blueprint (PROTOCOL)
|
||||
:PROPERTIES:
|
||||
:STATUS: SIGNED
|
||||
:END:
|
||||
|
||||
** 1. Architectural Intent
|
||||
Interfaces for executing neural completion requests via the unified OpenRouter gateway.
|
||||
|
||||
** 2. Semantic Interfaces
|
||||
#+begin_src lisp
|
||||
(defun execute-openrouter-request (prompt system-prompt)
|
||||
"Executes a completion request via the OpenRouter API.")
|
||||
|
||||
(defun get-openrouter-models ()
|
||||
"Returns a curated list of models across tiers.")
|
||||
#+end_src
|
||||
|
||||
* Phase D: Build (Implementation)
|
||||
|
||||
** Request Execution
|
||||
#+begin_src lisp :tangle projects/org-skill-provider-openrouter/src/provider-logic.lisp
|
||||
(defun execute-openrouter-request (prompt system-prompt)
|
||||
(let ((api-key (uiop:getenv "OPENROUTER_API_KEY")))
|
||||
(unless api-key (return-from execute-openrouter-request "ERROR: Key missing"))
|
||||
(let ((model (get-tiered-model :fast "meta-llama/llama-3-70b-instruct")))
|
||||
;; Physical API call logic (mocked for refactor)
|
||||
(format nil "Executing OpenRouter request on ~a" model))))
|
||||
#+end_src
|
||||
|
||||
** Model Discovery
|
||||
#+begin_src lisp :tangle projects/org-skill-provider-openrouter/src/provider-logic.lisp
|
||||
(defun get-openrouter-models ()
|
||||
'((:id "anthropic/claude-3.5-sonnet" :context "200k" :tier :powerful)
|
||||
(:id "google/gemini-flash-1.5" :context "1m" :tier :fast)
|
||||
(:id "openrouter/auto" :context "varying" :tier :free)))
|
||||
#+end_src
|
||||
|
||||
* Registration
|
||||
#+begin_src lisp
|
||||
(defskill :skill-provider-openrouter
|
||||
:priority 100
|
||||
:trigger (lambda (context) nil)
|
||||
:neuro (lambda (context) nil)
|
||||
:symbolic (lambda (action context) action))
|
||||
#+end_src
|
||||
Reference in New Issue
Block a user