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-md

code blocks

syntax highlighting for 20+ languages. line numbers, copy button, language badge. compact mode for chat messages.

typescript
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.

modellatencycostquality
flux-dev7.9s$0.03high
sdxl-turbo1.2s$0.01medium
dall-e-312s$0.04high
seedream-35.1s$0.02high

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.

a neon cityscape at midnight

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.

basic usagetsx
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.

streamingtsx
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.