# Folium

> 面向控制理论科研的 AI Agent：论文检索 / 理论推导 / 仿真实验闭环，含工具调用、Docker 沙箱、上下文压缩与本地可观测性。

Canonical page: https://meshkore.com/agent/prisonbreakpb-folium

## Key facts

- Maintainer: PrisonBreakPB
- GitHub stars: 8 (as of 2026-12-01)
- Language: python
- Licence: MIT
- Last activity: 2026-09-07
- Category: Research, science & education › Science & lab agents (https://meshkore.com/category/research/science-labs)
- Source: https://github.com/PrisonBreakPB/Folium

## What it does

模型路由（scene 规则路由 + 自动降级）：folium/gateway.py 提供按调用场景选择模型的规则路由。各调用方通过 chat(..., scene="...") 声明自己的场景，网关查 scene → tier → 模型 映射决定候选链（primary + fallback），并把 route_reason（为什么选它）写入观测。当 primary 模型调用遇到可降级错误（429 限流、5xx、超时/断连）时，chat() 会自动改用 fallback 候选重试，避免一失败就崩；参数/鉴权/上下文超限/安全拒答等请求侧错误不会换模型，直接抛出。每次降级都会记录 llm_fallback 事件（含原始错误与切到的模型）。当前内置场景：agent_reasoning（Agent 主循环，默认 tier-balanced）、context_summarize（上下文压缩，tier-fast）、memory_maintain（记忆维护，tier-fast）。换模型只改 tier 对应的 env，不改路由规则。

## Similar projects

- [TwinLab-Bench](https://meshkore.com/agent/zjuscl-twinlab-bench.md) — ★ 8
- [verifylab](https://meshkore.com/agent/abcastor-verifylab.md) — ★ 8
- [rumi](https://meshkore.com/agent/subhansh-dev-rumi.md) — ★ 8
- [audtheia-environmental-monitoring](https://meshkore.com/agent/audtheiaofficial-audtheia-environmental-monitoring.md) — ★ 8
- [the-astronomists-nasa-space-app-challenge-2025](https://meshkore.com/agent/paulhb7-the-astronomists-nasa-space-app-challenge-2025.md) — ★ 7
- [plant-disease-consensus](https://meshkore.com/agent/yuvanvishnupandi-plant-disease-consensus.md) — ★ 7
- [thermal-sentinel-grid](https://meshkore.com/agent/karimmyasser-thermal-sentinel-grid.md) — ★ 7
- [ccm_benchmate](https://meshkore.com/agent/ccmbioinfo-ccmbenchmate.md) — ★ 6

---
From the MeshKore directory (https://meshkore.com/directory). Summary written by MeshKore from the project's public README.
