https://github.com/andybons/smartquote
Smart quotes for dumb llms
https://github.com/andybons/smartquote
ai ai-sdk streaming typescript typography
Last synced: 5 months ago
JSON representation
Smart quotes for dumb llms
- Host: GitHub
- URL: https://github.com/andybons/smartquote
- Owner: andybons
- License: mit
- Created: 2026-01-09T01:34:51.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2026-01-11T15:14:14.000Z (5 months ago)
- Last Synced: 2026-01-15T08:06:38.481Z (5 months ago)
- Topics: ai, ai-sdk, streaming, typescript, typography
- Language: TypeScript
- Homepage: https://smartquote.bons.dev
- Size: 127 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# smartquote
Smart quote conversion utilities for typographically correct quotes.
## Why this exists
Some LLMs (all Anthropic models, for instance) are incapable of outputting smart quotes, even when explicitly asked—and [Anthropic has confirmed](https://github.com/anthropics/anthropic-sdk-typescript/issues/561#issuecomment-2442675237) this won't be fixed anytime soon. This package provides a streaming transform for AI output and an ESLint rule/autofix for vibe-coded JSX/TSX.
## Packages
| Package | Description |
| ----------------------------------- | ----------------------------------------------------------------------------- |
| [smartquote](./packages/smartquote) | Core library with streaming API, Vercel AI SDK integration, and ESLint plugin |
| [smartquotes (Python)](./python) | Python port of the core conversion logic |
## Quick Start
```bash
npm install smartquote
```
```typescript
import { smartQuotes } from "smartquote";
smartQuotes('"Hello," she said.');
// → “Hello,” she said.
```
See the [package README](./packages/smartquote/README.md) for full API documentation.
## Examples
- [vercel-ai-sdk](./examples/vercel-ai-sdk) - Streaming AI responses with smart quote conversion
- [eslint](./examples/eslint) - ESLint plugin for JSX/TSX files
## Development
This is a pnpm monorepo.
```bash
pnpm install # Install dependencies
pnpm build # Build all packages
pnpm test # Run tests
pnpm lint # Lint all packages
pnpm check-types # Type check all packages
```
## License
MIT