{"id":34586086,"url":"https://github.com/daggbt/optyx","last_synced_at":"2026-02-08T12:19:14.684Z","repository":{"id":328733724,"uuid":"1112047823","full_name":"daggbt/optyx","owner":"daggbt","description":"Intuitive symbolic interface for constrained optimization problems. Write natural Python, get automatic gradients and solvers.","archived":false,"fork":false,"pushed_at":"2026-02-05T16:29:57.000Z","size":3265,"stargazers_count":23,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-05T22:22:00.429Z","etag":null,"topics":["autodiff","automatic-differentiation","constraints","nonlinear-programming","operations-research","optimization","python","scipy","symbolic-math"],"latest_commit_sha":null,"homepage":"https://daggbt.github.io/optyx/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daggbt.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"docs/contributing.qmd","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-08T04:35:03.000Z","updated_at":"2026-02-05T10:20:18.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/daggbt/optyx","commit_stats":null,"previous_names":["daggbt/optyx"],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/daggbt/optyx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daggbt%2Foptyx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daggbt%2Foptyx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daggbt%2Foptyx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daggbt%2Foptyx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daggbt","download_url":"https://codeload.github.com/daggbt/optyx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daggbt%2Foptyx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29229847,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-08T12:03:03.049Z","status":"ssl_error","status_checked_at":"2026-02-08T12:02:56.077Z","response_time":57,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["autodiff","automatic-differentiation","constraints","nonlinear-programming","operations-research","optimization","python","scipy","symbolic-math"],"created_at":"2025-12-24T10:31:33.468Z","updated_at":"2026-02-08T12:19:14.678Z","avatar_url":"https://github.com/daggbt.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Optyx\n\n**Optimization that reads like Python.**\n\n[![PyPI](https://img.shields.io/pypi/v/optyx.svg)](https://pypi.org/project/optyx/)\n[![Python 3.12+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n[![CI](https://github.com/daggbt/optyx/actions/workflows/ci.yml/badge.svg)](https://github.com/daggbt/optyx/actions/workflows/ci.yml)\n[![Docs](https://img.shields.io/badge/docs-online-blue.svg)](https://daggbt.github.io/optyx/)\n\n📚 **[Documentation](https://daggbt.github.io/optyx/)** · 🚀 **[Quickstart](https://daggbt.github.io/optyx/getting-started/quickstart.html)** · 💡 **[Examples](https://daggbt.github.io/optyx/examples/portfolio.html)**\n\n\u003ctable\u003e\n\u003ctr\u003e\n\u003cth\u003eWith Optyx\u003c/th\u003e\n\u003cth\u003eWith SciPy\u003c/th\u003e\n\u003c/tr\u003e\n\u003ctr\u003e\n\u003ctd\u003e\n\n```python\nfrom optyx import Variable, Problem\n\nx = Variable(\"x\", lb=0)\ny = Variable(\"y\", lb=0)\n\nsolution = (\n    Problem()\n    .minimize(x**2 + y**2)\n    .subject_to(x + y \u003e= 1)\n    .solve()\n)\n# x=0.5, y=0.5\n```\n\n\u003c/td\u003e\n\u003ctd\u003e\n\n```python\nfrom scipy.optimize import minimize\nimport numpy as np\n\ndef objective(v):\n    return v[0]**2 + v[1]**2\n\ndef gradient(v):  # manual!\n    return np.array([2*v[0], 2*v[1]])\n\nresult = minimize(\n    objective, x0=[1, 1], jac=gradient,\n    method='SLSQP',\n    bounds=[(0, None), (0, None)],\n    constraints={'type': 'ineq',\n                 'fun': lambda v: v[0]+v[1]-1}\n)\n```\n\n\u003c/td\u003e\n\u003c/tr\u003e\n\u003c/table\u003e\n\nYour optimization code should read like your math. With Optyx, `x + y \u003e= 1` is exactly that—not a lambda buried in a constraint dictionary.\n\n---\n\n## Why Optyx?\n\nPython has excellent optimization libraries. SciPy provides algorithms. CVXPY handles convex problems. Pyomo scales to industrial applications.\n\n**Optyx takes a different path: radical simplicity.**\n\n- **Write problems as you think them** — `x**2 + y**2` not `lambda v: v[0]**2 + v[1]**2`\n- **Never compute gradients by hand** — symbolic autodiff handles derivatives\n- **Skip solver configuration** — sensible defaults, automatic solver selection\n\n### Being Honest\n\nOptyx is young and opinionated. It's **not** a replacement for specialized tools:\n\n| Need | Use Instead |\n|------|-------------|\n| MILP at scale | Pyomo, OR-Tools, Gurobi |\n| Convex guarantees | CVXPY |\n| Maximum performance | Raw solver APIs |\n\nBut if you want readable optimization code that just works for most problems, Optyx might be for you.\n\n---\n\n## Installation\n\n```bash\npip install optyx\n```\n\nRequires Python 3.12+, NumPy ≥2.0, SciPy ≥1.6.\n\n---\n\n## Quick Examples\n\n### Constrained Quadratic\n\n```python\nfrom optyx import Variable, Problem\n\nx = Variable(\"x\", lb=0)\ny = Variable(\"y\", lb=0)\n\nsolution = (\n    Problem()\n    .minimize(x**2 + y**2)\n    .subject_to(x + y \u003e= 1)\n    .solve()\n)\n# x=0.5, y=0.5, objective=0.5\n```\n\n### Portfolio Optimization\n\n```python\nfrom optyx import Variable, Problem\n\n# Asset weights\ntech = Variable(\"tech\", lb=0, ub=1)\nenergy = Variable(\"energy\", lb=0, ub=1)\nfinance = Variable(\"finance\", lb=0, ub=1)\n\n# Expected returns and risk (simplified)\nreturns = 0.12*tech + 0.08*energy + 0.10*finance\nrisk = tech**2 + energy**2 + finance**2  # variance proxy\n\nsolution = (\n    Problem()\n    .minimize(risk)\n    .subject_to(returns \u003e= 0.09)              # minimum return\n    .subject_to((tech + energy + finance).eq(1))  # fully invested\n    .solve()\n)\n```\n\n### Autodiff Just Works\n\n```python\nfrom optyx import Variable\nfrom optyx.core.autodiff import gradient\n\nx = Variable(\"x\")\nf = x**3 + 2*x**2 - 5*x + 3\n\ndf = gradient(f, x)  # Symbolic: 3x² + 4x - 5\nprint(df.evaluate({\"x\": 2.0}))  # 15.0\n```\n\n---\n\n## Features at a Glance\n\n| Feature | Description |\n|---------|-------------|\n| **Natural syntax** | `x + y \u003e= 1` instead of constraint dictionaries |\n| **Automatic gradients** | Symbolic differentiation—no manual derivatives |\n| **Smart solver selection** | HiGHS for LP, SLSQP/BFGS for NLP |\n| **Fast re-solve** | Cached compilation, up to 900x speedup |\n| **Debuggable** | Inspect expression trees, understand your model |\n\nSee the [documentation](https://daggbt.github.io/optyx/) for the full API reference, tutorials, and real-world examples.\n\n---\n\n## What's Next\n\nOptyx is actively evolving:\n\n- **Vector/Matrix variables** — Handle thousands of decision variables cleanly\n- **JIT compilation** — Faster execution for complex models  \n- **More solvers** — IPOPT integration for large-scale NLP\n- **Better debugging** — Infeasibility diagnostics and model inspection\n\nSee the [roadmap](https://daggbt.github.io/optyx/contributing.html) for details.\n\n---\n\n## Contributing\n\n```bash\ngit clone https://github.com/daggbt/optyx.git\ncd optyx\nuv sync\nuv run pytest\n```\n\nContributions welcome! See our [contributing guide](https://daggbt.github.io/optyx/contributing.html).\n\n---\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaggbt%2Foptyx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaggbt%2Foptyx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaggbt%2Foptyx/lists"}