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.0.1.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.0.1-py3-none-any.whl (47.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for fugacio_copilot-0.0.1.tar.gz
Algorithm Hash digest
SHA256 93c19dcfbe0e9680df09be525274bca160801dfc81a9c09d923dff15fbda2298
MD5 9a7ab167b0612f2f674c77a2eca519cf
BLAKE2b-256 5654d4625e6507d39b3e46dd0a0b5bd4604b59a057060cdaecb7ff49942821eb

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for fugacio_copilot-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e7b2820aca7844296fda83dbd26254442a90c48c7fbe912b45ab533fd41fe47c
MD5 6b042c64caf368f133b5bcdfb0ba44cd
BLAKE2b-256 af7b99ff961496f2104c0dcf811cae79ba64449323c4c4e0c074c128fe4bc112

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