Skip to main content

Chemical-engineering design copilot/agent for the Fugacio stack.

Project description

fugacio-copilot

Chemical-engineering design copilot/agent for the Fugacio stack. It sits on top of fugacio.sim and turns natural-language design goals into engineering calculations: flowsheets, equipment sizing, and (eventually) techno-economic / life-cycle analysis.

The bridge between a language model and the differentiable engine is a tool registry, deterministic, JSON-in/JSON-out functions exposed with the same function-calling schemas OpenAI/Anthropic expect:

  • Properties & equilibrium: list_components, component_properties, saturation_pressure, bubble_pressure, flash_drum.
  • Molecular PC-SAFT: saft_flash, saft_density, saft_saturation_pressure, saft_bubble_pressure, and saft_residual_enthalpy, the molecular EOS preferred for associating fluids (water, alcohols).
  • Unit operations: heat_exchanger, compressor (and turbine), pump, valve, each closing a rigorous energy balance.
  • Distillation: shortcut_distillation (Fenske-Underwood-Gilliland) and rigorous_distillation (multistage column with duties).
  • Gradient-based optimization: optimize_flash_temperature and optimize_column_reflux solve for the operating variable that hits a target by differentiating straight through the equilibrium flash and the column.

A model-agnostic agent loop (run_agent) drives plan→act→answer; the planner is injected, so the loop is fully testable with a scripted planner while a real LLM drops in behind the optional llm extra.

from fugacio.copilot import call_tool, run_agent, tool_schemas

# Call an engine-backed tool directly (JSON in / JSON out):
call_tool("saturation_pressure", {"component": "propane", "temperature": 300.0})

# Or drive the agent loop with your own planner (an LLM in production):
def planner(goal, tools, transcript):
    if not transcript:
        return {"tool": "flash_drum", "arguments": {
            "components": ["methane", "propane", "n-pentane"],
            "z": [0.5, 0.3, 0.2], "flow": 100.0,
            "temperature": 320.0, "pressure": 20e5,
        }}
    vf = transcript[-1]["result"]["vapor_fraction"]
    return {"final_answer": f"vapor fraction = {vf:.3f}"}

run_agent("Flash this feed", planner).answer  # 'vapor fraction = 0.747'

tool_schemas() returns the schemas to hand an LLM. LLM-backed planning lives behind the optional llm extra:

pip install "fugacio-copilot[llm]"

Part of the fugacio namespace; installs independently: pip install fugacio-copilot.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fugacio_copilot-0.1.0.tar.gz (51.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fugacio_copilot-0.1.0-py3-none-any.whl (47.6 kB view details)

Uploaded Python 3

File details

Details for the file fugacio_copilot-0.1.0.tar.gz.

File metadata

  • Download URL: fugacio_copilot-0.1.0.tar.gz
  • Upload date:
  • Size: 51.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fugacio_copilot-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d9cbf74855342366ea3eb800cdd3ed7461ab9b273f52fc583a0d2a6c2d37fa47
MD5 c31dc80c5651a8250b75c140f966c6f0
BLAKE2b-256 b16c6dbb115bc67900eb7020f66a105b37ce2ea5d835624063b1c976abb0652d

See more details on using hashes here.

File details

Details for the file fugacio_copilot-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: fugacio_copilot-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 47.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for fugacio_copilot-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c839f1a08a0bcf6f407428e4cc22c5e5a1c9924be0afa46f3022fdb1e65ebd4f
MD5 687e304da4e4fa258968d7ec510755cf
BLAKE2b-256 99443cbaf8aac5a16de134c08ba25543748d8e6591df44a670573f54d977886f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page