Fount Workflow

Overview

Fount SDK is a Python client library for the Fount machine learning platform. It provides a high-level interface for:

  • Dataset Management: Upload and manage datasets from pandas DataFrames, CSV files, or Excel files
  • Model Training: Train time-series and traditional ML models with customizable parameters
  • Hyperparameter Tuning: Optimize model performance through automated parameter search
  • Batch Inference: Run predictions on large datasets efficiently
  • Job Management: Monitor and control long-running ML operations

Workflow

  1. Install fount-core
    pip install fount-core
  2. Set your API key as an environment variable
    export FOUNT_API_KEY="your-api-key-here"
    
  3. Initialise Client
    from fount import Fount
    client = Fount()
  4. Upload Dataset
    # From DataFrame
    dataset = client.upload_dataframe(df, name="my_dataset")
    
    # From CSV
    dataset = client.upload_csv("data.csv", name="csv_dataset")
    
    # From Excel
    dataset = client.upload_excel("data.xlsx", sheet_name="Sheet1", name="excel_data")
  5. Train a Model
    job = client.train(
        dataset=dataset,
        model_name="my_model",
        series_id_cols=["ProductCategory", "Region"],
        categorical_cols=["ProductCategory", "Region", "Year"],
        date_column="date",
        target_columns=["sales"],
        validation_data_required=True,
        validation_split=0.2,
        time_granularity="daily"
    )
  6. Execute & Monitor a job
    # Synchronous
    job.run(wait=True, poll_interval=30)
    
    # Asynchronous
    job.run(wait=False)
    
    # Check status
    status = job.status()
    print(f"Status: {status['status']}")
  7. Run inference
    inference_job = client.inference(
        dataset=dataset,
        model_name="my_model",
        batch_size=1000
    )
    
    # Synchronous
    inference_job.run(wait=True, poll_interval=30)
    
    # Asynchronous
    inference_job.run(wait=False)
    
    # Check status
    status = inference_job.status()
    print(f"Status: {status['status']}")
  8. Tune a model
    tuning_job = client.tune(
        dataset=dataset,
        model_name="my_tuned_model",
        series_id_cols=["ProductCategory", "Region"],
        categorical_cols=["ProductCategory", "Region", "Year"],
        date_column="date",
        target_columns=["sales"],
        validation_data_required=True,
        validation_split=0.2,
        time_granularity="daily"
    )
    
    # Synchronous
    tuning_job.run(wait=True, poll_interval=30)
    
    # Asynchronous
    tuning_job.run(wait=False)
    
    # Check status
    status = tuning_job.status()
    print(f"Status: {status['status']}")
  9. Run Inference on tuned model
    inference_job_on_tuned_model = client.inference(
        dataset=dataset,
        model_name="my_tuned_model",
        batch_size=1000
    )
    
    # Synchronous
    inference_job_on_tuned_model.run(wait=True, poll_interval=30)
    
    # Asynchronous
    inference_job_on_tuned_model.run(wait=False)
    
    # Check status
    status = inference_job_on_tuned_model.status()
    print(f"Status: {status['status']}")
  10. Retrieve results
    # Get metrics
    metrics = job.metrics()
    
    # Get predictions
    predictions = job.predictions()
    
    # Stop job if needed
    job.stop()
  11. Manage jobs and datasets
    # List all datasets
    datasets = client.get_all_datasets()
    
    # List all models
    models = client.get_all_models()
    
    # List all training jobs
    training_jobs = client.get_all_training_jobs()
    
    # List all inference jobs
    inference_jobs = client.get_all_inference_jobs()
    
    # List all tuning jobs
    tuning_jobs = client.get_all_tuning_jobs()

Troubleshooting

Authentication Errors

FOUNT_API_KEY not set / 401 Unauthorized / Invalid API key

The SDK cannot authenticate. The API key was not passed and the FOUNT_API_KEY environment variable is missing, invalid, expired, or has extra spaces.

Fix:

import os
os.environ["FOUNT_API_KEY"] = "your_api_key_here"
client = Fount()

Check: os.environ.get("FOUNT_API_KEY") must return a non-empty string before calling Fount().

403 Forbidden / Project not found / You do not have access to this project

Authentication succeeded but the API key does not have access to the target Fount workspace or project.

Fix: Use the API key that belongs to the correct Fount project, or request access to the intended project. Confirm the key owner and project before running dataset upload, training, tuning, or inference.

Connection Errors

ConnectionError / Max retries exceeded / Read timed out

The notebook or script cannot reach the Fount API within the timeout window.

Common causes: unstable network, blocked VPN/proxy, or retrying a large request with too low a timeout.

Fix: Check your internet/VPN connection, retry the request, and avoid re-submitting large jobs until the previous request state is clear. Test with a light call first:

datasets = client.get_all_datasets()
print(datasets)

Dataset Reference Errors

Dataset not found / 404 / NoneType object has no attribute 'id'

The dataset reference passed to train(), tune(), or inference() is invalid or empty.

Common causes: reusing an old dataset id from another project, or proceeding after upload returned None.

Fix:

# List all available datasets and pick the correct one
datasets = client.get_all_datasets()
print(datasets)

# Or re-upload and use the returned object directly
dataset = client.upload_dataframe(df, name="my_dataset")
print(dataset.id)  # confirm it is not None before proceeding