Documentation Index
Fetch the complete documentation index at: https://docs.galileo.ai/llms.txt
Use this file to discover all available pages before exploring further.
Project
Object-centric interface for Galileo projects.
This class provides an intuitive way to work with Galileo projects,
encapsulating project management operations and providing seamless
integration with log stream management.
Examples
# Create a new project locally, then persist
project = Project(name="My AI Project").create()
# Get an existing project
project = Project.get(name="My AI Project")
# List all projects
projects = Project.list()
# Create a log stream for the project
log_stream = project.create_log_stream(name="Production Logs")
# List log streams for the project
log_streams = project.list_log_streams()
# Access related resources via properties
for log_stream in project.logstreams:
print(log_stream.name)
for experiment in project.experiments:
print(experiment.name)
for dataset in project.datasets:
print(dataset.name)
for prompt in project.prompts:
print(prompt.name)
# Or use the explicit list methods
datasets = project.list_datasets()
prompts = project.list_prompts()
# Manage collaborators
for collab in project.collaborators:
print(f"{collab.email}: {collab.role}")
# Add a collaborator
project.add_collaborator(user_id="user-123", role=CollaboratorRole.EDITOR)
# Update a collaborator's role
project.update_collaborator(user_id="user-123", role=CollaboratorRole.VIEWER)
# Remove a collaborator
project.remove_collaborator(user_id="user-123")
# Delete a project (WARNING: cannot be undone!)
old_project = Project.get(name="Old Project")
old_project.delete()
add_collaborator
def add_collaborator(self,
user_id: str,
role: CollaboratorRole=CollaboratorRole.VIEWER) -> Collaborator
Add a collaborator to this project.
Shares the project with a user, granting them access with the specified role.
Arguments
user_id: The ID of the user to add as a collaborator.
role: The role to assign. One of CollaboratorRole.OWNER, EDITOR, VIEWER, or ANNOTATOR.
Defaults to VIEWER.
collaborators
def collaborators(self) -> builtins.list[Collaborator]
Property to access collaborators for this project.
Returns users who have access to this project. Each Collaborator object
has update() and remove() methods for modifying access. You can also
use add_collaborator() on the project to add new collaborators.
.. note::
This property makes an API call on every access and is not cached.
Examples
project = Project.get(name="My AI Project")
for collab in project.collaborators:
print(f"{collab.email}: {collab.role}")
# Filter by role
editors = [c for c in project.collaborators if c.role == CollaboratorRole.EDITOR]
# Update or remove directly on the collaborator object
collab.update(role=CollaboratorRole.EDITOR)
collab.remove()
create
def create(self) -> Project
Persist this project to the API.
Examples
project = Project(name="My AI Project").create()
assert project.is_synced()
create_log_stream
def create_log_stream(self, name: str) -> LogStream
Create a new log stream for this project.
Arguments
name (str): The name of the log stream to create.
datasets
def datasets(self) -> builtins.list[Dataset]
Property to access datasets used in this project.
This is a read-only property that returns the datasets associated with this project.
Examples
project = Project.get(name="My AI Project")
for dataset in project.datasets:
print(dataset.name)
delete
Delete this project.
This is a destructive operation that permanently removes the project
and all associated data (experiments, log streams, datasets, traces, etc.)
from the API.
WARNING: This operation cannot be undone!
After successful deletion, the object state is set to DELETED. The local
object still exists in memory but no longer represents a remote resource.
Examples
# Delete a project
project = Project.get(name="Old Project")
project.delete()
assert project.is_deleted()
# After deletion, the project no longer exists remotely
# The local object is marked as DELETED
print(project.sync_state) # SyncState.DELETED
experiments
def experiments(self) -> builtins.list[Experiment]
Property to access experiments for this project.
This is a read-only property that returns the current list of experiments.
Examples
project = Project.get(name="My AI Project")
for exp in project.experiments:
print(exp.name)
get
def get(cls, *, id: str | None=None, name: str | None=None) -> Project | None
Get an existing project by ID or name.
Arguments
id (Optional[str]): The project ID.
name (Optional[str]): The project name.
list
def list(cls) -> builtins.list[Project]
List all available projects.
Examples
projects = Project.list()
for project in projects:
# Process each project
pass
list_collaborators
def list_collaborators(self) -> builtins.list[Collaborator]
List all collaborators for this project.
Returns a list of Collaborator objects representing users who have
access to this project, along with their roles and permissions.
Examples
project = Project.get(name="My AI Project")
collaborators = project.list_collaborators()
for collab in collaborators:
print(f"{collab.email}: {collab.role}")
list_datasets
def list_datasets(self) -> builtins.list[Dataset]
List all datasets used in this project.
Examples
project = Project.get(name="My AI Project")
datasets = project.list_datasets()
for dataset in datasets:
# Process each dataset
pass
list_experiments
def list_experiments(self) -> builtins.list[Experiment]
List all experiments for this project.
Examples
project = Project.get(name="My AI Project")
experiments = project.list_experiments()
for exp in experiments:
# Process each experiment
pass
list_log_streams
def list_log_streams(self,
*,
limit: Unset | int=100,
starting_token: Unset | int=0) -> builtins.list[LogStream]
List log streams for this project.
Returns a single page of results. Use starting_token (from
next_starting_token on a prior response) to fetch subsequent pages.
Arguments
limit (Union[Unset, int]): Maximum number of log streams to return per page. Defaults to 100.
starting_token (Union[Unset, int]): Pagination token to start from. Defaults to 0 (first page).
list_prompts
def list_prompts(self) -> builtins.list[Prompt]
List all prompts used in this project.
Examples
project = Project.get(name="My AI Project")
prompts = project.list_prompts()
for prompt in prompts:
# Process each prompt
pass
logstreams
def logstreams(self) -> builtins.list[LogStream]
Property to access log streams for this project.
This is a read-only property that returns the current list of log streams.
To create new log streams, use create_log_stream().
Examples
project = Project.get(name="My AI Project")
for stream in project.logstreams:
print(stream.name)
prompts
def prompts(self) -> builtins.list[Prompt]
Property to access prompts used in this project.
This is a read-only property that returns the prompts associated with this project.
Examples
project = Project.get(name="My AI Project")
for prompt in project.prompts:
print(prompt.name)
refresh
def refresh(self) -> None
Refresh this project’s state from the API.
Updates all attributes with the latest values from the remote API
and sets the state to SYNCED.
Examples
project.refresh()
assert project.is_synced()
remove_collaborator
def remove_collaborator(self, user_id: str) -> None
Remove a collaborator from this project.
Revokes a user’s access to this project. The user will no longer be able
to view or interact with the project.
Arguments
user_id: The ID of the user to remove.
save
def save(self) -> Project
Save changes to this project.
Persists any local changes (name, type) to the remote API. If the project
is LOCAL_ONLY, delegates to create(). If SYNCED, returns immediately as a
no-op. Raises ValueError for DELETED or FAILED_SYNC states.
.. note::
ProjectUpdate also supports description, labels, and created_by,
but these are not exposed as tracked attributes on the domain object because the
read endpoints (get/list) do not return them consistently. created_by is
server-managed.
If the project is in FAILED_SYNC state (from a prior failed operation), this
method raises ValueError. Call :meth:refresh first to re-sync, then retry.
Examples
# Create a new project
project = Project(name="My Project")
project.save()
# Update an existing project's name via dirty-tracking
project = Project.get(name="My Project")
project.name = "Renamed Project" # automatically marks DIRTY
project.save()
update_collaborator
def update_collaborator(self, user_id: str, role: CollaboratorRole) -> Collaborator
Update a collaborator’s role on this project.
Changes the role of an existing collaborator. The user must already
have access to the project.
Arguments
user_id: The ID of the user whose role to update.
role: The new role to assign. One of CollaboratorRole.OWNER, EDITOR, VIEWER, or ANNOTATOR.