@QingQ77: 开源的"代码即动作"科研智能体,用持久化内核运行真正的 Python/R 代码而不是固定工具表,让研究者靠便宜模型(豆包 ¥9.9/月)复现 Claude Science 级别的科研自动化。 https://github.com/PKU-…

X AI KOLs Timeline 工具

摘要

开源的科研智能体 OpenAI4S,通过持久化内核运行真正的 Python/R 代码,结合 JSON 工具编排,让研究者可以用极低成本(豆包 ¥9.9/月)复现 Claude Science 级别的科研自动化。

开源的"代码即动作"科研智能体,用持久化内核运行真正的 Python/R 代码而不是固定工具表,让研究者靠便宜模型(豆包 ¥9.9/月)复现 Claude Science 级别的科研自动化。 https://t.co/psflPDmCys https://t.co/wS57b1kB20
查看原文
查看缓存全文

缓存时间: 2026/07/13 11:53

开源的“代码即动作“科研智能体,用持久化内核运行真正的 Python/R 代码而不是固定工具表,让研究者靠便宜模型(豆包 ¥9.9/月)复现 Claude Science 级别的科研自动化。

https://t.co/psflPDmCys https://t.co/wS57b1kB20


PKU-YuanGroup/OpenAI4S

Source: https://github.com/PKU-YuanGroup/OpenAI4S

OpenAI4S · Open AI for Scientist

Open AI for Scientist

💸 Replicating Claude Science in two cuts or less

An open-source hybrid scientific research agent.
JSON tools orchestrate; persistent Python/R kernels do the science.

License: MIT Python Core deps Paradigm Tests

Stars Forks Issues PRs Welcome

English · 简体中文


Why “two cuts”? No pricey frontier-model key needed — OpenAI4S runs on Doubao (豆包) via the cheapest “Small” plan on Volcengine Ark (火山方舟): ¥9.9 / month (≈ US$1.4). Pick the ark provider in the UI and you get a Claude-Science-class agent for less than a cup of coffee.

Volcengine Ark · Agent Plan — Small tier at ¥9.9/month
Volcengine Ark · Agent Plan (Personal) — the entry Small tier is ¥9.9 / month.

🧬 JSON orchestration, Code-as-Action science

OpenAI4S deliberately has two action planes. Provider-native JSON tool calls handle deterministic orchestration, permissions, metadata, external services, and human approval. Python/R Code-as-Action handles computation, exploration, analysis, simulation, and long-running scientific work in persistent kernels. Python cells can synchronously call the in-kernel host API while they run; R is an independent persistent analysis channel.

This is not a choice between tools and code: each does the job it is good at. Tool-only and conversational work can finish through the Engine-owned, strictly structured finalize_response action. Scientific cells keep the important host.submit_output(...) completion contract, including structured artifacts and metrics. host.submit_output is the only completion signal that can fire inside a Cell; a later sole finalize_response may still close the Engine after earlier Cells have run.

JSON control planePython/R science plane
Best forworkflow, permissions, metadata, servicescomputation, analysis, simulation
Action unitOne ordered native-tool batchOne complete code cell
Compositionauditable schemas and resource policyfor, if, libraries, mid-cell Host RPC
Stateappend-only Action Ledgerkernel memory + versioned artifacts
CompletionEngine-owned finalize_responsehost.submit_output(...)
Extendingnamed Tool subclassimport a library or load a Skill
# ReAct: ~14 round-trips (read → … → filter → sort → plot).   OpenAI4S: one code cell.
hits   = [f for f in files if pattern in host.read_file(f)]
top3   = sorted(hits, key=os.path.getsize, reverse=True)[:3]
frames = [pd.read_csv(f) for f in top3]      # a 100k-row DataFrame stays in the kernel...
host.save_artifact(plot(frames))             # ...only "<DataFrame 100000×20>" hits context

📣 News

  • 2026-07-06 🎉 Open-sourced — the pure-stdlib Code-as-Action engine, the scientific web app, 24 science Skills, and BYOC remote compute.

