I have code that uses AssemblyAI and Caretesia. I ...
# ask-ai
a
I have code that uses AssemblyAI and Caretesia. I was reviewing the HIPAA policies and wanted to confirm that we do not need a separate BAA for using these services. I did have to set up an account with Cartesia and AssemblyAI to get an API key for use. Does this mean I will also need a separate BAA with those services to make phone calls that contain PHI? I already have a BAA in place with LiveKit.
Copy code
return AgentSession(
    stt=assemblyai.STT(),
    llm=openai.LLM(model="gpt-4.1-mini"),
    tts=cartesia.TTS(
        model="sonic-3", voice="9626c31c-bec5-4cca-baa8-f8ba9e84c8bc"
    ),
    vad=silero.VAD.load(),
    turn_detection=MultilingualModel(),
)
t
Thanks for reaching out, Nick. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — you're asking whether your existing BAA with LiveKit covers using AssemblyAI and Cartesia with your own API keys for calls that contain PHI. Good question. Short answer: You need separate BAAs with AssemblyAI and Cartesia if you send PHI to them using your own accounts/API keys. Why: • Your code shows you’re calling
assemblyai.STT()
and
cartesia.TTS()
with provider keys, which means you are a direct customer of those vendors and send data to them. • LiveKit’s BAA covers HIPAA-eligible use only when those models are used via LiveKit Inference (where LiveKit manages the inference provider relationships). • If you send PHI directly to third-party providers, you must have a BAA with each provider that processes PHI on your behalf. What you can do next: • Ask AssemblyAI and Cartesia whether they will sign a BAA and offer HIPAA-compliant processing. • If they do not, switch to using those models via LiveKit Inference (e.g.,
assemblyai/universal-streaming
,
cartesia/sonic-3
) so the usage falls under LiveKit’s HIPAA coverage. Would you like wording to request a BAA from those vendors or steps to switch your code to use LiveKit Inference? Sources: Cartesia TTS plugin guide | LiveKit docs | Cartesia STT plugin guide | LiveKit Docs | HIPAA Eligible Products and Services | LiveKit | LiveKit | AssemblyAI STT | LiveKit Docs
a
Could you give an example of how to use the LiveKit Inference in python?
t
You're asking for a Python example showing how to use LiveKit Inference so your app can use models (STT/LLM/TTS) through LiveKit's managed service. Below is a concise example using the AgentSession approach.
Copy code
# Example: LiveKit Inference in Python (async)
from livekit.agents import AgentSession, Agent

async def run_agent(room_name, livekit_api_key, livekit_api_secret):
    # Configure models by model-id strings (LiveKit will handle provider access)
    session = AgentSession(
        stt="assemblyai/universal-streaming:en",          # speech-to-text via LiveKit Inference
        llm="openai/gpt-4.1-mini",                        # LLM via LiveKit Inference
        tts="cartesia/sonic-3:9626c31c-bec5-4cca-baa8-f8ba9e84c8bc",  # TTS via LiveKit Inference
        vad="silero-vad",                                 # VAD model identifier
    )

    agent = Agent(instructions="You are a helpful voice AI assistant.")

    # Start the agent in a room (provide your room context as appropriate)
    await session.start(room=room_name, agent=agent)

    # session runs and handles audio <-> models until stopped
    # To stop:
    # await session.stop()
Notes: • Using model strings like
"assemblyai/universal-streaming:en"
and
"cartesia/sonic-3:..."
routes inference through LiveKit so the LiveKit BAA covers the sub-processor relationships. • Replace
room_name
, and provide your LiveKit auth/context according to your integration (token/credentials) when creating/joining the room in your app. • Ask if you want a version showing explicit room token generation, sync/async examples, or options for custom parameters to the models. Sources: Building voice agents | LiveKit Docs | Speech-to-text (STT) models | LiveKit Docs
a
@refined-appointment-81829, could you corroborate what the AI agent has told us here? Since understanding this is essential for our compliance we would like to be certain this explanation is correct.
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!