Skip to main content

Project Structure

A Telepath Project is made up of declarative code files that define the Resources that should be created.

There are only two required files in every Telepath Project:

  • telepath.yml - A configuration file that defines the Project and other settings
  • Resources Entrypoint (index.ts) - The entrypoint file that declares a Project's Resources.

telepath.yml

Every Project must contain a YAML config file that defines the Project ID and settings.

Telepath expects this file to be named telepath.yml and be located in your Project's root directory.

Example of a complete file:

telepath.yml
project:
id: my-project # ID of Telepath project (created in UI or CLI)
runtime: typescript # "typescript" or "nodejs"

# Optional
entrypoint: index.ts # Optional. Relative path to the project resources file

Resources Entrypoint

Every Project must have a single entrypoint file that declares the Project's Resources.

Telepath expects this file to be named index.ts (or index.js if you're using the nodejs runtime) and to be located in the same directory as your telepath.yml file. The entrypoint filename and location may be changed, if you update the entrypoint property in the telepath.yml file.

The entrypoint declares resources by constructing them from the @telepath/telepath SDK library.

Example:

index.ts
// Telepath SDK library
import { Source, Pipeline, ModelSpec } from '@telepath/telepath'

// Declare Resources
// These are non-working examples. See `Resources` docs for real examples.
const source = new Source('my-source', { ... });

const pipeline = new Pipeline('my-pipeline', { ... });

const modelSpec = new ModelSpec('my-model-spec', { ... });

Because the entrypoint file is “just code,” you can get creative in how you choose to compose it. For example, you can put declare all of your Resources in a single index file, or you may choose to split resources up into separate files and then import them all into a single entrypoint file.

Example of modularized Resource files:

source.ts
// Source is defined in a separate file
export const mySource = new Source('my-source', { ... });
pipeline.ts
// Pipeline is defined in a separate file
export const myPipeline = new Pipeline('my-pipeline', { ... });
index.ts
// The resources are all referenced from a single entrypoint file
import './source'
import './pipeline'