inferrail 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- inferrail-0.1.0/.env.example +11 -0
- inferrail-0.1.0/.github/workflows/ci.yml +46 -0
- inferrail-0.1.0/.gitignore +38 -0
- inferrail-0.1.0/CLAUDE.md +62 -0
- inferrail-0.1.0/CONTRIBUTING.md +55 -0
- inferrail-0.1.0/ERRORS.md +32 -0
- inferrail-0.1.0/LICENSE +190 -0
- inferrail-0.1.0/PKG-INFO +434 -0
- inferrail-0.1.0/README.md +403 -0
- inferrail-0.1.0/SECURITY.md +34 -0
- inferrail-0.1.0/config.schema.json +236 -0
- inferrail-0.1.0/docs/ARCHITECTURE.md +291 -0
- inferrail-0.1.0/docs/PRINCIPLES.md +75 -0
- inferrail-0.1.0/docs/PRODUCT.md +226 -0
- inferrail-0.1.0/docs/adr/0001-openai-compatible-gateway.md +49 -0
- inferrail-0.1.0/docs/adr/0002-static-deterministic-routing.md +50 -0
- inferrail-0.1.0/docs/adr/0003-no-payload-persistence-by-default.md +42 -0
- inferrail-0.1.0/docs/adr/0004-data-plane-control-plane-boundary.md +49 -0
- inferrail-0.1.0/docs/adr/0005-privacy-preserving-economic-receipts.md +96 -0
- inferrail-0.1.0/docs/adr/0006-streaming-and-tool-calling-execution-fidelity.md +105 -0
- inferrail-0.1.0/examples/basic_chat_request.py +37 -0
- inferrail-0.1.0/inferrail-mcp/README.md +44 -0
- inferrail-0.1.0/inferrail-mcp/src/inferrail_mcp/__init__.py +11 -0
- inferrail-0.1.0/inferrail-mcp/src/inferrail_mcp/server.py +230 -0
- inferrail-0.1.0/inferrail.example.yaml +65 -0
- inferrail-0.1.0/llms.txt +37 -0
- inferrail-0.1.0/openapi.json +586 -0
- inferrail-0.1.0/pyproject.toml +83 -0
- inferrail-0.1.0/scripts/generate_config_schema.py +42 -0
- inferrail-0.1.0/scripts/generate_errors_md.py +74 -0
- inferrail-0.1.0/scripts/generate_openapi.py +48 -0
- inferrail-0.1.0/src/inferrail/__init__.py +1 -0
- inferrail-0.1.0/src/inferrail/cli/__init__.py +3 -0
- inferrail-0.1.0/src/inferrail/cli/attributes.py +44 -0
- inferrail-0.1.0/src/inferrail/cli/demo.py +221 -0
- inferrail-0.1.0/src/inferrail/cli/main.py +240 -0
- inferrail-0.1.0/src/inferrail/cli/report.py +188 -0
- inferrail-0.1.0/src/inferrail/cli/try_cmd.py +227 -0
- inferrail-0.1.0/src/inferrail/config/__init__.py +35 -0
- inferrail-0.1.0/src/inferrail/config/loader.py +54 -0
- inferrail-0.1.0/src/inferrail/config/models.py +136 -0
- inferrail-0.1.0/src/inferrail/config/quickstart.py +57 -0
- inferrail-0.1.0/src/inferrail/errors/__init__.py +25 -0
- inferrail-0.1.0/src/inferrail/errors/codes.py +143 -0
- inferrail-0.1.0/src/inferrail/errors/exceptions.py +127 -0
- inferrail-0.1.0/src/inferrail/gateway/__init__.py +3 -0
- inferrail-0.1.0/src/inferrail/gateway/app.py +124 -0
- inferrail-0.1.0/src/inferrail/gateway/attribution.py +43 -0
- inferrail-0.1.0/src/inferrail/gateway/execution.py +546 -0
- inferrail-0.1.0/src/inferrail/gateway/routes.py +87 -0
- inferrail-0.1.0/src/inferrail/gateway/schemas.py +107 -0
- inferrail-0.1.0/src/inferrail/pricing/__init__.py +3 -0
- inferrail-0.1.0/src/inferrail/pricing/builtin.py +46 -0
- inferrail-0.1.0/src/inferrail/pricing/resolver.py +55 -0
- inferrail-0.1.0/src/inferrail/providers/__init__.py +11 -0
- inferrail-0.1.0/src/inferrail/providers/base.py +121 -0
- inferrail-0.1.0/src/inferrail/providers/openai.py +286 -0
- inferrail-0.1.0/src/inferrail/providers/registry.py +58 -0
- inferrail-0.1.0/src/inferrail/receipts/__init__.py +21 -0
- inferrail-0.1.0/src/inferrail/receipts/builder.py +71 -0
- inferrail-0.1.0/src/inferrail/receipts/calculator.py +27 -0
- inferrail-0.1.0/src/inferrail/receipts/schema.py +65 -0
- inferrail-0.1.0/src/inferrail/receipts/sinks.py +69 -0
- inferrail-0.1.0/src/inferrail/routing/__init__.py +3 -0
- inferrail-0.1.0/src/inferrail/routing/router.py +63 -0
- inferrail-0.1.0/src/inferrail/telemetry/__init__.py +17 -0
- inferrail-0.1.0/src/inferrail/telemetry/events.py +57 -0
- inferrail-0.1.0/src/inferrail/telemetry/sinks.py +64 -0
- inferrail-0.1.0/tests/conftest.py +26 -0
- inferrail-0.1.0/tests/integration/test_openai_live.py +53 -0
- inferrail-0.1.0/tests/unit/_fakes.py +74 -0
- inferrail-0.1.0/tests/unit/test_agent_e2e.py +228 -0
- inferrail-0.1.0/tests/unit/test_attribution.py +56 -0
- inferrail-0.1.0/tests/unit/test_cli_attributes.py +70 -0
- inferrail-0.1.0/tests/unit/test_cli_demo.py +101 -0
- inferrail-0.1.0/tests/unit/test_cli_main.py +219 -0
- inferrail-0.1.0/tests/unit/test_cli_report.py +268 -0
- inferrail-0.1.0/tests/unit/test_cli_try.py +271 -0
- inferrail-0.1.0/tests/unit/test_config.py +181 -0
- inferrail-0.1.0/tests/unit/test_config_quickstart.py +57 -0
- inferrail-0.1.0/tests/unit/test_error_codes.py +121 -0
- inferrail-0.1.0/tests/unit/test_gateway.py +756 -0
- inferrail-0.1.0/tests/unit/test_gateway_receipts.py +305 -0
- inferrail-0.1.0/tests/unit/test_mcp_server.py +194 -0
- inferrail-0.1.0/tests/unit/test_pricing.py +105 -0
- inferrail-0.1.0/tests/unit/test_providers.py +511 -0
- inferrail-0.1.0/tests/unit/test_receipts.py +270 -0
- inferrail-0.1.0/tests/unit/test_routing.py +41 -0
- inferrail-0.1.0/tests/unit/test_streaming.py +325 -0
- inferrail-0.1.0/tests/unit/test_telemetry.py +75 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Copy this file to .env and fill in real values.
|
|
2
|
+
# .env is gitignored — never commit real credentials.
|
|
3
|
+
|
|
4
|
+
OPENAI_API_KEY=sk-replace-with-your-key
|
|
5
|
+
|
|
6
|
+
# Optional: require callers of the gateway to present this exact value as
|
|
7
|
+
# `Authorization: Bearer <token>`. Unset by default (localhost-dev mode).
|
|
8
|
+
# Strongly recommended if this gateway is reachable by anything other than
|
|
9
|
+
# your own machine, since anyone who can reach it can otherwise consume
|
|
10
|
+
# your configured provider credentials. See README.md's "Security" section.
|
|
11
|
+
# INFERRAIL_GATEWAY_TOKEN=replace-with-a-long-random-value
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
test:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
strategy:
|
|
12
|
+
matrix:
|
|
13
|
+
python-version: ["3.11", "3.12"]
|
|
14
|
+
steps:
|
|
15
|
+
- uses: actions/checkout@v4
|
|
16
|
+
|
|
17
|
+
- uses: actions/setup-python@v5
|
|
18
|
+
with:
|
|
19
|
+
python-version: ${{ matrix.python-version }}
|
|
20
|
+
|
|
21
|
+
- name: Install package with dev dependencies
|
|
22
|
+
run: pip install -e ".[dev,mcp]"
|
|
23
|
+
|
|
24
|
+
- name: Lint (ruff)
|
|
25
|
+
run: ruff check .
|
|
26
|
+
|
|
27
|
+
- name: Type-check (mypy)
|
|
28
|
+
run: mypy
|
|
29
|
+
|
|
30
|
+
- name: Test (pytest, no external credentials required)
|
|
31
|
+
run: pytest
|
|
32
|
+
|
|
33
|
+
- name: Check openapi.json is up to date
|
|
34
|
+
run: |
|
|
35
|
+
python scripts/generate_openapi.py
|
|
36
|
+
git diff --exit-code openapi.json
|
|
37
|
+
|
|
38
|
+
- name: Check config.schema.json is up to date
|
|
39
|
+
run: |
|
|
40
|
+
python scripts/generate_config_schema.py
|
|
41
|
+
git diff --exit-code config.schema.json
|
|
42
|
+
|
|
43
|
+
- name: Check ERRORS.md is up to date
|
|
44
|
+
run: |
|
|
45
|
+
python scripts/generate_errors_md.py
|
|
46
|
+
git diff --exit-code ERRORS.md
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Secrets / local config
|
|
2
|
+
.env
|
|
3
|
+
inferrail.yaml
|
|
4
|
+
*.local.yaml
|
|
5
|
+
|
|
6
|
+
# Telemetry output
|
|
7
|
+
*.jsonl
|
|
8
|
+
|
|
9
|
+
# Python
|
|
10
|
+
__pycache__/
|
|
11
|
+
*.py[cod]
|
|
12
|
+
*.egg-info/
|
|
13
|
+
.eggs/
|
|
14
|
+
build/
|
|
15
|
+
dist/
|
|
16
|
+
.venv/
|
|
17
|
+
venv/
|
|
18
|
+
|
|
19
|
+
# Test / type-check caches
|
|
20
|
+
.pytest_cache/
|
|
21
|
+
.mypy_cache/
|
|
22
|
+
.ruff_cache/
|
|
23
|
+
.coverage
|
|
24
|
+
htmlcov/
|
|
25
|
+
|
|
26
|
+
# Editors / OS
|
|
27
|
+
.vscode/
|
|
28
|
+
.idea/
|
|
29
|
+
.DS_Store
|
|
30
|
+
|
|
31
|
+
# Local AI-assistant tooling state (session-specific, not part of the project)
|
|
32
|
+
.claude/
|
|
33
|
+
|
|
34
|
+
# Private local agent pointer (points at the private strategy repo; never commit)
|
|
35
|
+
CLAUDE.local.md
|
|
36
|
+
|
|
37
|
+
# Local-only scratch outputs (never commit — may contain private/strategy content)
|
|
38
|
+
local/
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Inferrail — Agent Context
|
|
2
|
+
|
|
3
|
+
Inferrail is an open inference control plane: an OpenAI-compatible
|
|
4
|
+
gateway that sits between an application and the model providers it
|
|
5
|
+
calls. **v0.1 today is the gateway only.** See `docs/PRODUCT.md` for
|
|
6
|
+
exact current scope and `docs/ARCHITECTURE.md` for how it's built.
|
|
7
|
+
|
|
8
|
+
## Before major feature work, read
|
|
9
|
+
|
|
10
|
+
- `docs/PRODUCT.md` — authoritative source for exact current scope: what
|
|
11
|
+
works, what's explicitly not supported yet
|
|
12
|
+
- `docs/ARCHITECTURE.md` — package layout, request lifecycle, and the
|
|
13
|
+
boundaries (provider, routing, telemetry, data-plane/control-plane)
|
|
14
|
+
that keep the codebase easy to extend
|
|
15
|
+
- `docs/PRINCIPLES.md` — the durable engineering principles behind this
|
|
16
|
+
project
|
|
17
|
+
- `docs/adr/` — architecture decision records for specific structural
|
|
18
|
+
choices
|
|
19
|
+
|
|
20
|
+
## Before implementing something substantial, ask
|
|
21
|
+
|
|
22
|
+
1. Which problem does this change solve?
|
|
23
|
+
2. Does it match a principle in `docs/PRINCIPLES.md`, or does it conflict
|
|
24
|
+
with one?
|
|
25
|
+
3. Is there a smaller implementation?
|
|
26
|
+
4. Does `docs/PRODUCT.md` need to change alongside the code, so scope
|
|
27
|
+
stays accurate?
|
|
28
|
+
5. What test proves this works?
|
|
29
|
+
|
|
30
|
+
## Engineering rules
|
|
31
|
+
|
|
32
|
+
- Exact current scope must match the code. If a feature ships or a
|
|
33
|
+
non-goal changes, update `docs/PRODUCT.md` in the same change.
|
|
34
|
+
- No prompt/response payload persistence in telemetry by default — this
|
|
35
|
+
is a schema-level guarantee, not a runtime flag.
|
|
36
|
+
- No secret or silent telemetry — nothing leaves the machine unless a
|
|
37
|
+
sink is explicitly configured to do that, and it must be documented.
|
|
38
|
+
- No fabricated metrics. Values that can't be measured trustworthily
|
|
39
|
+
(cost, time-to-first-token, etc.) stay `null` — never estimated or
|
|
40
|
+
guessed.
|
|
41
|
+
- The OSS data plane must keep working with zero dependency on any
|
|
42
|
+
Inferrail-operated service.
|
|
43
|
+
- Prefer deterministic, testable behavior — keep the core engine
|
|
44
|
+
independent of the web framework so it can be tested without an HTTP
|
|
45
|
+
server.
|
|
46
|
+
- Keep the hot request-execution path small; avoid unnecessary
|
|
47
|
+
dependencies and speculative complexity.
|
|
48
|
+
- Clearly distinguish shipped features from future work — a missing
|
|
49
|
+
capability is a documented non-goal, not a silent gap.
|
|
50
|
+
|
|
51
|
+
## Repo-level conventions
|
|
52
|
+
|
|
53
|
+
- Python 3.11+, FastAPI, pydantic, strict mypy, ruff. `pytest` runs fully
|
|
54
|
+
mocked — no network/API key required except the one skipped integration
|
|
55
|
+
test.
|
|
56
|
+
- Package layout and request lifecycle: `docs/ARCHITECTURE.md`.
|
|
57
|
+
- Run lint, type-check, and the test suite before considering work
|
|
58
|
+
complete.
|
|
59
|
+
- Money-related code (anything cost/pricing/budget) is held to a higher
|
|
60
|
+
correctness bar than the rest of the codebase: never silently
|
|
61
|
+
double-count, lose, or fabricate a cost value, and represent
|
|
62
|
+
uncertainty explicitly rather than collapsing it into a guess.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Contributing to Inferrail
|
|
2
|
+
|
|
3
|
+
Inferrail is early, pre-1.0 software (see [README.md](README.md) and
|
|
4
|
+
[docs/PRODUCT.md](docs/PRODUCT.md) for exact scope). Contributions are
|
|
5
|
+
welcome, but please open an issue before starting anything larger than a
|
|
6
|
+
small fix — especially anything touching routing, the provider protocol,
|
|
7
|
+
or the telemetry schema, since those are deliberate architectural
|
|
8
|
+
boundaries (see `docs/adr/`).
|
|
9
|
+
|
|
10
|
+
## Development setup
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
git clone https://github.com/domondi1/inferrail.git
|
|
14
|
+
cd inferrail
|
|
15
|
+
pip install -e ".[dev]"
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Before opening a PR
|
|
19
|
+
|
|
20
|
+
Run the same checks CI runs:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
ruff check .
|
|
24
|
+
mypy src
|
|
25
|
+
pytest
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
All of these must pass. `pytest` alone requires no API key or network
|
|
29
|
+
access — the one real-provider integration test in `tests/integration/` is
|
|
30
|
+
automatically skipped unless `OPENAI_API_KEY` is set, and it should stay
|
|
31
|
+
that way; don't make the default test suite depend on real credentials.
|
|
32
|
+
|
|
33
|
+
## Design principles this project holds to
|
|
34
|
+
|
|
35
|
+
- **No prompt/response payload persistence by default** — the telemetry
|
|
36
|
+
schema structurally has no field for it (see
|
|
37
|
+
`docs/adr/0003-no-payload-persistence-by-default.md`). Don't add one
|
|
38
|
+
without a deliberate, separately-reviewed decision.
|
|
39
|
+
- **The OSS data plane requires no Inferrail-hosted service** (see
|
|
40
|
+
`docs/adr/0004-data-plane-control-plane-boundary.md`). Don't add a code
|
|
41
|
+
path that calls out to an Inferrail-operated backend.
|
|
42
|
+
- **Unsupported request features fail loudly, never silently** (e.g.
|
|
43
|
+
`stream=true` today). If you add a feature, either implement it fully or
|
|
44
|
+
keep rejecting it explicitly — don't let a client believe a parameter
|
|
45
|
+
worked when it was ignored.
|
|
46
|
+
- Keep routing static and explicit for now — see
|
|
47
|
+
`docs/adr/0002-static-deterministic-routing.md` for why, and don't build
|
|
48
|
+
cost/latency-aware routing without a separate design discussion.
|
|
49
|
+
|
|
50
|
+
## Reporting bugs vs. security issues
|
|
51
|
+
|
|
52
|
+
Regular bugs: open a GitHub issue. Anything security- or privacy-sensitive
|
|
53
|
+
(credential handling, auth bypass, telemetry leaking payload data): see
|
|
54
|
+
[SECURITY.md](SECURITY.md) instead — please don't file those as public
|
|
55
|
+
issues first.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Inferrail — Error Codes
|
|
2
|
+
|
|
3
|
+
Generated from `src/inferrail/errors/codes.py` by
|
|
4
|
+
`scripts/generate_errors_md.py` — do not edit this file directly.
|
|
5
|
+
|
|
6
|
+
Every error the gateway returns carries one of these codes in its JSON
|
|
7
|
+
body's `error.code` field, alongside `error.remediation` (what to do
|
|
8
|
+
about it) and `error.docs_url` (this file, anchored to the code):
|
|
9
|
+
|
|
10
|
+
```json
|
|
11
|
+
{
|
|
12
|
+
"error": {
|
|
13
|
+
"message": "...",
|
|
14
|
+
"type": "RoutingError",
|
|
15
|
+
"code": "INFERRAIL_E007",
|
|
16
|
+
"remediation": "Use one of the route names under inferrail.yaml's routes: section.",
|
|
17
|
+
"docs_url": "https://github.com/domondi1/inferrail/blob/main/ERRORS.md#inferrail_e007"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
| Code | Exception type | Meaning | Remediation |
|
|
23
|
+
|---|---|---|---|
|
|
24
|
+
| <a id="inferrail_e001"></a>`INFERRAIL_E001` | `GatewayAuthenticationError` | Missing or invalid Inferrail gateway credentials. | Set the 'Authorization: Bearer <token>' header to match INFERRAIL_GATEWAY_TOKEN. |
|
|
25
|
+
| <a id="inferrail_e002"></a>`INFERRAIL_E002` | `AuthenticationError` | The upstream provider rejected Inferrail's own credentials. | Check the API key referenced by the provider's api_key_env in inferrail.yaml. |
|
|
26
|
+
| <a id="inferrail_e003"></a>`INFERRAIL_E003` | `RateLimitError` | The upstream provider is rate-limiting requests. | Safe to retry with backoff; Inferrail already retries this automatically up to the route's max_retries. |
|
|
27
|
+
| <a id="inferrail_e004"></a>`INFERRAIL_E004` | `ProviderTimeoutError` | The request to the upstream provider timed out. | Safe to retry; consider raising the route's timeout_seconds if this recurs. |
|
|
28
|
+
| <a id="inferrail_e005"></a>`INFERRAIL_E005` | `InvalidRequestError` | The upstream provider rejected the request as malformed. | Not retryable as-is; check the request body against the provider's own API docs. |
|
|
29
|
+
| <a id="inferrail_e006"></a>`INFERRAIL_E006` | `UnsupportedFeatureError` | The request used a feature Inferrail doesn't support yet. | Remove the unsupported field (e.g. stream, n != 1) — see docs/PRODUCT.md's current scope. |
|
|
30
|
+
| <a id="inferrail_e007"></a>`INFERRAIL_E007` | `RoutingError` | The request's model field didn't match a configured route. | Use one of the route names under inferrail.yaml's routes: section, not a provider model id. |
|
|
31
|
+
| <a id="inferrail_e008"></a>`INFERRAIL_E008` | `ConfigurationError` | Inferrail's own configuration is missing, invalid, or unusable. | Run 'inferrail config check' for the specific validation error. |
|
|
32
|
+
| <a id="inferrail_e009"></a>`INFERRAIL_E009` | `ProviderError` | The upstream provider request failed for an unrecognized reason. | Check provider status; Inferrail retries automatically if the failure looks transient (5xx). |
|
inferrail-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
Copyright 2026 Inferrail contributors
|
|
179
|
+
|
|
180
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
181
|
+
you may not use this file except in compliance with the License.
|
|
182
|
+
You may obtain a copy of the License at
|
|
183
|
+
|
|
184
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
185
|
+
|
|
186
|
+
Unless required by applicable law or agreed to in writing, software
|
|
187
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
188
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
189
|
+
See the License for the specific language governing permissions and
|
|
190
|
+
limitations under the License.
|