😮 Highlights

  • 🧬 Hybrid action engine — class-based native JSON tools orchestrate while persistent Python/R kernels execute science. CLI and Web adapters start a language lazily, so tool/finalize-only runs do not spawn a kernel.
  • 📒 Ledger-first runtime — action groups/events and terminal facts are append-only; execution attempts, generation lifecycle, usage, and completion records remain durable and reconstructable.
  • 🐍 Pure-stdlib core — the engine and the web server are stdlib-only (http.server + hand-rolled WebSocket, no framework, no deps). The LLM client speaks OpenAI / Anthropic / Gemini over urllib alone.
  • 🔌 One-line multi-providerark (doubao · glm · kimi · deepseek · minimax) plus official chatgpt · claude · gemini, behind a single host.llm; switch from the UI.
  • 🖥️ Scientific workbench — live streaming, versioned artifacts, provenance, an Action Timeline surface, and a read-only-by-default Notebook. An explicit developer flag enables multiline Python/R input against the shared kernels.
  • 🔐 Hardened local execution — strict child-environment allowlists, durable approvals, one-shot generation-bound host.bash capabilities, and OS sandbox adapters (Seatbelt on macOS, bubblewrap on Linux) with visible degraded/fail-closed modes.
  • 🔬 24 bundled Skills — 14 GPU/model science Skills (AlphaFold2 · ESMFold2 · Boltz · Chai-1 · OpenFold3 · ProteinMPNN · ESM-2 · Evo2 · Borzoi · scGPT · scVI · DiffDock …) + research-workflow Skills. Skills are recipes of code, not JSON schemas; user-authored Skills stay under the data directory and cannot shadow bundled trust.
  • ☁️ BYOC remote compute — dispatch GPU jobs to your own machines via ssh:<alias> or the bundled NVIDIA NIM provider; real host.fold (single-sequence Protenix / AF3-class) under a strict no-fabrication policy.

🎬 Demo

Live API workflow — from UniProt / RCSB to a 3D structure & report
Live API workflow: from UniProt / RCSB to a 3D structure and report
Real-data analysis — human insulin INS (P01308): from UniProt / RCSB to a reproducible report
Real-data analysis: human insulin INS / UniProt P01308 from UniProt / RCSB to a reproducible report
Visual artifact editing — “raise the confidence cutoff to 75” in one line
Visual artifact editing: raise the confidence cutoff to 75 in one line
Annotation-driven chart editing — lasso a region & recolor the legend
Annotation-driven chart editing: lasso a region and recolor the legend
Plan-mode research — artemisinin & paclitaxel solubility prediction
Plan-mode research: artemisinin and paclitaxel solubility prediction
Protein engineering — from sequence to ranked mutants & structural rationale
Protein engineering: from sequence to ranked mutants and structural rationale

⚡ Quickstart

git clone https://github.com/PKU-YuanGroup/OpenAI4S && cd OpenAI4S
./setup.sh     # one-time: build the environment with uv
./start.sh     # launch the web UI at http://127.0.0.1:8760/

setup.sh creates the .venv with uv; start.sh launches the daemon + web UI from it. No API key is needed to boot — set your model in the UI (Customize → Models). One-shot without the UI: uv run openai4s run "Compute the mean of [4,8,15,16,23,42] and submit it." -v.


📚 Documentation

docwhat’s inside
Architecturethe hybrid action router, Action Ledger, host RPC, and lazy kernels
Backend extension guidewhere new Tool classes, host services, repositories, and session behaviour belong
Skillsthe 24 bundled Skills + how to write your own
Remote computeBYOC GPU jobs, host.fold, auto-provisioning
Web appUI features, Action Timeline, read-only Notebook, artifacts, and implementation status
Jupyter adapteroptional standalone Python/R KernelSpecs, install commands, and compatibility limits
Configurationmodel providers, env vars, conda envs, CLI
Securitydefense-in-depth safety layers & remote-access notes

🗺️ Roadmap

  • Ship the next-generation workbench foundation: branch activation and append-only Revert/Undo projections, verified recovery with explicit Partial/Failed state, dependency-level stale propagation, durable delegation, quarantined portable Session packages, checkpointed plan/review/memory state, and dedicated 2D chemistry/genome/sequence/MSA/LaTeX renderers. Arbitrary in-memory namespace objects are deliberately not serialized; recovery remains Partial unless a safe recipe can rebuild and verify them.
  • Add stronger Linux isolation beyond bubblewrap where available (for example seccomp) and expand packaged sandbox smoke coverage.
  • Keyless web_search beyond DuckDuckGo (rate-limit resilience).
  • More BYOC providers (Modal / SLURM) beyond SSH + NVIDIA NIM.
  • A public benchmark of end-to-end scientific workflows.
  • Local GPU model serving so structure/design Skills run without remote compute.

💡 Contributing

OpenAI4S is a community effort to keep the Code-as-Action paradigm open.

Before opening a PR, please read CONTRIBUTING.md — it defines branch naming, the PR checklist (.github/pull_request_template.md), code ownership (.github/CODEOWNERS), review & release policy, and the offline-test policy.

Development setup

Requires Python ≥ 3.10 and uv.

git clone https://github.com/PKU-YuanGroup/OpenAI4S && cd OpenAI4S
./setup.sh                          # uv sync --extra science + pre-commit hook
uv run pytest                       # offline test suite (LLM mocked)
uv run pre-commit run --all-files   # format + lint everything

Style is enforced by pre-commitblack, isort (--profile black), and ruff, pinned in .pre-commit-config.yaml. Runtime deps: the core is zero-dependency (pure stdlib); the optional science extra pins numpy>=1.24 · pandas>=2.0 · matplotlib>=3.7.

