Skip to content

Conversation

omaryashraf5
Copy link

@omaryashraf5 omaryashraf5 commented Aug 27, 2025

Description: This PR introduces a comprehensive LangChain integration for Llama Stack, providing full-featured chat completion, text embeddings, and safety checking capabilities. The integration supports multiple providers (Ollama, OpenAI, Together AI, Fireworks, etc.) and includes advanced shield management for content moderation.

Key features:

  • Chat Completion: Full LangChain-compatible chat models with streaming support
  • Text Embeddings: Vector embeddings for semantic search and RAG applications
  • Safety Checking: Content moderation using Llama Guard and other safety shields with registration capability
  • Shield Management: Register, and clean up safety shields with automatic provider detection
  • Multi-Provider Support: Works with Ollama, OpenAI, Together AI, Fireworks, and more
  • Comprehensive Examples: Complete usage examples including basic usage, advanced features, and shield management
  • Utility Functions: Model discovery, connection testing, and environment validation

The integration follows LangChain patterns and includes proper error handling, logging, and comprehensive documentation.

Dependencies:

  • llama-stack-client>=0.0.40 (optional, for Llama Stack integration)
  • httpx>=0.25.0
  • pydantic>=1.10.0
  • numpy and scikit-learn (optional, for similarity search)

Additional Notes:

  • All tests pass locally with make format, make lint, and make test
  • Integration includes comprehensive unit tests that don't rely on network access
  • Example notebooks and documentation are included in the examples/ directory
  • Optional dependencies are properly imported within functions
  • Changes are backwards compatible
  • No modifications to existing packages, this is a self-contained new integration

Copy link

vercel bot commented Aug 27, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
langchain Ready Ready Preview Comment Aug 27, 2025 11:58pm

Copy link

codspeed-hq bot commented Aug 27, 2025

CodSpeed WallTime Performance Report

Merging #32706 will not alter performance

Comparing omaryashraf5:langchain_llamastack (0d72193) with master (7f9b077)

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

Summary

✅ 13 untouched benchmarks

Copy link

codspeed-hq bot commented Aug 27, 2025

CodSpeed Instrumentation Performance Report

Merging #32706 will not alter performance

Comparing omaryashraf5:langchain_llamastack (0d72193) with master (7f9b077)

Summary

✅ 14 untouched benchmarks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant