1.6.0 is here! and we finally have observability... #1091
ivanleomk
announced in
Announcements
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
We’re releasing instructor 1.6.2 today!
A huge change as we move from 1.5 -> 1.6 was the refactoring of our internal codebase itself. This should make it significantly easier to add support for new clients in the future with the more declarative logic. In this announcement article, we'll talk a bit about the new changes that we've made to the library as well as highlight some recent clients that we've added support for. We'll cover
hook
mechanismHooks
A major point of concern for a long time was observability in instructor. Our default suggestion was to use something like Langsmith or Logfire to handle logging of user requests and handle observability.
But with instructor 1.6, you're now able to add your own python functions to log and handle completions generated by your language model at five distinct stages.
This is done by using the
.on
method that's available for every client.Let's see this in action.
When we use this new
log_completion_kwargs
method above, what we'll see in the console will beYou can add as many hooks as you'd like during each phase as long as the function names are unique. You can then remove it by using
Cerebras Support
We've added new support for the Cerebras client and with it comes blazing fast inference speeds - 20x faster than on GPUs in fact with 500 tok/s of inference speeds.
cerebras.mp4
To use it, just use the
from_cerebras
wrapper as seen below.Similar to our other clients, we also support streaming but only for text completions for now using the
CEREBRAS_JSON
mode.Fireworks Client
We've also dropped a new fireworks client that provides integrated streaming of tool calls, structured outputs and more! This means that you'll be able to use models such as the
phi-3-vision-instruct
to do structured tool calling on.Let's take this image below
You also get the full benefits of streaming with our new Fireworks integration for both tool calling and text completions ( whichever works better for you!) as seen below. This is a huge improvement if you're building tools where you might want to render text content or UIs as they stream in for quick user responsiveness.
Partial.mp4
Beta Was this translation helpful? Give feedback.
All reactions