Skip to main content

Writer (Palmyra)

Writer's Palmyra models via the OpenAI-compatible API. Includes domain-specific models for medicine and finance.

Install

pip install synapsekit[openai]

Usage

from synapsekit.llm.writer import WriterLLM
from synapsekit import LLMConfig

config = LLMConfig(
model="palmyra-x-004",
api_key="...",
provider="writer",
)

llm = WriterLLM(config)

# Streaming
async for token in llm.stream("Draft a contract summary"):
print(token, end="")

# Generate
response = await llm.generate("Explain HIPAA compliance")

Available models

ModelNotes
palmyra-x-004Latest general purpose
palmyra-x-003-instructInstruction-tuned
palmyra-medMedical domain
palmyra-finFinancial domain

Function calling

from synapsekit import AgentExecutor, AgentConfig, CalculatorTool

config = AgentConfig(
model="palmyra-x-004",
api_key="...",
provider="writer",
tools=[CalculatorTool()],
)
executor = AgentExecutor(config)
result = await executor.run("Calculate compound interest on $10,000 at 5% for 3 years")