Getting the following error with the following set...
# ask-ai
m
Getting the following error with the following setting in my agent.py:
Copy code
TypeError: STT.__init__() got an unexpected keyword argument 'model'
Copy code
stt=elevenlabs.STT(
            model="scribe_v2_realtime",
        ),
t
Thanks for reaching out, Varun. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — you're hitting this because the ElevenLabs
STT
constructor expects
model_id
, not
model
. Change your code to:
Copy code
stt = elevenlabs.STT(
    model_id="scribe_v2_realtime",
)
Also make sure the ElevenLabs plugin is installed and
ELEVEN_API_KEY
is set in your
.env
. Would you like me to check any other STT settings in your agent.py? Sources: ElevenLabs STT plugin guide | LiveKit docs
m
Still getting unexpected keywrod argument 'model_id'
t
Thanks — I’m responding about the STT constructor error. To narrow this down I need a couple quick details: 1. The exact import and STT initialization lines from your agent.py (paste the few lines). 2. Output of: ◦
pip show livekit-agents
◦
pip show livekit-plugins-elevenlabs
1. The full traceback (or at least the top 6–8 lines) showing where the TypeError is raised. Quick checklist while you grab those: • Ensure you import from the plugins package:
from livekit.plugins import elevenlabs
• If you installed via extras, confirm the installed versions above so I can tell which parameter (
model
vs
model_id
) your installed plugin expects. Send the snippet and pip/show outputs and I’ll tell you the exact fix. Sources: ElevenLabs STT plugin guide | LiveKit docs
m
Copy code
vivek@Viveks-MacBook-Air agent-starter-python % uv pip show livekit-agents
Name: livekit-agents
Version: 1.2.18
Location: /Users/vivek/Desktop/Personal/revspot/agent-starter-python/.venv/lib/python3.11/site-packages
Requires: aiohttp, av, certifi, click, colorama, docstring-parser, eval-type-backport, livekit, livekit-api, livekit-blingfire, livekit-protocol, nest-asyncio, numpy, openai, opentelemetry-api, opentelemetry-exporter-otlp, opentelemetry-sdk, prometheus-client, protobuf, psutil, pydantic, pyjwt, sounddevice, types-protobuf, typing-extensions, watchfiles
Required-by: agent-starter-python, livekit-plugins-cartesia, livekit-plugins-deepgram, livekit-plugins-elevenlabs, livekit-plugins-google, livekit-plugins-groq, livekit-plugins-openai, livekit-plugins-sarvam, livekit-plugins-silero, livekit-plugins-turn-detector
vivek@Viveks-MacBook-Air agent-starter-python % uv pip show livekit-plugins-elevenlabs
Name: livekit-plugins-elevenlabs
Version: 1.2.18
Location: /Users/vivek/Desktop/Personal/revspot/agent-starter-python/.venv/lib/python3.11/site-packages
Requires: livekit-agents
Required-by:
t
Thanks — I’m following up about the continuing TypeError. Your package versions look aligned (both 1.2.18), so next I need the exact code and traceback to pinpoint why the constructor rejects both
model
and
model_id
. Please paste: 1. The import line(s) and the STT initialization lines from your agent.py (3–8 lines). 2. The top ~8 lines of the full traceback that show where the TypeError is raised. If you prefer, paste the entire small file and traceback and I’ll inspect for conflicting imports or wrapper code that might be changing the STT signature.
m
Copy code
2025-12-06 13:14:27,771 - ERROR livekit.agents - unhandled exception while running the job task
Traceback (most recent call last):
  File "/Users/vivek/Desktop/Personal/revspot/agent-starter-python/.venv/lib/python3.11/site-packages/opentelemetry/util/_decorator.py", line 71, in async_wrapper
    return await func(*args, **kwargs)  # type: ignore
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/vivek/Desktop/Personal/revspot/agent-starter-python/.venv/lib/python3.11/site-packages/livekit/agents/ipc/job_proc_lazy_main.py", line 240, in _traceable_entrypoint
    await self._job_entrypoint_fnc(job_ctx)
  File "/Users/vivek/Desktop/Personal/revspot/agent-starter-python/src/agent.py", line 170, in entrypoint
    stt=elevenlabs.STT(
        ^^^^^^^^^^^^^^^
TypeError: STT.__init__() got an unexpected keyword argument 'model_id' {"room": "playground-fSK1-9d66", "pid": 65233, "job_id": "AJ_dAR6kSfyoWLd"}



session = AgentSession(
    #     # A Large Language Model (LLM) is your agent's brain, processing user input and generating a response
    #     # See all providers at https://docs.livekit.io/agents/integrations/llm/
    #     # llm=openai.LLM(model="gpt-4o-mini"),
        # llm=google.LLM(
        #     model="gemini-2.5-flash",
        #     temperature=0.0
        # ),
        llm=groq.LLM(
            model="openai/gpt-oss-120b",
            temperature=0.2,
        ),
    #     # Speech-to-text (STT) is your agent's ears, turning the user's speech into text that the LLM can understand
    #     # See all providers at https://docs.livekit.io/agents/integrations/stt/
        # stt=deepgram.STT(
        #     model="nova-3",
        #     language="en-IN",
        # ),
        stt=elevenlabs.STT(
            model_id="scribe_v2_realtime",
        ),
t
Thanks — I see the traceback and your STT init. You're using version 1.2.18 of both packages, and that version expects the parameter name
model
(not
model_id
). Change this:
Copy code
stt=elevenlabs.STT(
    model_id="scribe_v2_realtime",
),
to:
Copy code
stt=elevenlabs.STT(
    model="scribe_v2_realtime",
),
If you still get the TypeError after that, please paste the exact import lines at the top of your file (showing how
elevenlabs
is imported) and the top 8 lines of the new traceback. I’ll check for conflicting imports or a wrapper changing the signature. Sources: ElevenLabs STT plugin guide | LiveKit docs
m
Still getting the same error. Exact import line:
Copy code
from livekit.plugins import deepgram, noise_cancellation, openai, silero, google, elevenlabs, groq, cartesia
t
Thanks — I’m responding to the ongoing TypeError and need one quick diagnostic from your same virtualenv to see why the STT ctor signature differs from the docs. Please run these commands in that venv (paste the outputs here): 1) In a Python REPL:
Copy code
import inspect, livekit.plugins.elevenlabs as elevenlabs
print("signature:", inspect.signature(elevenlabs.STT))
print("object:", elevenlabs.STT)
print("init qualname:", elevenlabs.STT.__init__.__qualname__)
2) Show the module file path (if step 1 errors on getsource):
Copy code
import inspect, livekit.plugins.elevenlabs as elevenlabs
print("file:", inspect.getfile(elevenlabs))
3) One-liners you can run from shell if you prefer:
Copy code
python -c "import inspect, livekit.plugins.elevenlabs as elevenlabs; print('signature:', inspect.signature(elevenlabs.STT)); print('object:', elevenlabs.STT); print('init qualname:', elevenlabs.STT.__init__.__qualname__)"
python -c "import inspect, livekit.plugins.elevenlabs as elevenlabs; print('file:', inspect.getfile(elevenlabs))"
Also confirm the exact STT init line you’re using now (copy-paste). With those outputs I can tell whether a different implementation or wrapper is installed and give the exact fix. Sources: ElevenLabs STT plugin guide | LiveKit docs | AssemblyAI STT | LiveKit Docs
m
How do I open a python REPL in that env?
t
You're in the right venv — here's how to open a Python REPL inside it and run the diagnostic commands. 1. Activate the virtualenv • macOS / Linux: ◦ If you used venv and it's at `.venv`: ▪︎ source .venv/bin/activate • Windows (PowerShell): ◦ .\.venv\Scripts\Activate.ps1 • Windows (cmd): ◦ .\.venv\Scripts\activate.bat 1. Open Python REPL • Run: ◦ python 1. In the REPL, run these lines (copy-paste):
Copy code
import inspect, livekit.plugins.elevenlabs as elevenlabs
print("signature:", inspect.signature(elevenlabs.STT))
print("object:", elevenlabs.STT)
print("init qualname:", elevenlabs.STT.__init__.__qualname__)
print("file:", inspect.getfile(elevenlabs))
1. If you prefer a single shell command (after activating venv), run: • macOS / Linux / Windows cmd:
Copy code
python -c "import inspect, livekit.plugins.elevenlabs as elevenlabs; print('signature:', inspect.signature(elevenlabs.STT)); print('object:', elevenlabs.STT); print('init qualname:', elevenlabs.STT.__init__.__qualname__); print('file:', inspect.getfile(elevenlabs))"
Paste the full output here and also your current STT init line (copy-paste). I’ll use that to identify why the constructor is rejecting `model`/`model_id`.
m
module 'livekit' is not found
t
You're seeing "module 'livekit' is not found" because the Python REPL you're running isn't using the virtualenv where you installed the packages. Let's confirm and run the inspection inside the correct env. 1) Activate the virtualenv (run in the project folder) • macOS / Linux: ◦ source .venv/bin/activate • Windows PowerShell: ◦ .\.venv\Scripts\Activate.ps1 • Windows cmd: ◦ .\.venv\Scripts\activate.bat After activation your shell prompt should show
(.venv)
or similar. 2) Confirm packages are visible Run: • pip show livekit-agents You should see the package info you pasted earlier. If it says "Package not found", you are still outside the venv. 3) Run the inspection (inside the activated venv) Copy-paste this whole command into your shell and paste the output here: • macOS / Linux / Windows cmd / PowerShell:
Copy code
python -c "import inspect, livekit.plugins.elevenlabs as elevenlabs; print('signature:', inspect.signature(elevenlabs.STT)); print('object:', elevenlabs.STT); print('init qualname:', elevenlabs.STT.__init__.__qualname__); print('file:', inspect.getfile(elevenlabs))"
If that errors with "module 'livekit' not found" even after activation, run: • python -m pip show livekit-agents and paste the output. 4) Also paste the exact STT init line you're using now (copy-paste). I’ll use the outputs to tell you whether the installed plugin matches the docs or if something else is shadowing the module.
m
Copy code
>>> print("signature:", inspect.signature(elevenlabs.STT))
signature: (api_key: 'NotGivenOr[str]' = NOT_GIVEN, base_url: 'NotGivenOr[str]' = NOT_GIVEN, http_session: 'aiohttp.ClientSession | None' = None, language_code: 'NotGivenOr[str]' = NOT_GIVEN, tag_audio_events: 'bool' = True) -> 'None'
>>> print("object:", elevenlabs.STT)
object: <class 'livekit.plugins.elevenlabs.stt.STT'>
>>> print("init qualname:", elevenlabs.STT.__init__.__qualname__)
init qualname: STT.__init__
>>> print("file:", inspect.getfile(elevenlabs))
file: /Users/vivek/Desktop/Personal/revspot/agent-starter-python/.venv/lib/python3.11/site-packages/livekit/plugins/elevenlabs/__init__.py
t
Thanks — I inspected the STT signature you printed. The
elevenlabs.STT
constructor for your installed plugin version accepts these parameters: (api_key, base_url, http_session, language_code, tag_audio_events) So passing
model
or
model_id
will raise a TypeError. To fix this: • Remove
model
/
model_id
from
elevenlabs.STT(...)
. • If you want the default ElevenLabs realtime model, just initialize without model arguments:
Copy code
stt = elevenlabs.STT()
• If you need to set language or other advanced options, use the supported keyword
language_code
, e.g.:
Copy code
stt = elevenlabs.STT(language_code="en-US")
• If you need to choose a specific ElevenLabs model (like
scribe_v2_realtime
) or other model-level options not exposed by this plugin, use LiveKit Inference instead:
Copy code
from livekit.agents import inference
stt = inference.STT(model="elevenlabs/scribe_v2_realtime", language="en-US")
Finally, ensure your ElevenLabs API key is set (pass
api_key="..."
to the constructor or set it in env) if you haven’t already. Do you want me to suggest the exact updated snippet for your file (I can show it with your current LLM/STT combo)?