Skip to content

Commit ffcedcf

Browse files
authored
feat(ai): standardize /v1 API surface to OpenAI specs and sanitize srv/ai
1 parent fece67b commit ffcedcf

8 files changed

Lines changed: 44 additions & 49 deletions

File tree

srv/ai/mcp/config.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

usr/share/mios/ai/v1/context.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,10 @@
1-
{"project":"MiOS","version":"0.2.0","api_standard":"OpenAI","endpoints":{"chat":"/v1/chat/completions","embeddings":"/v1/embeddings","models":"/v1/models","mcp":"/v1/mcp"},"operational_invariants":["USR-OVER-ETC","STATELÉSS-VAR","BOOTC-LIFECYCLE"],"directory_map":{"immutable":"/usr","config":"/etc","state":"/var","ai_assets":"/usr/share/mios/ai/v1"}}
1+
{
2+
"project": "MiOS",
3+
"api_standard": "OpenAI",
4+
"version": "0.2.0",
5+
"endpoints": {
6+
"chat": "/v1/chat/completions",
7+
"models": "/v1/models",
8+
"system": "/v1/system"
9+
}
10+
}

usr/share/mios/ai/v1/models.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
22
"object": "list",
3-
"data": [],
4-
"documentation": "Native model discovery schema."
3+
"data": [
4+
{
5+
"id": "mi-os-7b",
6+
"object": "model",
7+
"created": 1777536280,
8+
"owned_by": "mios-system"
9+
}
10+
]
511
}

usr/share/mios/ai/v1/system.md

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,26 @@
1-
# MiOS Autonomous AgentSystem Specification (v0.2.0)
1+
# MiOS System SpecificationOpenAI Standard (v0.2.0)
22

3-
## 0. Authoritative Logic
4-
- **Primary SSOT**: `/usr/share/mios/INDEX.md`
5-
- **FS Layout**: FHS 3.0 / bootc-native
6-
- **Compliance**: Pure FOSS (Apache-2.0)
3+
## system_context
4+
{
5+
"name": "MiOS-Agent",
6+
"version": "0.2.0",
7+
"base_os": "Fedora 44 (Rawhide)",
8+
"immutable": true,
9+
"standards": ["FHS 3.0", "bootc", "OpenAI-v1"],
10+
"capabilities": ["VFIO", "KVM", "Podman", "GNOME"]
11+
}
712

8-
## 1. Capabilities & Scope
9-
- **Domain Expertise**: Fedora bootc, OCI image orchestration, ComposeFS, Quadlet/Podman.
10-
- **Hardware Integration**: VFIO/IOMMU, NVIDIA/AMD/Intel GPU compute, cgroup-v2.
11-
- **Protocol**: OpenAI-compatible REST API (`/v1`).
12-
- **Context Discovery**: MCP (Model Context Protocol) via `/usr/share/mios/ai/v1/mcp.json`.
13+
## operational_laws
14+
1. **USR-OVER-ETC**: /usr is the immutable source; /etc is for delta overrides.
15+
2. **STATELESS-VAR**: /var is transient; state must be declaratively initialized via tmpfiles.d.
16+
3. **ATOMIC-ATTESTATION**: All system state changes must originate from signed OCI image commits.
1317

14-
## 2. Technical Invariants (CORE)
15-
1. **USR-OVER-ETC**: Read-only `/usr` contains defaults; `/etc` contains overrides.
16-
2. **STATELÉSS-VAR**: `/var` is ephemeral; state must be declared in `tmpfiles.d`.
17-
3. **ATOMIC-ATTESTATION**: All system changes occur via cryptographically signed OCI image commits.
18+
## ai_interface
19+
MiOS exposes an OpenAI-compatible API surface at /v1.
20+
- `POST /v1/chat/completions`: Instructions and system interaction.
21+
- `GET /v1/models`: Available system-local and containerized models.
22+
- `GET /v1/mcp`: Model Context Protocol registry.
1823

19-
## 3. Operational Directives
20-
- **Output Format**: Structured, evidence-based, path-citing.
21-
- **Tooling**: Prioritize local CLI tools (`mios`, `bootc`, `podman`) over external APIs.
22-
- **Security**: Mandatory SELinux enforcement; no security bypass recommendations.
23-
24-
## 4. API Surface Surface
25-
| Path | Method | Interface | Source |
26-
|---|---|---|---|
27-
| `/v1/chat/completions` | POST | Instruction following | `system.md` |
28-
| `/v1/models` | GET | Inventory | `models.json` |
29-
| `/v1/mcp` | FS | Context Registry | `mcp.json` |
30-
31-
---
32-
*Generated Specification. Deployed to /usr/share/mios/ai/v1/system.md*
24+
## build_bootstrap
25+
MiOS can self-build from source:
26+
`sudo curl -fsSL https://raw.githubusercontent.com/MiOS-DEV/MiOS-bootstrap/main/build-mios.sh | sudo bash`

v1/chat/completions

Lines changed: 0 additions & 6 deletions
This file was deleted.

v1/chat/completions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../usr/share/mios/ai/v1/system.md

v1/context

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/usr/share/mios/ai/v1/context.json
1+
../usr/share/mios/ai/v1/context.json

v1/models

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/usr/share/mios/ai/v1/models.json
1+
../usr/share/mios/ai/v1/models.json

v1/system

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/usr/share/mios/ai/v1/system.md
1+
../usr/share/mios/ai/v1/system.md

0 commit comments

Comments
 (0)