What we welcome

  • New Skills — a SKILL.md (+ optional kernel.py) under skills/ — recipes of code, not schemas.
  • New providers — a wire adapter under openai4s/llm/, or a BYOC compute provider.
  • Engine & UI — the core is pure stdlib and readable; the web app is framework-free.

Keep the core dependency-free, guard optional science imports behind try/except ImportError, and make sure uv run pytest and uv run pre-commit run --all-files pass before opening a PR.


👍 Acknowledgement & related work

  • Claude Science (Anthropic) — the closed reference architecture whose Code-as-Action design, persistent kernel, host-RPC protocol, and safety layers OpenAI4S independently reproduces in open source.
  • CodeAct“Executable Code Actions Elicit Better LLM Agents” — code as a unified action interface.
  • ReAct“Synergizing Reasoning and Acting in Language Models” — the tool_use baseline this project departs from.
  • The science Skills stand on ColabFold / AlphaFold, ESM, OpenFold, Boltz, Chai, ProteinMPNN, DiffDock, Evo2, Borzoi, scGPT, scVI-tools and open data services (NCBI, UniProt, RCSB PDB, EBI, OpenAlex, Crossref).

🔒 License

Released under the MIT License — see LICENSE.


✨ Star history

Star History Chart

✏️ Citing

@software{openai4s2026,
  title  = {OpenAI4S: An Open-Source Code-as-Action Scientific Research Agent},
  author = {OpenAI4S contributors},
  year   = {2026},
  url    = {https://github.com/PKU-YuanGroup/OpenAI4S},
  note   = {Open AI for Scientist — a pure-stdlib reproduction of the Code-as-Action paradigm}
}

🤝 Community contributors

Nobody-Zhang Grace-xyx wangyu-sd yusowa0716

Auto-generated from the GitHub contributors graph by scripts/update_contributors.py (Contributors workflow).


OpenAI4S · code is the action, the kernel is the environment. · 简体中文

相似文章

@php_martin: OpenAI Codex 现在免费了。 但真正让我震惊的,不是免费。 而是用本地开源模型,居然能跑出接近云端体验的 AI Agent。 视频里演示了 4 个真实场景: 修复一个已经崩溃的太空游戏 几分钟做出打地鼠网页游戏 生成苹果风格产品…

X AI KOLs Timeline

OpenAI Codex现已免费,但更令人惊讶的是本地开源模型也能达到接近云端的AI Agent体验,演示了修复游戏、开发网页游戏等场景,无需API Key和网络。

@NFTCPS: 马斯克都转发过的开源项目,你还没用? PraisonAI,5行代码直接拉起一支AI智能体团队,24小时自主跑任务,不用你盯着。 几个亮点: ① 支持100+大模型,随便接 ② 智能体之间自动交接、互相纠错 ③ 可视化拖拽编排工作流,不会代…

X AI KOLs Timeline

PraisonAI 是一个开源项目,仅需5行代码即可部署一支AI智能体团队,支持100多种大模型、可视化工作流编排,并能集成Slack/Discord等平台,实现24小时自主任务执行。该项目曾被马斯克转发。

@IndieDevHailey: Claude Science开源平替爆火!一行命令,DeepSeek/GLM随便切,科研人狂喜! OpenScience是YC孵化团队推出的开源AI科研工作台,直接平替Claude Science,却彻底无任何限制。 给它一个研究目标,它…

X AI KOLs Timeline

文章介绍开源AI科研工作台OpenScience(YC孵化),可平替Claude Science,支持多种模型切换,内置290+科研技能包和30+科学数据库,可自动化科研全流程;同时提及Anthropic官方的Claude Cookbooks开源教程合集。

@VincentLogic: 这开源项目把 Claude Code 的成本砍了 25%。 它不做新模型,不做新 IDE。 就给 AI coding agent 画了张"代码地图"。 传统玩法:模型读完整个仓库 → 爆 token。 它的玩法:先把代码用 Tree-si…

X AI KOLs Timeline

一个开源项目通过Tree-sitter将代码解析成图结构并存入本地SQLite,为AI coding agent提供代码地图,从而减少token消耗和成本,平均节省57% token,成本降低25%。支持Claude Code、Cursor、aider等工具。

@GitHub_Daily: 用 Claude Code 和 Codex 同时开好几个任务,在终端里切来切去查看,效率实在低。 最近找到 Orca,用来统一管理多个 AI 编程智能体,让它们并行干活,结果集中在一个界面里查看。 核心是支持并行工作区,把一个需求同时发给…

X AI KOLs Timeline

Orca 是一个统一的 AI 编程智能体管理工具,支持并行工作区,可同时向 Claude Code、Codex 等 AI 助手发送任务,各在独立 git 分支中生成代码并对比结果,并配有手机 App 实时跟进。