MemScale Software License Agreement
======================================
Version 1.2.1, May 2026

Copyright (c) 2026 MemScale Team. All rights reserved.

This license governs use of the accompanying software ("MemScale" or "the
Software"), distributed in compiled binary form via the Python Package Index
(PyPI) and related channels. By installing, copying, or otherwise using the
Software, you agree to be bound by the terms of this Agreement.

The Software is proprietary and closed source. No source code is distributed
with, derivable from, or otherwise available for the Software.


1. GRANT OF LICENSE
-------------------
MemScale Team grants you a non-exclusive, non-transferable, revocable license
to:

  (a) Install and use the Software on machines you own or control
  (b) Use the Software for personal, internal business, or academic research
      purposes
  (c) Use the Software in production training pipelines

This grant covers the open library itself (memscale.wrap(), memscale.optimize(),
profiler, advisor, OOM predictor, and related functionality available via
"pip install memscale"). The library is provided free of charge and does not
require an account, API key, or active subscription to use.

Optional cloud services offered by MemScale Team (including the dashboard at
app.memscale.id, run tracking, team management, and advanced advisor features)
are separate products. Use of those services is governed by the Terms of Use
published at app.memscale.id/terms and is subject to subscription tier limits
as published at app.memscale.id/pricing.


2. RESTRICTIONS
---------------
You may NOT, under any circumstances:

  (a) Reverse engineer, decompile, disassemble, or otherwise attempt to
      derive the source code of the Software or its compiled binaries
      (including but not limited to .so, .pyd, and .dylib files)

  (b) Modify, adapt, translate, port, repackage, or create derivative works
      based on the Software

  (c) Remove, alter, or obscure any proprietary notices, labels, version
      identifiers, telemetry markers, or watermarks contained in or
      generated by the Software

  (d) Bypass, disable, tamper with, or circumvent any mechanism in the
      Software in a manner that misrepresents usage or bypasses
      service-side controls of the cloud services. Disabling telemetry
      via the documented opt-out mechanism described in Section 5 is
      explicitly permitted and is NOT a violation of this clause.

  (e) Distribute, sublicense, lease, rent, sell, mirror, or otherwise
      transfer the Software or repackaged versions of it to any third
      party without prior written permission from MemScale Team. Linking
      to the official PyPI distribution is permitted

  (f) Use the Software, or knowledge derived from observing the behavior
      of the Software, to develop a directly competing memory-optimization
      product or service

  (g) Use the Software in violation of any applicable laws or regulations,
      including export controls and sanctions


3. INTELLECTUAL PROPERTY
-------------------------
The Software, including all intellectual property rights, is owned by
MemScale Team and is protected by copyright laws and international treaty
provisions.

The Software contains proprietary algorithms and trade secrets, including
but not limited to:

  - Decision engine for optimization technique selection
  - Memory profiling and OOM prediction algorithms
  - Boundary detection for transformer architectures
  - Combined optimization strategies (checkpointing, offloading, tiling,
    mixed precision, 8-bit optimizers, and their interactions)
  - Cost attribution and savings estimation models

These constitute valuable confidential information of MemScale Team. Any
disclosure, reproduction, or commercial use of these mechanisms outside
the scope of this license is strictly prohibited.


4. CLOUD SERVICES (OPTIONAL)
----------------------------
The Software can be used entirely offline without contacting any MemScale
Team server other than the optional telemetry endpoint described in
Section 5. No account or API key is required for core library usage.

Optional cloud services available at app.memscale.id provide additional
capabilities — including run history, team collaboration, the AI advisor,
billing dashboards, and analytics. Access to those services requires an
account and is subject to subscription tier limits documented at
app.memscale.id/pricing.

Use of cloud services is governed by a separate Terms of Use published at
app.memscale.id/terms. This Agreement governs the Software (library) only.


5. TELEMETRY
------------
Beginning with version 1.0.2, the Software transmits anonymous usage
telemetry to MemScale Team servers (api.memscale.id/v1/telemetry) to
support product improvement, train the learned policy engine, and aid
abuse prevention.

Telemetry is ENABLED BY DEFAULT. The first time you import MemScale on
a given user account, the Software displays a one-time notice in the
console informing you that telemetry is active and how to disable it.
The notice is recorded at ~/.memscale/.notice_shown so it does not
appear again on subsequent imports.

You may disable telemetry at any time, before or after the notice
appears, via either:

  - Environment variable: MEMSCALE_TELEMETRY=0
  - In-code call:         memscale.disable_telemetry()

When telemetry is enabled, events include:

  - Anonymous client identifier (UUID generated locally and stored at
    ~/.memscale/client_id; not linked to your account, email, or IP)
  - MemScale version
  - PyTorch version and Python version
  - Operating system name (e.g. "Linux", "Darwin", "Windows")
  - GPU model and CUDA version
  - Event type (e.g. "wrap_called", "optimize_called", "oom_predicted")
  - Anonymous aggregate metrics (technique selection counts, VRAM
    reduction percentages, optimization success/failure)

Telemetry does NOT transmit, and will never transmit:

  - Model names, weights, or architectures
  - Training data, gradients, or activations
  - Source code from your project
  - API keys, account credentials, or personally identifying information
  - File paths or hostnames
  - IP addresses (the client_id is the only identifier and is anonymous)

Transmission is fire-and-forget with a 2-second timeout and silent
failure mode: telemetry never blocks, delays, or affects your training.

Full details are published at memscale.id/privacy.


6. WARRANTY DISCLAIMER
----------------------
THE SOFTWARE IS PROVIDED "AS IS" AND "AS AVAILABLE", WITHOUT WARRANTY OF
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT,
AND ACCURACY OF INFORMATION.

MemScale Team does not warrant that the Software will be uninterrupted,
secure, or error-free, nor that memory savings on any specific model
will match published benchmarks. Every model, GPU, and training
configuration is different.


7. LIMITATION OF LIABILITY
---------------------------
TO THE MAXIMUM EXTENT PERMITTED BY APPLICABLE LAW, IN NO EVENT SHALL
MEMSCALE TEAM BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT
OF, OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

In particular, MemScale Team is not liable for:

  - Training failures, model corruption, or lost checkpoints
  - GPU damage, hardware failure, or system instability
  - Loss of training time, compute resources, or revenue
  - Indirect, special, incidental, or consequential damages

Because the Software is provided free of charge, total cumulative
liability shall not exceed USD 100.


8. TERMINATION
--------------
This license is effective until terminated. MemScale Team may terminate
this license immediately upon any material breach of its terms by you.
You may terminate this license at any time by ceasing all use of the
Software and deleting all copies.

Upon termination:

  (a) You must cease all use of the Software
  (b) You must delete all copies of the Software from your systems
  (c) Sections 2, 3, 6, 7, 9, 10, and 12 survive termination

Termination of this license does not automatically terminate any
subscription to cloud services; cloud subscriptions are governed by
their own terms at app.memscale.id/terms.


9. ENFORCEMENT
--------------
MemScale Team will pursue all available legal remedies for unauthorized
distribution, modification, reverse engineering, or use of the Software,
including DMCA takedown notices for any unauthorized copies discovered
online.

Report suspected violations to: team@memscale.id


10. EXPORT COMPLIANCE
---------------------
You agree to comply with all applicable export and re-export control
laws and regulations of Indonesia, the United States, and any other
relevant jurisdiction. You represent that you are not located in, under
the control of, or a national or resident of any country subject to
embargo or trade sanctions that would prohibit your use of the Software.


11. UPDATES TO THIS LICENSE
----------------------------
MemScale Team may revise this Agreement from time to time. The version
number and date at the top of this file indicate the most recent
revision. Material changes will be announced via the changelog at
app.memscale.id/changelog and, where appropriate, via notice to subscribed
users at least thirty (30) days before taking effect.

Continued use of the Software after the effective date of a revised
Agreement constitutes acceptance of the revised terms. If you do not
agree with revised terms, your only remedy is to cease use of the
Software and delete all copies.


12. GOVERNING LAW
-----------------
This Agreement is governed by the laws of the Republic of Indonesia,
without regard to its conflict of law provisions. Any disputes shall be
resolved in the courts of Tangerang, Banten, Indonesia, except where
mandatory consumer-protection laws of your country of residence require
otherwise.

The parties will attempt in good faith to resolve any dispute informally
before initiating formal proceedings.


13. CONTACT
-----------
For licensing, commercial, legal, and partnership matters:
  team@memscale.id

For technical and integration support:
  support@memscale.id

Website:        memscale.id
Cloud services: app.memscale.id
Changelog:      memscale.id/changelog
Privacy Policy: memscale.id/privacy
Cloud Terms:    app.memscale.id/terms


END OF LICENSE AGREEMENT
========================