Commit Graph

81 Commits

Author SHA1 Message Date
gitprov 86ef632ac6 Add Festinger upstream health status 2026-05-03 09:43:27 +02:00
gitprov e8301fb2bf Adding content to git 2026-05-03 08:45:58 +02:00
gitprov 1deb1d2521 Merge branch 'main' of ssh://ramanujan.glitch.university:2222/glitch-university/Agent0 2026-05-02 20:22:20 +02:00
gitprov 8c943ef38f Adding 2026-05-02 20:22:09 +02:00
gitprov ad1201d5e9 Merge branch 'main' of ssh://ramanujan.glitch.university:2222/glitch-university/Agent0 2026-05-02 18:55:45 +02:00
gitprov bf0c465db8 Adding 2026-05-02 18:53:47 +02:00
gitprov 3f4bf304cf Updating memories 2026-05-02 18:53:12 +02:00
gitprov e4a37bd705 docs: add shared agent knowledgebase 2026-04-26 18:51:31 +02:00
gitprov fcf1b91224 feat: wire Gerhard to gutasktool 2026-04-26 18:37:03 +02:00
gitprov 7f193c50ff Merge branch 'main' of ssh://ramanujan.glitch.university:2222/glitch-university/Agent0 2026-04-26 15:55:10 +02:00
gitprov 5535f22a85 Adding change to gitignore 2026-04-26 15:52:48 +02:00
gitprov a71906d718 Adding change to gitignore 2026-04-26 15:51:14 +02:00
gitprov e95e03def3 Adding memory for gerhard 2026-04-26 15:49:48 +02:00
gitprov bca2f47e70 Fix to festinger 2026-04-26 11:58:02 +02:00
gitprov 152dafb2d7 Adding gerhard and docker-compose 2026-04-26 11:54:16 +02:00
gitprov 1a426da58d Fixing docker compose 2026-04-26 11:53:24 +02:00
gitprov c0c3548075 Refernce built image 2026-04-26 11:49:05 +02:00
gitprov f1fe41dac7 Adding changes to docker compose 2026-04-25 13:15:15 +02:00
gitprov 14f74c372b Adding chat to hermes 2026-04-25 12:33:06 +02:00
gitprov f30d029968 Adding 2026-04-25 12:12:40 +02:00
gitprov f6d701b125 Adding -insecure flag to hermes dashboard 2026-04-25 11:40:33 +02:00
gitprov 3628c89481 Merge branch 'main' of https://ramanujan.glitch.university/glitch-university/agent0 2026-04-25 11:32:16 +02:00
gitprov df28e56add Adding changes to festinger 2026-04-25 11:31:58 +02:00
gitprov 6487e090d0 Adding memories and developing gunnar on the local machine 2026-04-25 11:28:14 +02:00
gitprov abc5cf5952 Add debug 2026-04-23 18:01:13 +02:00
gitprov ff734fcea1 Opacity issue 2026-04-23 17:55:37 +02:00
gitprov b6d11706e1 metaball 2026-04-23 17:51:13 +02:00
gitprov 251aa037d9 Fix escaping issue 2026-04-23 17:43:41 +02:00
gitprov 5ced96b918 Better visualization 2026-04-23 17:39:29 +02:00
gitprov d82bf2d899 Simplifying festering 2026-04-23 17:25:01 +02:00
gitprov dfd416a5aa Discovery allowed 2026-04-21 22:22:25 +02:00
gitprov 3b4245c9d5 Tuning concept dsicovery 2026-04-21 22:20:48 +02:00
gitprov b25bc3c596 Fix missing import asyncio in main.py
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 22:10:08 +02:00
gitprov c8e8067993 Serialize local model calls and skip concurrent context discovery
LM Studio and Ollama run one model on one GPU — concurrent requests
cause crashes. Two fixes:

1. Per-upstream semaphore (concurrency=1) in _route_agent_chat for
   lm-studio/ollama providers. All agent-routed calls to the same
   base URL queue instead of hitting the GPU simultaneously.

2. skip_discovery=True when routing to a local model. Context discovery
   would fire a second LM Studio call alongside the main inference.
   Novel words are still registered in SOAS (low saliency) but the
   LLM confirmation step waits. Configure write_model_id or a separate
   agent model pointing at a cloud/remote model to re-enable live
   context discovery.

3. _LLM_CONCURRENCY 2 → 1 in write_queue for the same reason.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 22:07:37 +02:00
gitprov 8aaa205dba Handle LiteLLM path variants for chat completions
Two fixes:
1. Add /chat/completions alias (no /v1 prefix) — LiteLLM custom_openai
   and openai_like providers post here directly.
