Skip to main content

AI Mesh

This example combines AI Foundation and Mesh Foundation. A lightweight node discovers a more powerful node on the network and sends an inference request to it, using the remote node's model instead of running one locally.

Prerequisites

RoleDescription
Node A (your machine)The machine you're running commands from
Node B (remote)Another machine with a model loaded (e.g., smollm2-360m)
info

Both the ai-foundation and mesh-foundation addons are pre-installed with mimOE. No additional setup is needed beyond loading a model on Node B.

Step 1: Discover the Remote Node

From Node A, find other mimOE nodes on your network:

curl -X GET "http://localhost:8083/mimik-mesh/insight/v1/nodes?type=linkLocal" \
-H "Authorization: Bearer $API_KEY"

Response

{
"data": [
{
"id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
"name": "Workstation",
"os": "linux",
"addresses": [
{
"type": "local",
"url": { "href": "http://192.168.1.101:8083" }
}
],
"services": []
}
]
}

Note the remote node's address: http://192.168.1.101:8083.

Step 2: Call Inference on the Remote Node

Use the discovered address to call Node B's AI Foundation inference API directly:

curl -X POST "http://192.168.1.101:8083/mimik-ai/openai/v1/chat/completions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer 1234" \
-d '{
"model": "smollm2-360m",
"messages": [{"role": "user", "content": "What are the benefits of on-device AI?"}]
}'

You just ran inference on a remote node, discovered through the local mesh, without any cloud services.

What Just Happened?

  1. Node A used the Mesh Foundation Insight API to discover Node B on the local network
  2. Node A called Node B's AI Foundation inference API directly using the discovered address
  3. Node B ran the model and returned the response
  4. All communication happened over the local network with no cloud involved

Why This Matters

  • No model needed locally: Node A doesn't need to download or load any model
  • Use the best hardware: Route inference to the node with a GPU or more RAM
  • Zero configuration: Both nodes found each other automatically via link-local discovery
  • Direct communication: The request went straight to Node B, no relay or cloud involved
  • Standard APIs: Uses the same OpenAI-compatible API, just at a different address

Going Further

This example uses link-local discovery (same network). To reach nodes on different networks:

For building custom AI agents with pre/post processing logic:

  • AI Development: Build agents with tool use and multi-agent collaboration