Skip to main content

Overview

FireworksClient provides Fireworks platform operations that are independent of any running trainer job: checkpoint promotion, training shape resolution, and model validation. It is the base class for TrainerJobManager, which adds trainer job lifecycle methods. Use FireworksClient directly when you don’t need to create or manage trainer jobs — for example, promoting a checkpoint after the trainer has already been deleted, or resolving training shape configuration before deciding whether to launch a job.
from fireworks.training.sdk import FireworksClient

Constructor

client = FireworksClient(
    api_key="<FIREWORKS_API_KEY>",
    base_url="https://api.fireworks.ai",  # optional
)
ParameterTypeDefaultDescription
api_keystrFireworks API key
base_urlstr"https://api.fireworks.ai"Control-plane URL
additional_headersdict | NoneNoneExtra HTTP headers
verify_sslbool | NoneNoneSSL verification override

Methods

promote_checkpoint(job_id, checkpoint_id, output_model_id)

Promote a sampler checkpoint to a deployable Fireworks model. The trainer job does not need to be running — the job_id is used only to resolve the GCS bucket where the checkpoint files reside. The base model for metadata inheritance is automatically resolved from the trainer job’s training config.
model = client.promote_checkpoint(
    job_id="<job-id>",
    checkpoint_id="<snapshot-name>",
    output_model_id="my-fine-tuned-model",
)
print(f"Model state: {model['state']}, kind: {model['kind']}")
ParameterTypeDescription
job_idstrRLOR trainer job ID that produced the checkpoint
checkpoint_idstrThe snapshot_name from save_weights_for_sampler_ext
output_model_idstrDesired model ID (1-63 chars, lowercase a-z, 0-9, hyphen only)
Returns the model dict from the API (includes state, kind, peftDetails). See Saving and Loading for details.
The trainer job can be in any state (running, failed, cancelled, or deleted) as long as the checkpoint files still exist in GCS. Promotion is a file copy — it does not interact with the trainer process.

resolve_training_profile(shape_id)

Resolve a training shape ID into a full configuration profile:
shape_id = "accounts/fireworks/trainingShapes/ts-qwen3-8b-policy"
profile = client.resolve_training_profile(shape_id)
print(profile.accelerator_type)      # e.g. "NVIDIA_B200_192GB"
print(profile.trainer_image_tag)      # e.g. "0.0.0-dev-..."
print(profile.node_count)             # e.g. 1
print(profile.pipeline_parallelism)   # e.g. 1
See Training Shapes for the user-facing shape workflow.

validate_output_model_id(output_model_id)

Client-side validation helper for promote_checkpoint(..., output_model_id=...):
from fireworks.training.sdk import validate_output_model_id

errors = validate_output_model_id("my-fine-tuned-model")
if errors:
    raise ValueError("\n".join(errors))
Returns a list of formatted error strings. An empty list means the model ID is valid.

Relationship to TrainerJobManager

TrainerJobManager inherits from FireworksClient and adds trainer job lifecycle methods (create, wait_for_ready, delete, etc.). All FireworksClient methods are also available on TrainerJobManager. Use FireworksClient when you only need platform-level operations. Use TrainerJobManager when you also need to create and manage trainer jobs.
from fireworks.training.sdk import FireworksClient, TrainerJobManager

# Trainer-free: promote a checkpoint from a completed experiment
client = FireworksClient(api_key=api_key)
client.promote_checkpoint(job_id, checkpoint_id, "my-model")

# Full lifecycle: create trainer, train, promote
mgr = TrainerJobManager(api_key=api_key)
endpoint = mgr.create_and_wait(config)
# ... train ...
mgr.promote_checkpoint(job_id, checkpoint_id, "my-model")
mgr.delete(job_id)

TrainingShapeProfile

Returned by resolve_training_profile:
FieldTypeDescription
training_shape_versionstrResolved shape version
trainer_image_tagstrDocker image tag for the trainer
max_supported_context_lengthintMaximum supported context length
node_countintNumber of trainer nodes
deployment_shape_versionstrLinked deployment shape
deployment_image_tagstrDocker image tag for deployment
accelerator_typestrGPU type
accelerator_countintNumber of GPUs per node
base_model_weight_precisionstrModel weight precision
pipeline_parallelismintPipeline parallelism degree
training_shapestrTraining shape name (without /versions/... suffix)
deployment_shapestrDeployment shape name (without /versions/... suffix)