--- id: cohere-melody version: "0.13.3" license: MIT license_treatment: permissive maintenance: active --- # cohere-melody — Templating rendering and generation parsing for Cohere models License: permissive · Maintenance: active · Downloads: 243.7K/mo ## What it is and what it does Cohere Melody is a Rust library with Python bindings that parses and renders templates for Cohere language models. It handles two main tasks: parsing model outputs to extract citations and structured content (including vision generation markdown with embedded visual elements), and rendering conversation templates into formatted prompts. The library is designed to work with Cohere's Command and other models, supporting streaming text with incremental parsing and batch vision parsing. It has no runtime dependencies beyond the compiled Rust core. The package is intended for developers integrating Cohere models into applications where citation tracking, prompt templating, and structured output parsing are required. It exposes a Python API built on PyO3 and also provides Go bindings, making it usable across multiple languages. Installation requires no external system dependencies beyond Python itself, though the wheels are pre-compiled for specific platforms. Use it for: - Extract and track citations from Cohere model outputs during streaming or batch inference. - Render multi-turn conversation histories into properly formatted prompts for Cohere Command models. - Parse vision model outputs to separate markdown text from embedded visual element metadata. - Build LLM applications that need structured prompt templating and citation attribution. - Integrate Cohere models into production systems requiring standardized output parsing. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses and renders templated text for Cohere language models, handling citations, vision generation markup, and prompt formatting across Python and Rust. Yes, if you are building with Cohere models and need reliable citation parsing or prompt templating. The package is actively maintained, has no security vulnerabilities, carries a permissive MIT license, and offers pre-built wheels for common platforms. Install friction is moderate but acceptable for a compiled library. Not necessary if you are not using Cohere models or do not require structured parsing of their outputs. ## Install pip install cohere-melody uv add cohere-melody poetry add cohere-melody ## Installing cohere-melody Before you install: Medium install friction due to compiled Rust bindings; wheels are pre-built for common platforms (Python 3.10–3.11, Linux, macOS, Windows). Active maintenance with recent release. License in practice: MIT license permits unrestricted use, modification, and distribution with minimal attribution requirements. Quickstart: pip install cohere-melody import cohere_melody # Parse vision generation parsed = cohere_melody.parse_vision_generation(model_output) for segment in parsed.segments: if hasattr(segment, 'text'): print(segment.text) Requires Python 3.10 or later. Pre-built wheels available for Linux (x86_64, aarch64, armv7l, ppc64le, s390x, i686), macOS (x86_64, arm64), Windows (x86_64), and musl-based systems; other platforms may require building from source. Verify before relying: - Whether the package works with Python versions beyond 3.10–3.11 despite the requires_python constraint. - Performance characteristics when parsing large or streaming generations. - Stability and API surface of the Python bindings relative to the Rust core. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: medium - Maintenance: active - Downloads: 243.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags cohere model templating, llm prompt rendering, citation parsing, vision generation parsing, cohere melody library, template generation for llms, markdown citation extraction, cohere-integration, llm-tooling, rust-bindings [View on SkillFed](https://skillfed.io/packages/cohere-melody) · [View on PyPI](https://pypi.org/project/cohere-melody/)