Fishjam Python Server Sdk logo

Fishjam Python Server Sdk

Organization
software-mansion-labs
fishjam-python-server-sdk

Python server SDK for Fishjam — backends that create rooms, mint peer tokens, receive server notifications, and run voice agents. Use when writing a Python backend (FastAPI, Flask, Starlette, aiohttp) that talks to Fishjam, decorates a notification handler, decodes a Fishjam webhook, builds an AI voice agent, or composes streams in Python. Trigger on: 'fishjam-server-sdk', 'pip install fishjam-server-sdk', 'from fishjam import', 'fishjam.FishjamClient', 'FishjamNotifier', 'on_server_notification', 'receive_binary', 'fishjam Agent', 'AgentSession', 'PeerOptions', 'RoomOptions', 'AgentOptions', 'AgentOutputOptions', 'OutgoingAudioTrackOptions', 'create_room', 'create_peer', 'create_agent', 'create_vapi_agent', 'create_livestream_streamer_token', 'create_moq_token', 'subscribe_peer', 'fastapi fishjam', 'flask fishjam', 'fishjam python', 'gemini fishjam python', 'CompositionClient', 'forward_room_tracks'. Python 3.10+. The REST client is synchronous; notifier and agent are async.

Overview

Publishersoftware-mansion-labs
Repositoryskills
Skill namefishjam-python-server-sdk
Stars
296
Forks
21
Bundled files
9
LicenseApache-2.0
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 9 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by software-mansion-labs on GitHub. Read the source before you install it.

Installation

Install the Fishjam Python Server Sdk AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/software-mansion-labs/skills/tree/main/skills/fishjam/references/python-server-sdk
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/software-mansion-labs/skills.git /tmp/skills
mkdir -p .claude/skills
cp -r /tmp/skills/skills/fishjam/references/python-server-sdk .claude/skills/fishjam-python-server-sdk
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Fishjam Python Server Sdk in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Fishjam Python Server Sdk on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Fishjam Python Server Sdk is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Fishjam Python Server SDK

fishjam-server-sdk on PyPI; import fishjam. Server-side Python SDK for Fishjam.

Read ../platform/SKILL.md first. It defines rooms, peers, tracks, the two-tier token model, and the WS-vs-webhook tradeoff that the Python SDK is built on.

Sync REST + async events

The architecture differs from the JS SDK in one important way:

  • FishjamClient is synchronous. Methods like create_room, create_peer, delete_peer are plain def, not async def. Call them from sync routes or via run_in_executor from async contexts.
  • FishjamNotifier is async (asyncio + websockets). Use @notifier.on_server_notification and await notifier.connect().
  • Agent is async (async context manager — async with agent.connect() as session: ...).
  • receive_binary(raw_bytes) is sync — call it directly inside an async route handler or a sync one.

Install + minimal flow

bash
pip install fishjam-server-sdk
# or: uv add fishjam-server-sdk
# or: poetry add fishjam-server-sdk
python
import os
from fishjam import FishjamClient, PeerOptions

fishjam_client = FishjamClient(
    fishjam_id=os.environ['FISHJAM_ID'],
    management_token=os.environ['FISHJAM_MANAGEMENT_TOKEN'],
)

room = fishjam_client.create_room()
peer, peer_token = fishjam_client.create_peer(
    room.id,
    PeerOptions(metadata={'userId': 'user-123'}),
)
# ship `peer_token` to your client

Components

ComponentWhat it doesReference
FishjamClient (sync)REST — rooms, peers, agents, livestream/MoQ tokens, subscribe modes.client.md
FishjamNotifier (async)Persistent WebSocket; one handler via decorator gets every event.notifier.md
receive_binary(bytes) (sync)Decode an HTTP webhook body to a typed event.webhooks.md
Agent + AgentSession (async)Server-side voice agent — async iter over incoming, await track.send_chunk(...).agent.md
CompositionClient (sync)Compositions: register inputs and outputs, deploy templates, send events. Concepts in ../composition/SKILL.md.composition.md

When to read which reference

TaskReference
Any REST method on FishjamClientclient.md
Background WS task receiving eventsnotifier.md
HTTP route receiving webhook payloadswebhooks.md
Build a voice agent in Pythonagent.md
Wire Gemini Live to an agentgemini-integration.md
FastAPI / Flask wiring patternsfastapi.md
Issue livestream / MoQ tokenslivestream-and-moq.md
Use manual subscribe modeselective-subscriptions.md
Compose streams: CompositionClient calls, forwarding a roomcomposition.md

Key rules

  • Python 3.10+ required. SDK uses match, structural typing, PEP 604 unions.
  • FishjamClient is sync. Calling it from async def works (it's a quick HTTP round-trip) but if you're in a hot async path consider await asyncio.to_thread(fishjam_client.create_peer, ...).
  • FishjamNotifier does NOT auto-reconnect. Its connect() coroutine runs until the WS closes. Wrap it in a supervisor loop.
  • One handler per notifier. @notifier.on_server_notification only stores the last function you decorate. Multi-dispatch in your one handler via match on the message type.
  • Notifier handler can be sync or async. Both work — await result if inspect.isawaitable(result).
  • Webhook decoding is sync. receive_binary(await req.body()) is fine inside an async FastAPI route.
  • Agent is async-only. async with agent.connect() as session: is the only entry point.
  • Management token stays on the server. Standard rule — never leak.

References

FileWhen to read
client.mdFishjamClient — every method, dataclass, error type.
notifier.mdFishjamNotifier, wait_ready, the decorator pattern, pattern-matching on event types.
webhooks.mdreceive_binary, FastAPI / Flask receivers, security patterns.
agent.mdAgent, AgentSession, OutgoingAudioTrackOptions, receive() async iterator.
gemini-integration.mdfishjam.integrations.gemini, the GeminiIntegration singleton.
fastapi.mdFastAPI patterns (Depends-injected client, async webhook route, background notifier).
livestream-and-moq.mdcreate_livestream_streamer_token, create_livestream_viewer_token, create_moq_token.
selective-subscriptions.mdsubscribe_peer / subscribe_tracks with subscribe_mode='manual' rooms.
composition.mdCompositionClient: compositions, inputs, outputs, template deploy, events, type_ enums in scene models.

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Fishjam Python Server Sdk AI skill do?

Python server SDK for Fishjam — backends that create rooms, mint peer tokens, receive server notifications, and run voice agents. Use when writing a Python backend (FastAPI, Flask, Starlette, aiohttp) that talks to Fishjam, decorates a notification handler, decodes a Fishjam webhook, builds an AI voice agent, or composes streams in Python. Trigger on: 'fishjam-server-sdk', 'pip install fishjam-server-sdk', 'from fishjam import', 'fishjam.FishjamClient', 'FishjamNotifier', 'on_server_notification', 'receive_binary', 'fishjam Agent', 'AgentSession', 'PeerOptions', 'RoomOptions', 'AgentOptions...

Why use Fishjam Python Server Sdk on TypingMind?

Because you install it once and use it with any model. Fishjam Python Server Sdk is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Fishjam Python Server Sdk in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/software-mansion-labs/skills/tree/main/skills/fishjam/references/python-server-sdk. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Fishjam Python Server Sdk?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Fishjam Python Server Sdk?

As many as you like. As long as a model supports skills, you can use Fishjam Python Server Sdk with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Fishjam Python Server Sdk AI skill free?

Yes. It is published on GitHub by software-mansion-labs under the Apache-2.0 license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