AxiomAi.EnvironmentManager (AxiomAI v0.1.11)

View Source

Environment Manager for handling different Python environments for various AI models.

This module provides functionality to create, manage, and switch between different Python environments tailored for specific AI model categories.

Summary

Functions

Check if an environment is loaded and ready.

Execute code in a specific environment.

Get environment information for a specific category.

Get the list of available model environments.

Load environment dependencies for a specific model category.

Remove an environment configuration.

Functions

create_environment(category, dependencies, python_version \\ "3.10")

Create a new environment configuration.

Parameters

  • category: Model category
  • dependencies: List of Python dependencies
  • python_version: Python version (optional)

Returns

  • :ok on success
  • {:error, reason} on failure

environment_loaded?(category)

Check if an environment is loaded and ready.

Parameters

  • category: Model category

Returns

  • true if environment is loaded
  • false if not loaded

execute_in_environment(category, code, auto_load \\ true)

Execute code in a specific environment.

Parameters

  • category: Model category
  • code: Python code to execute
  • auto_load: Whether to auto-load environment if not loaded (default: true)

Returns

  • {:ok, result} on success
  • {:error, reason} on failure

get_environment_info(category)

Get environment information for a specific category.

Parameters

  • category: Model category

Returns

  • {:ok, info} with environment information
  • {:error, reason} on failure

list_environments()

Get the list of available model environments.

Returns

  • List of available environment categories

load_environment(category, force_reload \\ false)

Load environment dependencies for a specific model category.

Parameters

  • category: Model category (e.g., :qwen, :llama, :whisper, :vision, :embeddings)
  • force_reload: Whether to force reload the environment (default: false)

Returns

  • {:ok, deps} with list of dependencies
  • {:error, reason} on failure

remove_environment(category)

Remove an environment configuration.

Parameters

  • category: Model category to remove

Returns

  • :ok on success
  • {:error, reason} on failure