Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build/
.idea/
.vscode/

# This is the repopack genared file that
# This is the repomix genared file that
# contains the whole repo content for
# submitting to AIs, like Claude
lumino-sdk-python.txt
Expand Down
6 changes: 4 additions & 2 deletions repopack.config.json → repomix.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@
"showLineNumbers": false,
"topFilesLength": 0
},
"include": ["**/*"],
"include": [
"**/*"
],
"ignore": {
"useGitignore": true,
"useDefaultPatterns": true
}
}
}
14 changes: 14 additions & 0 deletions src/lumino/fine_tuning.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,17 @@ async def cancel_fine_tuning_job(self, job_name: str) -> FineTuningJobDetailResp
self.logger.info("Cancelling fine-tuning job: %s", job_name)
data = await self._sdk._request("POST", f"/fine-tuning/{job_name}/cancel")
return FineTuningJobDetailResponse(**data)

async def delete_fine_tuning_job(self, job_name: str) -> None:
"""
Delete a fine-tuning job.

Args:
job_name (str): The name of the fine-tuning job to delete.

Raises:
LuminoAPIError: If the API request fails.
"""
self.logger.info("Deleting fine-tuning job: %s", job_name)
await self._sdk._request("DELETE", f"/fine-tuning/{job_name}")
self.logger.info("Deleted fine-tuning job: %s", job_name)
19 changes: 16 additions & 3 deletions src/lumino/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class FineTuningJobStatus(str, Enum):
STOPPED = "STOPPED" # Job has been stopped by the user or system
COMPLETED = "COMPLETED" # Job has completed successfully
FAILED = "FAILED" # Job has failed to complete
DELETED = "DELETED" # Job has been marked as deleted


class FineTuningJobType(str, Enum):
Expand Down Expand Up @@ -79,16 +80,24 @@ class BillingTransactionType(str, Enum):
STRIPE_CHECKOUT = "STRIPE_CHECKOUT"


# Enumeration for compute providers
class FineTunedModelStatus(str, Enum):
"""Enum of possible fine-tuned model statuses."""
ACTIVE = "ACTIVE"
DELETED = "DELETED"


class ComputeProvider(str, Enum):
"""Enum of possible compute providers."""
GCP = "GCP"
LUM = "LUM"


class BaseModel(_BaseModel):
"""Base model for all models."""

def __repr__(self):
return self.__str__()

def __str__(self):
return self.model_dump_json(indent=2)

Expand Down Expand Up @@ -269,7 +278,8 @@ class FineTuningJobDetailResponse(FineTuningJobResponse):
"""
parameters: Dict[str, Any] = Field(..., description="The parameters used for the fine-tuning job")
metrics: Dict[str, Any] | None = Field(None, description="The metrics collected during the fine-tuning process")
timestamps: Dict[str, Any] | None = Field(None, description="The timestamps recorded during the fine-tuning process")
timestamps: Dict[str, Any] | None = Field(None,
description="The timestamps recorded during the fine-tuning process")
model_config = ConfigDict(from_attributes=True)


Expand All @@ -292,9 +302,12 @@ class FineTunedModelResponse(BaseModel):
"""
id: UUID = Field(..., description="The unique identifier of the fine-tuned model")
created_at: DateTime = Field(..., description="The timestamp when the fine-tuned model was created")
updated_at: DateTime = Field(..., description="The timestamp when the fine-tuned model was last updated")
fine_tuning_job_name: str = Field(..., description="The name of the associated fine-tuning job")
status: FineTunedModelStatus = Field(..., description="The current status of the fine-tuned model")
name: str = Field(..., description="The name of the fine-tuned model")
artifacts: Dict[str, Any] | None = Field(None, description="Additional artifacts associated with the fine-tuned model")
artifacts: Dict[str, Any] | None = Field(None,
description="Additional artifacts associated with the fine-tuned model")
model_config = ConfigDict(from_attributes=True)


Expand Down
Loading