pretext-md
markdown
high-performance markdown renderer with syntax-highlighted code blocks, tables, images, YouTube embeds, and zoomable images. optimized for streaming.
pnpm dlx shadcn@latest add @inferencesh/pretext-mdcode blocks
syntax highlighting for 20+ languages. line numbers, copy button, language badge. compact mode for chat messages.
import { Inference } from '@inferencesh/sdk'const client = new Inference({ apiKey: process.env.INFERENCE_API_KEY,})const task = await client.run('pruna/flux-dev', { prompt: 'a neon cityscape at midnight', width: 1024, height: 768,})console.log(task.output.image_url)tables
GFM tables with proper alignment, responsive scroll, and striped rows. inline code in cells. works in narrow containers.
| model | latency | cost | quality |
|---|---|---|---|
flux-dev | 7.9s | $0.03 | high |
sdxl-turbo | 1.2s | $0.01 | medium |
dall-e-3 | 12s | $0.04 | high |
seedream-3 | 5.1s | $0.02 | high |
text & formatting
headings, bold, italic, inline code, ordered and unordered lists with nesting, blockquotes, horizontal rules, and links.
deployment guide
here's how to deploy your agent to production with inference shell. the platform handles infrastructure, you write the logic.
key capabilities:
durable execution — tasks survive restarts, retries on failure
tool orchestration — agents compose tools automatically
built-in tools: search, browse, shell
custom tools via the SDK
streaming — real-time token delivery to your UI
human-in-the-loop — approval gates for sensitive operations
every tool call is logged, retried on failure, and persisted. you get full observability without instrumenting anything.
zoomable images
images render with click-to-zoom. pinch to zoom on mobile. lazy loading by default. works with any image URL.

YouTube embeds
YouTube URLs auto-embed as responsive iframes. paste a link, get a player. no manual iframe markup needed.
one component
pass content as a string. the renderer handles parsing, syntax highlighting, table layout, and image zoom. no config needed.
import { Markdown } from '@inference/ui/markdown' <Markdown content={message.content} />
streaming-optimized
pretext-md is built for token-by-token streaming. no flicker, no reflow, no layout shifts as content arrives. measureBlocks enables height tracking for virtualization.
import { PretextMarkdown } from '@inference/ui/pretext-md' // streaming-optimized renderer <PretextMarkdown content={streamingContent} measureBlocks={true} />
ready to ship?
start with the hosted platform. deploy your own when you're ready.
we use cookies
we use cookies to ensure you get the best experience on our website. for more information on how we use cookies, please see our cookie policy.
by clicking "accept", you agree to our use of cookies.
learn more.