> 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.

# How SDKs work

> Understand Fern's SDK generation process. Cloud-based workflow transforms API specifications into production-ready client libraries automatically.

> **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/how-it-works) 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).

Fern combines your API specifications with generator configurations and custom code to produce SDKs in multiple languages. By default, SDK generation runs on Fern's managed cloud infrastructure.

Alternatively, [you can run SDK generation on your own infrastructure](/learn/sdks/legacy/deep-dives/self-hosted) to meet specific security or compliance requirements.

## Cloud generation workflow

Before generating SDKs, you'll configure your `fern/` folder with SDK generators specified in `generators.yml` and connect your API specification. You can also add custom code, tests, and other configuration as needed.

Running `fern generate` kicks off the cloud generation process and involves a few key steps:

#### Cloud execution

Fern allocates compute resources and pulls the appropriate Docker image for your specified generator version.

#### Generate core SDK

The Docker container executes the generation logic and produces your SDK's core files (models, client code, API methods).

#### Verify organization

Fern verifies your organization registration to ensure the complete SDK can be generated. Without organization verification, only partial SDK files (core code without package metadata) are produced.

#### Add package metadata

Fern completes the SDK by adding package distribution files such as `pyproject.toml`, `package.json`, README, and any dependencies.

#### Output to destination

Fern publishes or saves the complete SDK to your configured location (local filesystem, GitHub repository, package registry). After publication, developers can use your SDKs to integrate with your APIs.

#### Cloud generation sequence diagram

```mermaid
sequenceDiagram
    autonumber
    participant Dev as Developer
    participant Fern as Fern
    participant Docker as Docker container
    participant Dest as Output destination

    Dev->>Fern: fern generate
    Fern->>Fern: Allocate cloud compute
    Fern->>Docker: Pull & run generator image
    Docker->>Docker: Generate core SDK files
    Docker->>Fern: Return partial SDK
    Fern->>Fern: Verify organization
    Fern->>Fern: Add package metadata
    Fern->>Dest: Output complete SDK
```

#### Expanded architecture diagram

![SDK generation architecture diagram](/learn/_fern-img/7c1a93924212d280041c36db9a92009795bdd80874510285471fa6b3d80c5032.webp)

## Quotas

Cloud (remote) generation uses a [leaky bucket](https://en.wikipedia.org/wiki/Leaky_bucket) rate-limiting algorithm with the following default limits:

| Parameter      | Value                    |
| -------------- | ------------------------ |
| Burst capacity | 10 generations           |
| Refill rate    | 5 generations per minute |

You can run up to 10 generations in quick succession. Fern then replenishes your allowance at 5 generations per minute, so if you hit the limit, subsequent requests will be throttled until enough capacity is restored. In practice, this only affects automated workflows that trigger many generations in a tight loop — occasional manual runs won't come close to the limit.

> **Note**
>
> Rate limits apply only to cloud generation. [Local generation](/learn/sdks/legacy/deep-dives/self-hosted) using `--local` isn't subject to any quotas.

If your team needs higher quotas, contact [support@buildwithfern.com](mailto:support@buildwithfern.com).