2. Passthrough now redirects any path ending in chat/completions to the
   proper /v1/chat/completions handler instead of forwarding blindly.
   This catches v1/messages/chat/completions and other wrong paths that
   result from misconfigured api_base in Agent0.

Both routes get full agent routing, recollection injection, and loop
detection — they're not raw passthroughs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 19:49:17 +02:00
gitprov 7ed61b4823 Fix double /v1 path when routing to LM Studio
call_openai() (httpx-based) appends /v1/chat/completions to the upstream
URL. But base_url in the models table typically ends in /v1 (matching the
OpenAI SDK convention used by the resolution job). Combining them produced
/v1/v1/chat/completions → 404 from LM Studio.

Strip a trailing /v1 from the stored base_url before passing it to
call_openai() in the agent routing path.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 19:45:46 +02:00
gitprov a9aa594d73 Read agent_id/agent_name from request body (LiteLLM extra params)
LiteLLM passes extra parameters as top-level JSON fields in the request
body. _extract_agent_name() now reads agent_id and agent_name from the
body first, then falls back to X-Agent-Name / X-Agent-Id headers.

Critically, both fields are stripped from the body before any upstream
call — otherwise Claude/LM Studio reject the unknown parameters.

Applied to all four route handlers: /v1/chat/completions, /v1/messages,
/api/chat, /api/generate.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 19:41:12 +02:00
gitprov cd471c4c95 Add cross-protocol agent routing at /v1/chat/completions
When X-Agent-Name or X-Agent-Id is present and matches an agent_models
entry, Festinger routes the main inference request to the configured
provider — not just the memory-writing utility model.

Protocol translation:
  - Incoming OpenAI → outgoing Claude: system-message extraction,
    max_tokens defaulting, response translated back to OpenAI format
  - Incoming OpenAI → outgoing LM Studio/OpenAI: model + base_url swap
  - All responses returned as OpenAI-compatible JSON or SSE

Also adds streaming synthesis for /v1/chat/completions (OpenAI SSE)
and X-Agent-Id fallback in _agent_name_from_headers so numeric
AGENT_ID env vars work without needing AGENT_NAME.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 19:32:57 +02:00
gitprov 10d9e1e2dd Add per-agent model assignments (agent_models table)
Festinger now reads X-Agent-Name from every intercepted request and
resolves the utility LLM model in priority order:
  1. agent_models table  — agent-specific (e.g. gunnar → claude, rind → qwen)
  2. write_model_id config — global default
  3. Request mirror       — same provider/model Agent0 is currently using

New API: GET/PUT/DELETE /agent-models
New admin UI: "Agent models" section with assignment form and table.

Agent0 side: add a custom header X-Agent-Name: <name> in the LLM
provider config per agent container (AGENT_NAME env var can drive this).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 19:24:28 +02:00
gitprov 7210fe2066 Mirror request model for context discovery — no write_model_id needed
Festinger now extracts provider/model/api-key from every intercepted
request and passes it to the context-discover queue as a fallback_model.
_process_context_discover uses it when write_model_id is not configured,
so Agent0's current model (LM Studio, Ollama, Anthropic) is automatically
reused for utility LLM calls without any extra setup.

Priority: write_model_id (explicit override) > fallback_model (request mirror)

Also updates upstream_openai default in config.yaml to LM Studio's
local address (host.docker.internal:1234).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-21 19:17:51 +02:00
gitprov ccbb5b2d45 Adding sanity to the recollection decider 2026-04-21 19:09:25 +02:00
gitprov 128dd653e7 Adding llm to do this 2026-04-21 18:32:21 +02:00
gitprov 314f145740 Adding migration 2026-04-21 18:08:22 +02:00
gitprov 35df8c56f2 Fixing the newline error 2026-04-21 18:04:36 +02:00
gitprov 2656951bb9 Fixes 2026-04-21 17:52:27 +02:00
gitprov ce82678d14 Adding festinger 2026-04-20 18:31:13 +02:00
gitprov 98b115d471 Draing the queue 2026-04-20 18:22:57 +02:00
gitprov 58f903aec0 Adding updates to Festinger 2026-04-20 18:21:23 +02:00
gitprov 3fae2c62bd Adding improved saliency pipeline 2026-04-20 18:12:57 +02:00
gitprov 84b4a88ba1 Adding model edit 2026-04-20 17:57:48 +02:00