> This page is for SDKs, version Legacy.
> For other versions, use one of these documentation indexes:
> - Current (default): https://buildwithfern.com/learn/sdks/current/llms.txt
> - Legacy: https://buildwithfern.com/learn/sdks/legacy/llms.txt

> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

# Project structure

> Learn how to structure your SDK project with Fern. Set up multi-repo architecture, configure generators.yml, and organize API definitions.

> **You're viewing the legacy SDK docs**
>
> These pages cover SDK generation configured with `generators.yml`. New projects use `sdk-config.yml`, so see [the Current version of this page](/learn/sdks/overview/project-structure) for up-to-date guidance. To move an existing project, follow the [SDK Config migration guide](/learn/sdks/legacy/generators/migration-guides/sdk-config), which walks through `fern sdk migrate`, and review the [`sdk-config.yml` reference](/learn/sdks/reference/sdk-config).

Before generating SDKs with Fern, set up the proper GitHub repository structure to house your API definitions and SDK code so it's intuitive for you and your users to access, maintain, and update code.

## Repository architecture

Fern recommends a multi-repository structure containing:

* **Source repository** with your API definitions and SDK generation configuration
* **SDK repositories** for each SDK (TypeScript, Python, Go, etc.)

This separation allows you to manage API definitions centrally while keeping each SDK in its own repository for independent versioning and distribution.

> **Examples**
>
> See Cohere's [fern folder](https://github.com/cohere-ai/cohere-developer-experience/tree/23d6c541a01eb6b54dd9bb3588c805bb0e307713/fern) and [TypeScript](https://github.com/cohere-ai/cohere-typescript) and [Python](https://github.com/cohere-ai/cohere-python) SDK repositories.

## Core configuration files

The source repository contains a `fern/` folder  that is initialized with your API definitions and a top-level `generators.yml` file.

### `fern.config.json`

The `fern.config.json` file stores your organization name and the Fern CLI version. Pinning the version provides deterministic builds. To keep every project in your organization on a compatible version, set an [organization-wide CLI version policy](/learn/cli-api-reference/cli-reference/version-policy).

**`fern.config.json`**

```json title="fern.config.json"
{
  "organization": "plant-catalog",
  "version": "null"
}
```

> **Info**
>
> When working with a locally installed CLI, set `version` to `"*"`. See [Install Fern CLI locally](/learn/cli-api-reference/cli-reference/overview#installation) for details.

### `generators.yml`

The `generators.yml` file declares your API spec location in the `api.specs` section and configures SDK generation in the `groups` section.

**`generators.yml`**

```yaml title="generators.yml"
# API declaration
api:
  specs:
    - openapi: ./openapi/openapi.yml

# SDK generation
groups:
  ts-sdk:
    generators:
      - name: fern-typescript-sdk
        version: 3.107.3
        github:
          repository: your-organization/typescript-sdk-repo

  python-sdk:
    generators:
      - name: fern-python-sdk
        version: 5.41.4
        github:
          repository: your-organization/python-sdk-repo
```

> **Examples**
>
> See Cohere's [`generators.yml` file](https://github.com/cohere-ai/cohere-developer-experience/blob/23d6c541a01eb6b54dd9bb3588c805bb0e307713/fern/apis/sdks/generators.yml) and Vapi's [`generators.yml` file](https://github.com/VapiAI/docs/blob/9c674c2b16ba03e864e26673c5290c88048c9a7a/fern/apis/api/generators.yml).

The `github` property targets GitHub repositories only — Fern doesn't push SDKs to GitLab or other providers. The [`generators.yml` reference page](/learn/sdks/legacy/reference/generators-yml) covers complete configuration options, including self-hosted generation for other targets.

### API definition file

See [Project structure (API Definitions)](/learn/api-definitions/overview/project-structure) for details on organizing your API definition files and working with multiple APIs.