iqueue 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- iqueue-0.2.0/LICENSE +17 -0
- iqueue-0.2.0/PKG-INFO +242 -0
- iqueue-0.2.0/README.md +167 -0
- iqueue-0.2.0/iqueue/__init__.py +129 -0
- iqueue-0.2.0/iqueue.egg-info/PKG-INFO +242 -0
- iqueue-0.2.0/iqueue.egg-info/SOURCES.txt +149 -0
- iqueue-0.2.0/iqueue.egg-info/dependency_links.txt +1 -0
- iqueue-0.2.0/iqueue.egg-info/entry_points.txt +13 -0
- iqueue-0.2.0/iqueue.egg-info/requires.txt +58 -0
- iqueue-0.2.0/iqueue.egg-info/top_level.txt +2 -0
- iqueue-0.2.0/pyproject.toml +115 -0
- iqueue-0.2.0/setup.cfg +4 -0
- iqueue-0.2.0/src/__init__.py +3 -0
- iqueue-0.2.0/src/api/__init__.py +20 -0
- iqueue-0.2.0/src/api/__main__.py +64 -0
- iqueue-0.2.0/src/api/app.py +64 -0
- iqueue-0.2.0/src/api/routers/__init__.py +52 -0
- iqueue-0.2.0/src/api/routers/cases.py +59 -0
- iqueue-0.2.0/src/api/routers/cloud.py +85 -0
- iqueue-0.2.0/src/api/routers/config.py +63 -0
- iqueue-0.2.0/src/api/routers/expansion.py +125 -0
- iqueue-0.2.0/src/api/routers/hardware.py +50 -0
- iqueue-0.2.0/src/api/routers/health.py +47 -0
- iqueue-0.2.0/src/api/routers/highway.py +129 -0
- iqueue-0.2.0/src/api/routers/integrations.py +151 -0
- iqueue-0.2.0/src/api/routers/models.py +84 -0
- iqueue-0.2.0/src/api/routers/orchestration.py +80 -0
- iqueue-0.2.0/src/api/routers/pivotgraph.py +55 -0
- iqueue-0.2.0/src/api/routers/policy.py +120 -0
- iqueue-0.2.0/src/api/routers/ranking.py +54 -0
- iqueue-0.2.0/src/api/routers/rotator.py +76 -0
- iqueue-0.2.0/src/api/routers/stack.py +113 -0
- iqueue-0.2.0/src/api/routers/trace.py +44 -0
- iqueue-0.2.0/src/api/routers/train.py +67 -0
- iqueue-0.2.0/src/api/schemas.py +168 -0
- iqueue-0.2.0/src/api/serializers.py +57 -0
- iqueue-0.2.0/src/api/state.py +93 -0
- iqueue-0.2.0/src/cases.py +625 -0
- iqueue-0.2.0/src/cases_cli.py +52 -0
- iqueue-0.2.0/src/cloud/__init__.py +22 -0
- iqueue-0.2.0/src/cloud/providers.py +523 -0
- iqueue-0.2.0/src/cloud/routing.py +86 -0
- iqueue-0.2.0/src/cloud_demo.py +49 -0
- iqueue-0.2.0/src/config.py +413 -0
- iqueue-0.2.0/src/control_plane/__init__.py +5 -0
- iqueue-0.2.0/src/control_plane/store.py +312 -0
- iqueue-0.2.0/src/demo.py +140 -0
- iqueue-0.2.0/src/expansion_demo.py +131 -0
- iqueue-0.2.0/src/experiments/__init__.py +11 -0
- iqueue-0.2.0/src/experiments/data.py +120 -0
- iqueue-0.2.0/src/experiments/metrics.py +113 -0
- iqueue-0.2.0/src/experiments/quality.py +227 -0
- iqueue-0.2.0/src/experiments/run_ablation.py +173 -0
- iqueue-0.2.0/src/experiments/run_gamma_ablation.py +239 -0
- iqueue-0.2.0/src/experiments/train_eval.py +264 -0
- iqueue-0.2.0/src/graph/__init__.py +180 -0
- iqueue-0.2.0/src/hardware.py +313 -0
- iqueue-0.2.0/src/highway/__init__.py +66 -0
- iqueue-0.2.0/src/highway/activation_steer.py +203 -0
- iqueue-0.2.0/src/highway/chunking.py +58 -0
- iqueue-0.2.0/src/highway/context.py +489 -0
- iqueue-0.2.0/src/highway/demo.py +242 -0
- iqueue-0.2.0/src/highway/lane.py +432 -0
- iqueue-0.2.0/src/highway/multimodal_service.py +131 -0
- iqueue-0.2.0/src/highway/policy/__init__.py +133 -0
- iqueue-0.2.0/src/highway/policy/guardrails.py +145 -0
- iqueue-0.2.0/src/highway/policy/lane_velocity.py +139 -0
- iqueue-0.2.0/src/highway/policy/patrol.py +141 -0
- iqueue-0.2.0/src/highway/policy/speed_limits.py +115 -0
- iqueue-0.2.0/src/highway/policy/types.py +66 -0
- iqueue-0.2.0/src/highway/process_supervise.py +240 -0
- iqueue-0.2.0/src/highway/protocol.py +607 -0
- iqueue-0.2.0/src/highway/rag.py +70 -0
- iqueue-0.2.0/src/highway/sft.py +86 -0
- iqueue-0.2.0/src/highway/stack.py +440 -0
- iqueue-0.2.0/src/highway/stack_demo.py +103 -0
- iqueue-0.2.0/src/highway/types.py +268 -0
- iqueue-0.2.0/src/integrations/__init__.py +49 -0
- iqueue-0.2.0/src/integrations/__main__.py +6 -0
- iqueue-0.2.0/src/integrations/bridge.py +250 -0
- iqueue-0.2.0/src/integrations/crewai_backend.py +153 -0
- iqueue-0.2.0/src/integrations/demo.py +125 -0
- iqueue-0.2.0/src/integrations/dspy_backend.py +119 -0
- iqueue-0.2.0/src/integrations/examples/__init__.py +5 -0
- iqueue-0.2.0/src/integrations/examples/crew_modules.py +23 -0
- iqueue-0.2.0/src/integrations/examples/dspy_modules.py +20 -0
- iqueue-0.2.0/src/integrations/examples/langgraph_modules.py +32 -0
- iqueue-0.2.0/src/integrations/examples/smol_modules.py +23 -0
- iqueue-0.2.0/src/integrations/langgraph_backend.py +143 -0
- iqueue-0.2.0/src/integrations/mock_backend.py +62 -0
- iqueue-0.2.0/src/integrations/protocol.py +181 -0
- iqueue-0.2.0/src/integrations/registry.py +81 -0
- iqueue-0.2.0/src/integrations/smolagents_backend.py +134 -0
- iqueue-0.2.0/src/integrations/specs.py +75 -0
- iqueue-0.2.0/src/lane_engineering/__init__.py +53 -0
- iqueue-0.2.0/src/lane_engineering/apply.py +33 -0
- iqueue-0.2.0/src/lane_engineering/context_lanes.py +56 -0
- iqueue-0.2.0/src/lane_engineering/demo.py +161 -0
- iqueue-0.2.0/src/lane_engineering/facade.py +312 -0
- iqueue-0.2.0/src/lane_engineering/highway_lanes.py +115 -0
- iqueue-0.2.0/src/lane_engineering/integration_lanes.py +146 -0
- iqueue-0.2.0/src/lane_engineering/multimodal_lanes.py +73 -0
- iqueue-0.2.0/src/lane_engineering/pivotgraph_lanes.py +70 -0
- iqueue-0.2.0/src/lane_engineering/policy_lanes.py +67 -0
- iqueue-0.2.0/src/lane_engineering/ranking_lanes.py +94 -0
- iqueue-0.2.0/src/lane_engineering/rotator_lanes.py +71 -0
- iqueue-0.2.0/src/lane_engineering/stack_lanes.py +82 -0
- iqueue-0.2.0/src/lane_engineering/types.py +276 -0
- iqueue-0.2.0/src/mcp_server/__init__.py +18 -0
- iqueue-0.2.0/src/mcp_server/__main__.py +34 -0
- iqueue-0.2.0/src/mcp_server/resources.py +59 -0
- iqueue-0.2.0/src/mcp_server/server.py +279 -0
- iqueue-0.2.0/src/mcp_server/tools.py +571 -0
- iqueue-0.2.0/src/models/__init__.py +719 -0
- iqueue-0.2.0/src/models/catalog.py +255 -0
- iqueue-0.2.0/src/models/demo.py +242 -0
- iqueue-0.2.0/src/models/multimodal.py +570 -0
- iqueue-0.2.0/src/models/offline.py +141 -0
- iqueue-0.2.0/src/models/offline_mm.py +168 -0
- iqueue-0.2.0/src/models/requests.py +140 -0
- iqueue-0.2.0/src/models/steering.py +140 -0
- iqueue-0.2.0/src/models/tier_routing.py +133 -0
- iqueue-0.2.0/src/modules/__init__.py +77 -0
- iqueue-0.2.0/src/multimodal_demo.py +94 -0
- iqueue-0.2.0/src/orchestration/__init__.py +28 -0
- iqueue-0.2.0/src/orchestration/__main__.py +5 -0
- iqueue-0.2.0/src/orchestration/browser.py +220 -0
- iqueue-0.2.0/src/orchestration/demo.py +137 -0
- iqueue-0.2.0/src/orchestration/events.py +48 -0
- iqueue-0.2.0/src/orchestration/harness.py +319 -0
- iqueue-0.2.0/src/orchestration/hooks.py +45 -0
- iqueue-0.2.0/src/orchestration/stages.py +449 -0
- iqueue-0.2.0/src/orchestration/types.py +105 -0
- iqueue-0.2.0/src/pivotgraph/__init__.py +598 -0
- iqueue-0.2.0/src/pivotgraph/bridge.py +81 -0
- iqueue-0.2.0/src/pivotgraph/demo.py +118 -0
- iqueue-0.2.0/src/queue/__init__.py +234 -0
- iqueue-0.2.0/src/ranking/__init__.py +250 -0
- iqueue-0.2.0/src/ranking/embedder.py +242 -0
- iqueue-0.2.0/src/ranking/hash_embed.py +39 -0
- iqueue-0.2.0/src/reasoning/__init__.py +76 -0
- iqueue-0.2.0/src/research/__init__.py +1 -0
- iqueue-0.2.0/src/rotator/__init__.py +232 -0
- iqueue-0.2.0/src/runtime.py +228 -0
- iqueue-0.2.0/src/trace_runner.py +377 -0
- iqueue-0.2.0/src/train/__init__.py +21 -0
- iqueue-0.2.0/src/train/closed_loop.py +164 -0
- iqueue-0.2.0/src/train/qlora_road.py +319 -0
- iqueue-0.2.0/src/tutorial_demo.py +709 -0
- iqueue-0.2.0/src/types.py +154 -0
- iqueue-0.2.0/src/usecases/__init__.py +53 -0
iqueue-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
Copyright 2026 iQueue contributors
|
|
6
|
+
|
|
7
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
you may not use this file except in compliance with the License.
|
|
9
|
+
You may obtain a copy of the License at
|
|
10
|
+
|
|
11
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
|
|
13
|
+
Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
See the License for the specific language governing permissions and
|
|
17
|
+
limitations under the License.
|
iqueue-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: iqueue
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: iQueue — intent-stabilized multi-queue reasoning with expandable highway lanes and multi-model steering
|
|
5
|
+
Author: iQueue contributors
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/ehallford11714/iQueue
|
|
8
|
+
Project-URL: Documentation, https://github.com/ehallford11714/iQueue/blob/main/docs/API.md
|
|
9
|
+
Project-URL: Repository, https://github.com/ehallford11714/iQueue
|
|
10
|
+
Project-URL: Issues, https://github.com/ehallford11714/iQueue/issues
|
|
11
|
+
Keywords: iqueue,agents,multi-queue,highway,steering,rag,vae,knn
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Science/Research
|
|
15
|
+
Classifier: License :: OSI Approved :: Apache Software License
|
|
16
|
+
Classifier: Programming Language :: Python :: 3
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: numpy>=1.26.0
|
|
25
|
+
Requires-Dist: scikit-learn>=1.3.0
|
|
26
|
+
Requires-Dist: networkx>=3.2
|
|
27
|
+
Requires-Dist: matplotlib>=3.8.0
|
|
28
|
+
Requires-Dist: pyyaml>=6.0
|
|
29
|
+
Provides-Extra: local
|
|
30
|
+
Requires-Dist: torch>=2.1.0; extra == "local"
|
|
31
|
+
Requires-Dist: transformers>=4.40.0; extra == "local"
|
|
32
|
+
Requires-Dist: huggingface_hub>=0.23.0; extra == "local"
|
|
33
|
+
Requires-Dist: peft>=0.11.0; extra == "local"
|
|
34
|
+
Requires-Dist: accelerate>=0.30.0; extra == "local"
|
|
35
|
+
Requires-Dist: psutil>=5.9.0; extra == "local"
|
|
36
|
+
Provides-Extra: ui
|
|
37
|
+
Requires-Dist: streamlit>=1.32.0; extra == "ui"
|
|
38
|
+
Requires-Dist: psutil>=5.9.0; extra == "ui"
|
|
39
|
+
Provides-Extra: api
|
|
40
|
+
Requires-Dist: fastapi>=0.110.0; extra == "api"
|
|
41
|
+
Requires-Dist: uvicorn[standard]>=0.27.0; extra == "api"
|
|
42
|
+
Requires-Dist: pydantic>=2.0.0; extra == "api"
|
|
43
|
+
Provides-Extra: qlora
|
|
44
|
+
Requires-Dist: torch>=2.1.0; extra == "qlora"
|
|
45
|
+
Requires-Dist: transformers>=4.40.0; extra == "qlora"
|
|
46
|
+
Requires-Dist: huggingface_hub>=0.23.0; extra == "qlora"
|
|
47
|
+
Requires-Dist: peft>=0.11.0; extra == "qlora"
|
|
48
|
+
Requires-Dist: accelerate>=0.30.0; extra == "qlora"
|
|
49
|
+
Requires-Dist: bitsandbytes>=0.43.0; extra == "qlora"
|
|
50
|
+
Provides-Extra: frontier
|
|
51
|
+
Provides-Extra: integrations
|
|
52
|
+
Requires-Dist: langgraph>=0.2.0; extra == "integrations"
|
|
53
|
+
Requires-Dist: crewai>=0.80.0; extra == "integrations"
|
|
54
|
+
Requires-Dist: smolagents>=1.0.0; extra == "integrations"
|
|
55
|
+
Requires-Dist: dspy>=2.5.0; extra == "integrations"
|
|
56
|
+
Provides-Extra: mcp
|
|
57
|
+
Requires-Dist: mcp>=1.2.0; extra == "mcp"
|
|
58
|
+
Provides-Extra: all
|
|
59
|
+
Requires-Dist: torch>=2.1.0; extra == "all"
|
|
60
|
+
Requires-Dist: transformers>=4.40.0; extra == "all"
|
|
61
|
+
Requires-Dist: huggingface_hub>=0.23.0; extra == "all"
|
|
62
|
+
Requires-Dist: peft>=0.11.0; extra == "all"
|
|
63
|
+
Requires-Dist: accelerate>=0.30.0; extra == "all"
|
|
64
|
+
Requires-Dist: psutil>=5.9.0; extra == "all"
|
|
65
|
+
Requires-Dist: streamlit>=1.32.0; extra == "all"
|
|
66
|
+
Requires-Dist: fastapi>=0.110.0; extra == "all"
|
|
67
|
+
Requires-Dist: uvicorn[standard]>=0.27.0; extra == "all"
|
|
68
|
+
Requires-Dist: pydantic>=2.0.0; extra == "all"
|
|
69
|
+
Requires-Dist: langgraph>=0.2.0; extra == "all"
|
|
70
|
+
Requires-Dist: crewai>=0.80.0; extra == "all"
|
|
71
|
+
Requires-Dist: smolagents>=1.0.0; extra == "all"
|
|
72
|
+
Requires-Dist: dspy>=2.5.0; extra == "all"
|
|
73
|
+
Requires-Dist: mcp>=1.2.0; extra == "all"
|
|
74
|
+
Dynamic: license-file
|
|
75
|
+
|
|
76
|
+
# iQueue
|
|
77
|
+
|
|
78
|
+
<p align="center">
|
|
79
|
+
<img src="docs/assets/iqueue-logo.png" alt="iQueue logo" width="280"/>
|
|
80
|
+
</p>
|
|
81
|
+
|
|
82
|
+
**Intent-stabilized multi-queue reasoning for agentic systems.**
|
|
83
|
+
|
|
84
|
+
iQueue is an open-source control plane for agentic AI: bidirectional expandable highway lanes, rotator multi-queues, pivot-anchored embeddings, KNN + VAE ranking, lightweight + **large-model steering**, and a γ discount for veering off-highway. Scored queues serialize to markdown contexts for future runs.
|
|
85
|
+
|
|
86
|
+
## Multi-model support
|
|
87
|
+
|
|
88
|
+
| Provider | Mode | Notes |
|
|
89
|
+
|----------|------|-------|
|
|
90
|
+
| **OpenAI** | frontier API | `sol` / `terra` / `luna` → GPT-5.6 (`gpt-5.6-sol`, …) |
|
|
91
|
+
| **Anthropic** | frontier API | `opus5` / `fable` / `sonnet5` → Claude 5 family |
|
|
92
|
+
| **Google** | frontier API | `gemini-3.6-flash` |
|
|
93
|
+
| **Qwen** | DashScope / local | cloud `qwen-plus` or HF/Ollama |
|
|
94
|
+
| **OpenRouter** | gateway | one key → Sol/Opus/etc. |
|
|
95
|
+
| **mock (offline)** | local | **auto-downloads HF Qwen**, else deterministic text |
|
|
96
|
+
|
|
97
|
+
```python
|
|
98
|
+
import iqueue
|
|
99
|
+
|
|
100
|
+
iqueue.configure(
|
|
101
|
+
openai_api_key="sk-...",
|
|
102
|
+
qwen_api_key="sk-...",
|
|
103
|
+
ollama_base_url="http://127.0.0.1:11434",
|
|
104
|
+
)
|
|
105
|
+
client = iqueue.get_client("qwen")
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
See [docs/MODELS.md](docs/MODELS.md). Copy `config/models.example.json` → `config/models.local.json` for local keys.
|
|
109
|
+
|
|
110
|
+
## Quick start
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
git clone https://github.com/ehallford11714/iQueue.git
|
|
114
|
+
cd iQueue
|
|
115
|
+
python -m venv .venv
|
|
116
|
+
# Windows: .venv\Scripts\activate
|
|
117
|
+
pip install -r requirements.txt
|
|
118
|
+
set IQUEUE_SKIP_HF_DOWNLOAD=1
|
|
119
|
+
python -m src.tutorial_demo # progressive tutorial demo (or: iqueue-tutorial)
|
|
120
|
+
python -m src.demo
|
|
121
|
+
python -m src.highway.demo
|
|
122
|
+
python -m src.highway.stack_demo # stacked levels + trainable velocities
|
|
123
|
+
python -m src.models.demo # dedicated multi-provider + LM steering
|
|
124
|
+
python -m src.experiments.train_eval # proper train/eval loop + metrics
|
|
125
|
+
python -m src.experiments.run_gamma_ablation
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
**Tutorial:** [docs/TUTORIAL.md](docs/TUTORIAL.md) — install, core APIs, config, learn-the-road, and copy-paste use cases (diagnosis, incident, research, planning, policy, stack tiers).
|
|
129
|
+
|
|
130
|
+
**Lane Engineering:** [docs/LANE_ENGINEERING.md](docs/LANE_ENGINEERING.md) — designing and operating expandable `LaneQueue`s (agents, tasks, fill/drain, kinds, stack, policy).
|
|
131
|
+
|
|
132
|
+
**Orchestration + browser:** [docs/ORCHESTRATION.md](ORCHESTRATION.md) — harness pipeline (`iqueue-harness`), soft `/v1/orchestration` + MCP `iqueue_orchestrate`, and `web/` IndexedDB / WebGPU / Wasm demo.
|
|
133
|
+
|
|
134
|
+
### Streamlit demo (variable config + learn the road)
|
|
135
|
+
|
|
136
|
+
```bash
|
|
137
|
+
pip install -e ".[ui,local]" # streamlit + torch/transformers/peft
|
|
138
|
+
# optional CUDA 4-bit: pip install -e ".[qlora]"
|
|
139
|
+
streamlit run app.py
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
All knobs (`highway.*`, `train.*`, `qlora.*`, `policy.*`, `stack.*`, `models.*`, `trace.*`) are editable in the sidebar or via JSON (`config/iqueue.example.json`).
|
|
143
|
+
|
|
144
|
+
```bash
|
|
145
|
+
# CLI trace with variables
|
|
146
|
+
set IQUEUE_SKIP_HF_DOWNLOAD=1
|
|
147
|
+
python -m src.trace_runner --config config/iqueue.example.json
|
|
148
|
+
# light QLoRA + SFT while learning the road:
|
|
149
|
+
python -m src.trace_runner --config config/iqueue.example.json --qlora
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### HTTP API suite (FastAPI)
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
pip install -e ".[api]"
|
|
156
|
+
set IQUEUE_SKIP_HF_DOWNLOAD=1
|
|
157
|
+
python -m src.api --port 8765
|
|
158
|
+
# docs: http://127.0.0.1:8765/docs
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Route groups: `/health`, `/config`, `/hardware`, `/highway`, `/stack`, `/policy`,
|
|
162
|
+
`/rotator`, `/ranking`, `/pivotgraph`, `/models`, `/train`, `/trace`, `/cases`,
|
|
163
|
+
`/integrations`.
|
|
164
|
+
|
|
165
|
+
### MCP server (Cursor / agent hosts)
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
pip install -e ".[mcp]"
|
|
169
|
+
set IQUEUE_SKIP_HF_DOWNLOAD=1
|
|
170
|
+
python -m src.mcp_server # or: iqueue-mcp
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Register in Cursor MCP config (`cwd` = this repo):
|
|
174
|
+
|
|
175
|
+
```json
|
|
176
|
+
{
|
|
177
|
+
"mcpServers": {
|
|
178
|
+
"iqueue": {
|
|
179
|
+
"command": "python",
|
|
180
|
+
"args": ["-m", "src.mcp_server"],
|
|
181
|
+
"cwd": "<path-to-iQueue>",
|
|
182
|
+
"env": { "IQUEUE_SKIP_HF_DOWNLOAD": "1" }
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Full tool/resource list: [docs/MCP.md](docs/MCP.md). Project agent skills live under [`.cursor/skills/`](.cursor/skills/) (`iqueue-native`, `iqueue-lane-engineering`, `iqueue-integrations`).
|
|
189
|
+
|
|
190
|
+
### External agent frameworks (LangGraph / CrewAI / SmolAgents / DSPy)
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
pip install -e ".[integrations]" # optional; demos work without it via mock/sim
|
|
194
|
+
set IQUEUE_SKIP_HF_DOWNLOAD=1
|
|
195
|
+
python -m src.integrations.demo --framework mock
|
|
196
|
+
python -m src.integrations.demo --framework langgraph --use-case uc_incident
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Lanes can attach a framework runner (`attach_framework` / `run_on_lane`). See [docs/INTEGRATIONS.md](docs/INTEGRATIONS.md).
|
|
200
|
+
|
|
201
|
+
### Demo test cases (CLI / Streamlit / API)
|
|
202
|
+
|
|
203
|
+
```bash
|
|
204
|
+
set IQUEUE_SKIP_HF_DOWNLOAD=1
|
|
205
|
+
python -m src.cases_cli --list
|
|
206
|
+
python -m src.cases_cli
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
See [docs/CONFIG.md](docs/CONFIG.md) and [docs/API.md](docs/API.md).
|
|
210
|
+
|
|
211
|
+
## Core ideas
|
|
212
|
+
|
|
213
|
+
| Piece | Role |
|
|
214
|
+
|-------|------|
|
|
215
|
+
| **Pivots** | Invariant latent anchors per system / use-case |
|
|
216
|
+
| **Lane Engineering** | Design/operate `LaneQueue`s: kinds, agents, tasks, expand, policy |
|
|
217
|
+
| **Expandable lanes** | Own requests, spawn/assign agents, track tasks, expand under pressure |
|
|
218
|
+
| **Stacked highways** | Multiple levels with different velocities; router + velocities are trainable |
|
|
219
|
+
| **Highway** | Bidirectional FORWARD / REVERSE with lane control & changes |
|
|
220
|
+
| **Rotator** | KNN + VAE specificity selection |
|
|
221
|
+
| **LM steering** | Frontier/local models judge adherence → fit steering vector |
|
|
222
|
+
| **γ veer penalty** | `tuple_score = base × γ^{veer_steps} × lane_bonus` |
|
|
223
|
+
| **Context packs** | Markdown queue serialization for future context |
|
|
224
|
+
|
|
225
|
+
## Docs & schema
|
|
226
|
+
|
|
227
|
+
- [Tutorial](docs/TUTORIAL.md)
|
|
228
|
+
- [Lane Engineering](docs/LANE_ENGINEERING.md)
|
|
229
|
+
- [Explanation](docs/EXPLANATION.md)
|
|
230
|
+
- [External integrations](docs/INTEGRATIONS.md) (LangGraph, CrewAI, SmolAgents, DSPy)
|
|
231
|
+
- [HTTP API suite](docs/API.md)
|
|
232
|
+
- [MCP server](docs/MCP.md) (Cursor tools/resources + skills)
|
|
233
|
+
- [Config variables](docs/CONFIG.md)
|
|
234
|
+
- [Models & API keys](docs/MODELS.md)
|
|
235
|
+
- [Schema guide](docs/SCHEMA.md)
|
|
236
|
+
- [Open schema](schema/iqueue.schema.json)
|
|
237
|
+
- [Roadmap](docs/ROADMAP.md)
|
|
238
|
+
- [Pivot alignment](src/research/PIVOT_ALIGNMENT.md)
|
|
239
|
+
|
|
240
|
+
## License
|
|
241
|
+
|
|
242
|
+
Apache-2.0 — see [LICENSE](LICENSE).
|
iqueue-0.2.0/README.md
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
# iQueue
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<img src="docs/assets/iqueue-logo.png" alt="iQueue logo" width="280"/>
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
**Intent-stabilized multi-queue reasoning for agentic systems.**
|
|
8
|
+
|
|
9
|
+
iQueue is an open-source control plane for agentic AI: bidirectional expandable highway lanes, rotator multi-queues, pivot-anchored embeddings, KNN + VAE ranking, lightweight + **large-model steering**, and a γ discount for veering off-highway. Scored queues serialize to markdown contexts for future runs.
|
|
10
|
+
|
|
11
|
+
## Multi-model support
|
|
12
|
+
|
|
13
|
+
| Provider | Mode | Notes |
|
|
14
|
+
|----------|------|-------|
|
|
15
|
+
| **OpenAI** | frontier API | `sol` / `terra` / `luna` → GPT-5.6 (`gpt-5.6-sol`, …) |
|
|
16
|
+
| **Anthropic** | frontier API | `opus5` / `fable` / `sonnet5` → Claude 5 family |
|
|
17
|
+
| **Google** | frontier API | `gemini-3.6-flash` |
|
|
18
|
+
| **Qwen** | DashScope / local | cloud `qwen-plus` or HF/Ollama |
|
|
19
|
+
| **OpenRouter** | gateway | one key → Sol/Opus/etc. |
|
|
20
|
+
| **mock (offline)** | local | **auto-downloads HF Qwen**, else deterministic text |
|
|
21
|
+
|
|
22
|
+
```python
|
|
23
|
+
import iqueue
|
|
24
|
+
|
|
25
|
+
iqueue.configure(
|
|
26
|
+
openai_api_key="sk-...",
|
|
27
|
+
qwen_api_key="sk-...",
|
|
28
|
+
ollama_base_url="http://127.0.0.1:11434",
|
|
29
|
+
)
|
|
30
|
+
client = iqueue.get_client("qwen")
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
See [docs/MODELS.md](docs/MODELS.md). Copy `config/models.example.json` → `config/models.local.json` for local keys.
|
|
34
|
+
|
|
35
|
+
## Quick start
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
git clone https://github.com/ehallford11714/iQueue.git
|
|
39
|
+
cd iQueue
|
|
40
|
+
python -m venv .venv
|
|
41
|
+
# Windows: .venv\Scripts\activate
|
|
42
|
+
pip install -r requirements.txt
|
|
43
|
+
set IQUEUE_SKIP_HF_DOWNLOAD=1
|
|
44
|
+
python -m src.tutorial_demo # progressive tutorial demo (or: iqueue-tutorial)
|
|
45
|
+
python -m src.demo
|
|
46
|
+
python -m src.highway.demo
|
|
47
|
+
python -m src.highway.stack_demo # stacked levels + trainable velocities
|
|
48
|
+
python -m src.models.demo # dedicated multi-provider + LM steering
|
|
49
|
+
python -m src.experiments.train_eval # proper train/eval loop + metrics
|
|
50
|
+
python -m src.experiments.run_gamma_ablation
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Tutorial:** [docs/TUTORIAL.md](docs/TUTORIAL.md) — install, core APIs, config, learn-the-road, and copy-paste use cases (diagnosis, incident, research, planning, policy, stack tiers).
|
|
54
|
+
|
|
55
|
+
**Lane Engineering:** [docs/LANE_ENGINEERING.md](docs/LANE_ENGINEERING.md) — designing and operating expandable `LaneQueue`s (agents, tasks, fill/drain, kinds, stack, policy).
|
|
56
|
+
|
|
57
|
+
**Orchestration + browser:** [docs/ORCHESTRATION.md](ORCHESTRATION.md) — harness pipeline (`iqueue-harness`), soft `/v1/orchestration` + MCP `iqueue_orchestrate`, and `web/` IndexedDB / WebGPU / Wasm demo.
|
|
58
|
+
|
|
59
|
+
### Streamlit demo (variable config + learn the road)
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pip install -e ".[ui,local]" # streamlit + torch/transformers/peft
|
|
63
|
+
# optional CUDA 4-bit: pip install -e ".[qlora]"
|
|
64
|
+
streamlit run app.py
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
All knobs (`highway.*`, `train.*`, `qlora.*`, `policy.*`, `stack.*`, `models.*`, `trace.*`) are editable in the sidebar or via JSON (`config/iqueue.example.json`).
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# CLI trace with variables
|
|
71
|
+
set IQUEUE_SKIP_HF_DOWNLOAD=1
|
|
72
|
+
python -m src.trace_runner --config config/iqueue.example.json
|
|
73
|
+
# light QLoRA + SFT while learning the road:
|
|
74
|
+
python -m src.trace_runner --config config/iqueue.example.json --qlora
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### HTTP API suite (FastAPI)
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
pip install -e ".[api]"
|
|
81
|
+
set IQUEUE_SKIP_HF_DOWNLOAD=1
|
|
82
|
+
python -m src.api --port 8765
|
|
83
|
+
# docs: http://127.0.0.1:8765/docs
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
Route groups: `/health`, `/config`, `/hardware`, `/highway`, `/stack`, `/policy`,
|
|
87
|
+
`/rotator`, `/ranking`, `/pivotgraph`, `/models`, `/train`, `/trace`, `/cases`,
|
|
88
|
+
`/integrations`.
|
|
89
|
+
|
|
90
|
+
### MCP server (Cursor / agent hosts)
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
pip install -e ".[mcp]"
|
|
94
|
+
set IQUEUE_SKIP_HF_DOWNLOAD=1
|
|
95
|
+
python -m src.mcp_server # or: iqueue-mcp
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Register in Cursor MCP config (`cwd` = this repo):
|
|
99
|
+
|
|
100
|
+
```json
|
|
101
|
+
{
|
|
102
|
+
"mcpServers": {
|
|
103
|
+
"iqueue": {
|
|
104
|
+
"command": "python",
|
|
105
|
+
"args": ["-m", "src.mcp_server"],
|
|
106
|
+
"cwd": "<path-to-iQueue>",
|
|
107
|
+
"env": { "IQUEUE_SKIP_HF_DOWNLOAD": "1" }
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Full tool/resource list: [docs/MCP.md](docs/MCP.md). Project agent skills live under [`.cursor/skills/`](.cursor/skills/) (`iqueue-native`, `iqueue-lane-engineering`, `iqueue-integrations`).
|
|
114
|
+
|
|
115
|
+
### External agent frameworks (LangGraph / CrewAI / SmolAgents / DSPy)
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
pip install -e ".[integrations]" # optional; demos work without it via mock/sim
|
|
119
|
+
set IQUEUE_SKIP_HF_DOWNLOAD=1
|
|
120
|
+
python -m src.integrations.demo --framework mock
|
|
121
|
+
python -m src.integrations.demo --framework langgraph --use-case uc_incident
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Lanes can attach a framework runner (`attach_framework` / `run_on_lane`). See [docs/INTEGRATIONS.md](docs/INTEGRATIONS.md).
|
|
125
|
+
|
|
126
|
+
### Demo test cases (CLI / Streamlit / API)
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
set IQUEUE_SKIP_HF_DOWNLOAD=1
|
|
130
|
+
python -m src.cases_cli --list
|
|
131
|
+
python -m src.cases_cli
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
See [docs/CONFIG.md](docs/CONFIG.md) and [docs/API.md](docs/API.md).
|
|
135
|
+
|
|
136
|
+
## Core ideas
|
|
137
|
+
|
|
138
|
+
| Piece | Role |
|
|
139
|
+
|-------|------|
|
|
140
|
+
| **Pivots** | Invariant latent anchors per system / use-case |
|
|
141
|
+
| **Lane Engineering** | Design/operate `LaneQueue`s: kinds, agents, tasks, expand, policy |
|
|
142
|
+
| **Expandable lanes** | Own requests, spawn/assign agents, track tasks, expand under pressure |
|
|
143
|
+
| **Stacked highways** | Multiple levels with different velocities; router + velocities are trainable |
|
|
144
|
+
| **Highway** | Bidirectional FORWARD / REVERSE with lane control & changes |
|
|
145
|
+
| **Rotator** | KNN + VAE specificity selection |
|
|
146
|
+
| **LM steering** | Frontier/local models judge adherence → fit steering vector |
|
|
147
|
+
| **γ veer penalty** | `tuple_score = base × γ^{veer_steps} × lane_bonus` |
|
|
148
|
+
| **Context packs** | Markdown queue serialization for future context |
|
|
149
|
+
|
|
150
|
+
## Docs & schema
|
|
151
|
+
|
|
152
|
+
- [Tutorial](docs/TUTORIAL.md)
|
|
153
|
+
- [Lane Engineering](docs/LANE_ENGINEERING.md)
|
|
154
|
+
- [Explanation](docs/EXPLANATION.md)
|
|
155
|
+
- [External integrations](docs/INTEGRATIONS.md) (LangGraph, CrewAI, SmolAgents, DSPy)
|
|
156
|
+
- [HTTP API suite](docs/API.md)
|
|
157
|
+
- [MCP server](docs/MCP.md) (Cursor tools/resources + skills)
|
|
158
|
+
- [Config variables](docs/CONFIG.md)
|
|
159
|
+
- [Models & API keys](docs/MODELS.md)
|
|
160
|
+
- [Schema guide](docs/SCHEMA.md)
|
|
161
|
+
- [Open schema](schema/iqueue.schema.json)
|
|
162
|
+
- [Roadmap](docs/ROADMAP.md)
|
|
163
|
+
- [Pivot alignment](src/research/PIVOT_ALIGNMENT.md)
|
|
164
|
+
|
|
165
|
+
## License
|
|
166
|
+
|
|
167
|
+
Apache-2.0 — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"""
|
|
2
|
+
iQueue public package surface.
|
|
3
|
+
|
|
4
|
+
import iqueue
|
|
5
|
+
iqueue.configure(openai_api_key="sk-...", anthropic_api_key="sk-...")
|
|
6
|
+
iqueue.get_client("sol") # GPT-5.6 Sol
|
|
7
|
+
iqueue.get_client("opus5") # Claude Opus 5
|
|
8
|
+
iqueue.get_client("mock") # auto-downloads HF Qwen offline
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from src.models import (
|
|
12
|
+
API_KEY_ENV,
|
|
13
|
+
DEFAULT_MODELS,
|
|
14
|
+
AnthropicClient,
|
|
15
|
+
BaseModelClient,
|
|
16
|
+
GoogleClient,
|
|
17
|
+
HuggingFaceLocalClient,
|
|
18
|
+
Message,
|
|
19
|
+
MockClient,
|
|
20
|
+
ModelConfig,
|
|
21
|
+
ModelResponse,
|
|
22
|
+
OllamaClient,
|
|
23
|
+
OpenAICompatibleClient,
|
|
24
|
+
ProviderKind,
|
|
25
|
+
QwenClient,
|
|
26
|
+
configure,
|
|
27
|
+
get_client,
|
|
28
|
+
get_config,
|
|
29
|
+
list_models,
|
|
30
|
+
list_providers,
|
|
31
|
+
resolve_client,
|
|
32
|
+
)
|
|
33
|
+
from src.models.catalog import MODEL_CATALOG, resolve_alias
|
|
34
|
+
from src.models.offline import ensure_offline_qwen, last_offline_status
|
|
35
|
+
from src.models.requests import ModelRequestResult, ModelRequestRouter, ModelRequestSpec
|
|
36
|
+
from src.models.steering import LargeModelSteerer, SteerJudgment
|
|
37
|
+
from src.models.tier_routing import LevelModelRouter, TierRoute
|
|
38
|
+
from src.highway import HighWay, HighwayConfig, Direction, LaneKind
|
|
39
|
+
from src.highway.context import HighwayContext
|
|
40
|
+
from src.highway.types import MediaAttachment, Modality
|
|
41
|
+
from src.config import IQueueConfig
|
|
42
|
+
from src.hardware import assess_hardware, pick_qwen_model, recommend_execution
|
|
43
|
+
from src.ranking import Embedder, HashEmbedder, get_embedder
|
|
44
|
+
from src.runtime import build_highway, build_stack, apply_learn_road, embedder_from, tier_router_from
|
|
45
|
+
from src.train import ClosedLoopLearner, learn_road_from_trace
|
|
46
|
+
from src.trace_runner import run_trace
|
|
47
|
+
from src.experiments.quality import evaluate_trace_quality
|
|
48
|
+
from src.control_plane import ControlPlaneStore
|
|
49
|
+
from src.models.multimodal import get_multimodal_client, run_multimodal
|
|
50
|
+
from src.cloud import decide_local_or_cloud, get_cloud_provider
|
|
51
|
+
from src.lane_engineering import (
|
|
52
|
+
EngineeredLanes,
|
|
53
|
+
ExpansionPolicy,
|
|
54
|
+
LaneBlueprint,
|
|
55
|
+
LaneEngineering,
|
|
56
|
+
LaneSpec,
|
|
57
|
+
apply as apply_lane_engineering,
|
|
58
|
+
)
|
|
59
|
+
|
|
60
|
+
__version__ = "0.2.0"
|
|
61
|
+
|
|
62
|
+
__all__ = [
|
|
63
|
+
"API_KEY_ENV",
|
|
64
|
+
"ClosedLoopLearner",
|
|
65
|
+
"ControlPlaneStore",
|
|
66
|
+
"DEFAULT_MODELS",
|
|
67
|
+
"Embedder",
|
|
68
|
+
"EngineeredLanes",
|
|
69
|
+
"ExpansionPolicy",
|
|
70
|
+
"HashEmbedder",
|
|
71
|
+
"HighwayContext",
|
|
72
|
+
"IQueueConfig",
|
|
73
|
+
"LaneBlueprint",
|
|
74
|
+
"LaneEngineering",
|
|
75
|
+
"LaneSpec",
|
|
76
|
+
"LevelModelRouter",
|
|
77
|
+
"MODEL_CATALOG",
|
|
78
|
+
"AnthropicClient",
|
|
79
|
+
"BaseModelClient",
|
|
80
|
+
"Direction",
|
|
81
|
+
"GoogleClient",
|
|
82
|
+
"HighWay",
|
|
83
|
+
"HighwayConfig",
|
|
84
|
+
"HuggingFaceLocalClient",
|
|
85
|
+
"LaneKind",
|
|
86
|
+
"LargeModelSteerer",
|
|
87
|
+
"MediaAttachment",
|
|
88
|
+
"Message",
|
|
89
|
+
"MockClient",
|
|
90
|
+
"Modality",
|
|
91
|
+
"ModelConfig",
|
|
92
|
+
"ModelRequestResult",
|
|
93
|
+
"ModelRequestRouter",
|
|
94
|
+
"ModelRequestSpec",
|
|
95
|
+
"ModelResponse",
|
|
96
|
+
"OllamaClient",
|
|
97
|
+
"OpenAICompatibleClient",
|
|
98
|
+
"ProviderKind",
|
|
99
|
+
"QwenClient",
|
|
100
|
+
"SteerJudgment",
|
|
101
|
+
"TierRoute",
|
|
102
|
+
"apply_lane_engineering",
|
|
103
|
+
"apply_learn_road",
|
|
104
|
+
"assess_hardware",
|
|
105
|
+
"build_highway",
|
|
106
|
+
"build_stack",
|
|
107
|
+
"configure",
|
|
108
|
+
"decide_local_or_cloud",
|
|
109
|
+
"embedder_from",
|
|
110
|
+
"ensure_offline_qwen",
|
|
111
|
+
"evaluate_trace_quality",
|
|
112
|
+
"get_client",
|
|
113
|
+
"get_cloud_provider",
|
|
114
|
+
"get_config",
|
|
115
|
+
"get_embedder",
|
|
116
|
+
"get_multimodal_client",
|
|
117
|
+
"last_offline_status",
|
|
118
|
+
"learn_road_from_trace",
|
|
119
|
+
"list_models",
|
|
120
|
+
"list_providers",
|
|
121
|
+
"pick_qwen_model",
|
|
122
|
+
"recommend_execution",
|
|
123
|
+
"resolve_alias",
|
|
124
|
+
"resolve_client",
|
|
125
|
+
"run_multimodal",
|
|
126
|
+
"run_trace",
|
|
127
|
+
"tier_router_from",
|
|
128
|
+
"__version__",
|
|
129
|
+
]
|