Backend: Data Source
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The LLaMa Leaks project's frontend is powered by a static data source that provides information about publicly exposed Ollama AI servers. The core of this data architecture is a pre-generated JSON file, /data/live_servers.json, which the frontend application fetches to display evidence of insecure servers. This approach simplifies the architecture, as the frontend does not interact with a live, dynamic backend API but rather consumes a snapshot of server data.
The purpose of this data is purely educational: to raise security awareness by showing real-world examples of unintentionally exposed AI infrastructure. The data is sanitized and presented to help developers understand the risks without revealing sensitive information or encouraging malicious activity.
Sources: frontend/src/components/Hero.tsx:44-58, frontend/src/pages/About.tsx:43-49, README.md:5-12
Architecture Overview
The data flow is a simple, one-way process from a static file to the client-side application. The backend process that generates this file is not detailed in the frontend source, but the frontend's consumption pattern is clear. The frontend application fetches the live_servers.json file, selects a random server entry from the dataset, and renders its details in various components.
This diagram illustrates the high-level data flow for the frontend.
Data Source: live_servers.json
The single source of truth for the frontend application is the live_servers.json file. This file contains an object where each value is a detailed record of an exposed server.
Data Schema
The structure of each server record is defined by the ServerData TypeScript interface found in the frontend components. It includes network details, geographic location, server version, and lists of AI models.
The following diagram shows the entity relationship for the server data.
ServerData Interface
The ServerData interface defines the structure for each server entry within the JSON file.
// Source: frontend/src/components/Hero.tsx:16-31
interface ServerData {
ip: string;
port: number;
version: string;
city: string;
country: string;
country_name: string;
region: string;
latitude: string;
longitude: string;
local: ServerModel[];
running: ServerModel[];
first_seen_online: string;
last_observed: string;
age: string;
status: string;
}
The table below details each field in the ServerData object.
| Field | Type | Description |
|---|---|---|
ip | string | The masked IP address of the exposed server. |
port | number | The port number the Ollama service is running on. |
version | string | The version of the Ollama server software. |
city | string | The city where the server is located. |
country | string | The two-letter country code (e.g., 'US'). |
country_name | string | The full country name (e.g., 'United States'). |
region | string | The region or state where the server is located. |
latitude | string | The geographic latitude of the server. |
longitude | string | The geographic longitude of the server. |
local | ServerModel[] | An array of AI models available locally on the server. |
running | ServerModel[] | An array of AI models currently running in memory. |
first_seen_online | string | ISO timestamp of when the server was first observed. |
last_observed | string | ISO timestamp of when the server was last observed. |
age | string | A human-readable string representing how long the server has been observed (e.g., "2 hours ago"). |
status | string | The current status of the server, such as 'live'. |
Sources: frontend/src/components/Hero.tsx:16-31, frontend/src/components/LocationInfo.tsx:8-23
Data Consumption
The frontend components Hero.tsx and LocationInfo.tsx are responsible for fetching, processing, and displaying the server data.
Fetching Logic
Both components implement an asynchronous function fetchRandomServer that retrieves the live_servers.json file. Upon a successful fetch, it parses the JSON, converts the top-level object into an array of server entries, and selects one at random to display. This ensures that each page load or refresh presents a different example to the user.
This sequence diagram shows the process of the frontend fetching and displaying server data.
Data Presentation
Once a random server's data is loaded into the component's state, it is rendered in the UI. This includes:
- Displaying the server's location on a map.
- Showing the masked IP address, port, and version.
- Listing the available and running AI models.
- Indicating the server's online status and how long it has been observed.
The project's main goal is to highlight the security risks of such exposed servers, and the UI is designed to make this information clear and impactful.
Sources: frontend/src/components/Hero.tsx, frontend/src/components/LocationInfo.tsx, frontend/src/components/Solutions.tsx
Conclusion
The data source for the LLaMa Leaks frontend is a static live_servers.json file, which represents a snapshot of passively monitored, exposed Ollama servers. This design choice creates a simple and performant frontend that effectively serves its educational purpose: demonstrating the prevalence of insecure AI deployments. The data schema is comprehensive enough to provide compelling evidence, including location, server version, and model details, which are consumed and displayed by the React components to raise security awareness among developers.
Sources: README.md, frontend/index.html:6