forked from 567-labs/instructor
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsitemap.yaml
More file actions
5721 lines (5721 loc) · 252 KB
/
sitemap.yaml
File metadata and controls
5721 lines (5721 loc) · 252 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
api.md:
cross_links: []
hash: 4512e518bca21bfdbbc97752e007d64f
references: []
summary: 'The API Reference Guide provides a thorough overview of various components
related to instructors, validation, iteration, and function calls within a programming
framework. Key topics include OpenAI instructors, DSL validators, iterable structures,
partial applications, parallel processing, and optional operations through the
''maybe'' moniker. It also delves into function call mechanisms, offering developers
essential information for implementing efficient and robust APIs. This guide serves
as a vital resource for those seeking to enhance their understanding and application
of API-related functionalities. Keywords: API reference, instructors, validation,
iteration, function calls, OpenAI, DSL validators, parallel processing.'
architecture.md:
ai_references: []
cross_links: []
hash: 141a2c4c63d93091402d5bf4e39b04f8
keywords:
- Instructor
- LLM providers
- Pydantic Model
- Schema Converter
- API Request
- Response Parser
- Validator
- Retry Mechanism
references: []
summary: The Instructor Architecture document elucidates the internal workings of
the Instructor system and its integration with various Large Language Model (LLM)
providers. It details the core components that facilitate seamless interactions
and structured data handling in a consistent manner across different providers.
topics:
- Core Components
- Request Flow
- Data Validation
- LLM Integration
- Structured Output
blog/index.md:
cross_links:
- blog/posts/aisummit-2023.md
- blog/posts/announcing-unified-provider-interface.md
- blog/posts/caching.md
- blog/posts/chain-of-density.md
- blog/posts/citations.md
- blog/posts/distilation-part1.md
- blog/posts/generator.md
- blog/posts/langsmith.md
- blog/posts/learn-async.md
- blog/posts/llms-txt-adoption.md
- blog/posts/logfire.md
- blog/posts/rag-and-beyond.md
- blog/posts/validation-part1.md
- concepts/partial.md
- examples/batch_job_oai.md
- examples/bulk_classification.md
- examples/image_to_ad_copy.md
- integrations/llama-cpp-python.md
- integrations/ollama.md
- integrations/together.md
- prompting/decomposition/least_to_most.md
- prompting/self_criticism/chain_of_verification.md
- prompting/self_criticism/cumulative_reason.md
- prompting/self_criticism/reversecot.md
hash: 04ec2689ed366f014bc3f15ce4fd0b42
references:
- blog/posts/announcing-unified-provider-interface.md
- blog/posts/llms-txt-adoption.md
- blog/posts/rag-and-beyond.md
- blog/posts/chain-of-density.md
- blog/posts/validation-part1.md
- blog/posts/citations.md
- blog/posts/distilation-part1.md
- blog/posts/langsmith.md
- blog/posts/logfire.md
- blog/posts/caching.md
- blog/posts/learn-async.md
- blog/posts/generator.md
- examples/batch_job_oai.md
- examples/bulk_classification.md
- examples/image_to_ad_copy.md
- prompting/decomposition/least_to_most.md
- prompting/self_criticism/chain_of_verification.md
- prompting/self_criticism/cumulative_reason.md
- prompting/self_criticism/reversecot.md
- integrations/ollama.md
- integrations/llama-cpp-python.md
- integrations/together.md
- concepts/partial.md
- blog/posts/aisummit-2023.md
summary: This document outlines various resources and updates available for users
interested in AI development, optimization, and language model techniques. It
encourages subscribing to a newsletter to receive updates on new features and
tips for using "Instructor." The content includes topics on advanced AI techniques
like the Unified Provider Interface, llms.txt adoption, and GPT-4 level summaries
using GPT-3.5-turbo. It also covers AI model validation, function caching in Python,
batch processing, and integrations with tools like Logfire and Pandas. Additionally,
it introduces prompting techniques such as Least-to-Most prompting and the Reverse
Chain of Thought (RCoT) for enhancing language model performance. Key objectives
are to keep users informed with the latest advancements and provide practical
tips for AI model refinement and deployment. Keywords include AI development,
language models, optimization, Python, integrations, and prompting techniques.
blog/posts/aisummit-2023.md:
ai_references:
- '[AI Engineer Summit](https://www.ai.engineer/summit)'
- '[Pydantic Documentation](https://docs.pydantic.dev/latest/)'
- '[full talk](https://www.youtube.com/watch?v=yj-wSRJwrrc)'
cross_links: []
hash: f0b52aac48499d18ab5101d10da676ed
keywords:
- Pydantic
- Prompt Engineering
- AI Summit
- Machine Learning
- Data Validation
references: []
summary: This document provides insights from a keynote at the AI Engineer Summit
on utilizing Pydantic for effective prompt engineering. The talk includes a deep
dive into the related documentation and aims to refine the art of prompt engineering
in AI applications.
topics:
- Pydantic usage
- Prompt engineering techniques
- AI in engineering
- Machine learning applications
blog/posts/announcing-gemini-tool-calling-support.md:
cross_links: []
hash: 9918d92d63a5005bc11f4df8593d1411
references: []
summary: "This article introduces the latest support for structured outputs via\
\ tool calling in the instructor library for both Gemini and VertexAI SDKs, enhancing\
\ AI model interactions. It highlights easy installation options for Gemini (`instructor[google-generativeai]`)\
\ and VertexAI (`instructor[vertexai]`), emphasizing Gemini\u2019s advantages\
\ such as a higher free token quota and simpler setup with just a Google API key.\
\ The guide provides step-by-step examples of using instructor with Gemini and\
\ VertexAI models (`gemini-1.5-flash-latest`, `gemini-1.5-pro-latest`) for chat\
\ completions and structured output extraction, focusing on AI SDKs, tool calling,\
\ structured outputs, and generative models for AI developers."
blog/posts/announcing-instructor-responses-support.md:
cross_links:
- integrations/openai-responses.md
hash: 8ce4314b2dee3e0af9a37baeee08ed87
references:
- integrations/openai-responses.md
- integrations/openai-responses.md
summary: The announcement highlights Instructor's integration with OpenAI's new
Responses API, providing a streamlined, type-safe interface for structured outputs,
web search, and citation tools. Key features include easy client initialization,
full Pydantic validation, built-in tools for real-time information retrieval,
and async support. This integration enhances LLM applications by simplifying external
data referencing, maintaining compatibility with existing chat workflows, and
enabling powerful capabilities like file search and citations without additional
complexity. Core keywords include Instructor, Responses API, OpenAI, structured
outputs, type safety, web search, citations, Pydantic, async support, LLM development.
blog/posts/announcing-unified-provider-interface.md:
ai_references:
- '[../../integrations/anthropic.md#caching'
- ../posts/anthropic-prompt-caching.md
- ../../concepts/prompt_caching.md
- ../../concepts/multimodal.md
- /concepts/patching
- /integrations/
- string-based-init
- best_framework
- introduction]
cross_links:
- blog/posts/anthropic-prompt-caching.md
- blog/posts/best_framework.md
- blog/posts/string-based-init.md
- concepts/multimodal.md
- concepts/prompt_caching.md
- integrations/anthropic.md
hash: c88097d85ac482f5383e301293764cea
keywords:
- from_provider
- LLM providers
- client initialization
- synchronous
- asynchronous
- model comparison
- structured outputs
- multi-provider strategies
- rapid prototyping
references:
- blog/posts/anthropic-prompt-caching.md
- concepts/prompt_caching.md
- concepts/multimodal.md
- blog/posts/concepts/patching/index.md
- blog/posts/integrations/index.md
- blog/posts/string-based-init/index.md
- blog/posts/best_framework/index.md
- blog/posts/introduction/index.md
summary: The `from_provider()` function in the Instructor library allows users to
easily switch between various LLM providers using a single string identifier,
simplifying client initialization and model experimentation. This enhancement
automates setup procedures and supports both synchronous and asynchronous operations,
improving efficiency for developers working with multiple language models.
topics:
- Functionality of from_provider
- Key benefits of using from_provider
- Internal workings of from_provider
- Example usage of from_provider
- Future improvements in LLM integration
blog/posts/anthropic-prompt-caching.md:
ai_references:
- '[Caching Strategies](/concepts/caching)'
- '[Anthropic Integration](/integrations/anthropic)'
- '[Anthropic Structured Outputs](structured-output-anthropic)'
- '[Response Caching](caching)'
- '[Performance Monitoring](logfire)'
cross_links: []
hash: 54da38a45472225872357555af50eb10
keywords:
- prompt caching
- Anthropic
- API optimization
- cost reduction
- latency improvement
- caching limitations
- developer guide
references:
- blog/posts/concepts/caching/index.md
- blog/posts/integrations/anthropic/index.md
- blog/posts/structured-output-anthropic/index.md
- blog/posts/caching/index.md
- blog/posts/logfire/index.md
summary: This document explores the benefits of using prompt caching with Anthropic,
highlighting its ability to improve response times and reduce costs for applications
requiring large context management. It includes a quickstart guide, implementation
examples, and discusses key limitations and considerations for developers eager
to optimize API interactions.
topics:
- prompt caching implementation
- API usage optimization
- caching limitations
- character extraction example
- performance monitoring
blog/posts/anthropic-web-search-structured.md:
cross_links: []
hash: 9a5a79e8e389eb7265944a8968db3fa9
references: []
summary: Learn how to leverage Anthropic's web search tool with Instructor to access
real-time, structured data from the web. This powerful combination enables AI
models like Claude to fetch the latest information, generate organized responses
using Pydantic models, and cite sources for verification. Key features include
enhanced accuracy, reduced hallucinations, and customizable search configurations
like domain restrictions and search limits. Ideal for building dynamic applications
that require up-to-date data on topics such as sports, news, or market trends.
blog/posts/anthropic.md:
cross_links: []
hash: 44073f09c95cb56e33653923ef4e83c8
references: []
summary: This article discusses integrating Anthropic's powerful language models
with Instructor and Pydantic for structured output generation in Python. It provides
step-by-step guidance on installing the `instructor[anthropic]` package, configuring
the Anthropic client with enhanced capabilities, and creating custom data models
for precise JSON responses. Key topics include handling nested types, leveraging
the `anthropic` client, and supporting models like Claude-3 for AI-driven applications.
The content highlights ongoing feature development, including streaming support,
and encourages community feedback to improve compatibility and functionality in
API development and LLM techniques.
blog/posts/bad-schemas-could-break-llms.md:
cross_links:
- blog/posts/matching-language.md
- blog/posts/timestamp.md
- examples/index.md
- index.md
hash: 8d3274500a88eb0bfe0171d9f00504f8
references:
- blog/posts/matching-language.md
- blog/posts/timestamp.md
- index.md
- examples/index.md
summary: This article emphasizes the critical impact of response models and schemas
on Large Language Model (LLM) performance, particularly with Claude and GPT-4o.
Key insights include how field naming, chain-of-thought reasoning, and response
mode choices (JSON vs. Tool Calling) significantly influence accuracy, with performance
gains of up to 60% through optimized schemas. The content highlights the importance
of designing well-structured response models, testing different permutations systematically,
and using tools like Instructor for prototyping. Core keywords include LLM response
models, structured outputs, JSON mode, tool calling, GPT-4o, Claude, reasoning
prompts, and model performance optimization.
blog/posts/best_framework.md:
cross_links:
- blog/posts/introduction.md
- concepts/iterable.md
- concepts/parallel.md
- concepts/partial.md
- concepts/patching.md
- concepts/philosophy.md
- concepts/reask_validation.md
- concepts/retrying.md
- concepts/types.md
- concepts/unions.md
- examples/index.md
- integrations/groq.md
- integrations/index.md
- integrations/llama-cpp-python.md
- integrations/ollama.md
- integrations/together.md
hash: 41b529a5e2d92400da24c6f6c1e8146f
references:
- concepts/retrying.md
- concepts/reask_validation.md
- concepts/parallel.md
- concepts/partial.md
- concepts/iterable.md
- concepts/types.md
- concepts/unions.md
- examples/index.md
- integrations/index.md
- integrations/together.md
- integrations/ollama.md
- integrations/groq.md
- integrations/llama-cpp-python.md
- concepts/philosophy.md
- concepts/patching.md
- concepts/retrying.md
- concepts/partial.md
- blog/posts/introduction.md
- integrations/index.md
- concepts/types.md
summary: Instructor is a lightweight Python library that enhances the OpenAI SDK
by enabling seamless mapping of LLM outputs to structured, type-safe data using
Pydantic models and Python type annotations. It simplifies extracting structured
data from GPTs and other compatible providers, supports features like retrying,
validation, streaming, and parallel tool calling, and allows direct access to
message parameters for advanced prompt engineering. Designed for easy integration
and incremental adoption, Instructor helps teams convert unstructured LLM text
into validated data, making it ideal for improving data consistency and reducing
"string hell" in AI applications. Key keywords include LLM outputs, structured
data, Python, Pydantic, OpenAI SDK, GPT, data mapping, response_model.
blog/posts/caching.md:
cross_links:
- blog/posts/anthropic-prompt-caching.md
- blog/posts/learn-async.md
- concepts/caching.md
- concepts/parallel.md
- concepts/prompt_caching.md
- examples/batch_job_oai.md
hash: 11fdb88f500185d84f0a06cc2a4b4c41
references:
- concepts/caching.md
- concepts/prompt_caching.md
- concepts/parallel.md
- blog/posts/anthropic-prompt-caching.md
- blog/posts/learn-async.md
- examples/batch_job_oai.md
summary: This article explores advanced caching techniques in Python to optimize
performance when working with Pydantic models and language model APIs like OpenAI.
It covers in-memory caching with `functools.cache`, persistent caching with `diskcache`,
and distributed caching using `redis`. The content emphasizes creating custom
decorators to cache API responses effectively, with a focus on serialization,
cache invalidation considerations, and selecting appropriate caching strategies
for small and large-scale applications. Keywords include Python caching, Pydantic
models, performance optimization, in-memory caching, diskcache, Redis, API response
caching, and distributed systems.
blog/posts/chain-of-density.md:
cross_links:
- blog/posts/validation-part1.md
- cli/finetune.md
hash: 1ff99278946f900cba0eb4b22d8c663a
references:
- blog/posts/validation-part1.md
- cli/finetune.md
summary: "This article explores advanced AI summarization techniques, focusing on\
\ the Chain of Density method with GPT-3.5 and GPT-4. It details how to implement\
\ iterative, entity-dense summaries, fine-tune GPT-3.5 models for improved performance,\
\ and achieve significant efficiency gains\u2014up to 20x faster and 50x cost\
\ savings. The guide covers data modeling, validation with Pydantic, and custom\
\ prompting for high-quality summaries. Keywords include GPT-3.5, GPT-4, Chain\
\ of Density, summarization, fine-tuning, LLM techniques, entity density, AI text\
\ summarization, Instructor library, model distillation, OpenAI, cost efficiency,\
\ latency reduction."
blog/posts/chat-with-your-pdf-with-gemini.md:
ai_references:
- '[multimodal-gemini.md'
- generating-pdf-citations.md
- rag-and-beyond.md
- ../../concepts/retrying.md
- ../../index.md]
cross_links:
- blog/posts/generating-pdf-citations.md
- blog/posts/multimodal-gemini.md
- blog/posts/rag-and-beyond.md
- concepts/retrying.md
- index.md
hash: 902b85d5f28f8de856e9e59b6bb79faf
keywords:
- '[Google Gemini'
- Document Processing
- PDF Analysis
- Pydantic
- Python
- Multimodal Capabilities
- Structured Output]
references:
- concepts/retrying.md
- blog/posts/multimodal-gemini.md
- blog/posts/concepts/multimodal/index.md
- blog/posts/multimodal-gemini/index.md
- blog/posts/generating-pdf-citations/index.md
- blog/posts/rag-and-beyond/index.md
- index.md
summary: This documentation provides a comprehensive guide on using Google's Gemini
model with Instructor to efficiently process PDFs and extract structured information.
The integration simplifies typical document processing challenges, allowing users
to leverage multimodal capabilities to streamline data extraction into a structured
format easily.
topics:
- '[PDF Processing'
- Google Gemini Model
- Instructor Integration
- Multimodal Data Extraction
- Benefits of Structured Outputs]
blog/posts/citations.md:
ai_references:
- '[Validation Guide](/concepts/validation)'
- '[RAG Techniques](rag-and-beyond)'
- '[PDF Citations](generating-pdf-citations)'
- '[Validation Basics](validation-part1)'
- '[finetuning a better summarizer](https://jxnl.github.io/instructor/blog/2023/11/05/chain-of-density/)'
cross_links: []
hash: bdc9538dce76ab09cb897edab533e546
keywords:
- Pydantic
- LLM
- Citation Verification
- Data Accuracy
- Python
- Validation
- Error Handling
- Context Validation
- Model Validation
references:
- blog/posts/concepts/validation/index.md
- blog/posts/rag-and-beyond/index.md
- blog/posts/generating-pdf-citations/index.md
- blog/posts/validation-part1/index.md
summary: This blog post explores how Pydantic can be utilized to enhance the verification
of citations in large language models (LLMs) to improve data accuracy and reliability.
It provides practical examples of using substring checks and LLMs for citation
validation, as well as techniques for aligning answers with their corresponding
citations.
topics:
- Citation Verification
- Data Accuracy
- Pydantic Validators
- LLM Integration
- Error Handling Techniques
blog/posts/consistent-stories.md:
cross_links: []
hash: b11eb15649a2a818d4d6bfcf26507cdb
references: []
summary: 'This article discusses how to generate complex Directed Acyclic Graphs
(DAGs) using GPT-4o, focusing on creating consistent and coherent Choose Your
Own Adventure stories. The challenge of generating large graphs is addressed with
a two-phase approach: first generating a story outline, then expanding choices
in parallel to manage context limitations and allow deeper story branches. Key
benefits include path-specific context, parallel generation, controlled growth
via a max_depth parameter, and rate-limiting using semaphores. The article emphasizes
structured validation, using Pydantic models, and highlights the efficiency of
parallel processing for content generation in large-scale language models, applicable
through tools like instructor with OpenAI''s API. Keywords: DAGs, GPT-4o, Choose
Your Own Adventure, story generation, language models, parallel processing, Pydantic,
OpenAI.'
blog/posts/course.md:
cross_links: []
hash: 8424fc0d6b49b24ad11707b30daaddde
references: []
summary: 'Discover a free, one-hour course on Weights and Biases, exploring essential
techniques for steering language models in machine learning. This comprehensive
course covers material from detailed tutorials and is accessible to everyone interested
in AI and machine learning. Perfect for both beginners and experienced practitioners,
it offers valuable insights and practical tools for leveraging language models
effectively. Access this open resource at [wandb.courses](https://www.wandb.courses/courses/steering-language-models).
Keywords: Weights and Biases, language models, machine learning, AI course, free
resources.'
blog/posts/cursor-rules.md:
ai_references:
- '[version-control-for-the-vibe-coder-part-1.md'
- version-control-for-the-vibe-coder-part-2.md]
cross_links: []
hash: fccc7d93ee9d7b15bbfb41e09fd91660
keywords:
- '[Cursor rules'
- Git workflows
- AI-assisted coding
- small commits
- pull requests]
references: []
summary: This documentation discusses how Instructor's Cursor rules enhance Git
workflows for contributors by promoting AI-assisted coding practices. It emphasizes
the importance of small, frequent commits and provides guidance for managing pull
requests, making contributions to projects simpler and more organized.
topics:
- '[Git practices'
- AI coding
- contributor guidelines
- version control
- pull request management]
blog/posts/distilation-part1.md:
cross_links: []
hash: 2b0cffc5cf2701d20f0f294b843aaf1e
references: []
summary: This guide explores using the `Instructor` library to enhance Python functions
through fine-tuning and distillation. The library streamlines the process of developing
task-specific language models by simplifying function calls and managing data
preparation. Key features include automatic dataset generation for fine-tuning,
efficient function integration, and backward compatibility. The guide covers logging
outputs, the importance of structured outputs, and future plans for function implementation.
Essential keywords include Instructor, fine-tuning, distillation, language models,
Python, and dataset generation.
blog/posts/extract-model-looks.md:
cross_links: []
hash: 1a96f01876050a880e6d2f67bee23cb2
references: []
summary: "This article presents a two-phase, parallel approach to generating complex,\
\ consistent Directed Acyclic Graphs (DAGs) and stories with GPT-4o, overcoming\
\ limitations of large graph sizes and context window constraints. By first creating\
\ a detailed story outline\u2014including setting, plot, choices, and visual style\u2014\
and then expanding branches concurrently while maintaining path-specific context,\
\ the method ensures coherence and efficiency. Key concepts include state isolation,\
\ parallel processing, structured validation with Pydantic, and controllable story\
\ depth. Ideal for generating large, interconnected content at scale, this approach\
\ enhances story and graph generation speed, consistency, and complexity using\
\ AI models like OpenAI\u2019s GPT-4o."
blog/posts/extracting-model-metadata.md:
ai_references:
- '[../../concepts/multimodal.md]'
cross_links:
- concepts/multimodal.md
hash: caa1adf0f1bb9d67726b3f7cf6b332a4
keywords:
- '[metadata extraction'
- structured extraction
- gpt-4o
- multimodal
- taxonomy
- product recommendations
- e-commerce
- personalization
- instructor]
references:
- concepts/multimodal.md
summary: This documentation explains how to effectively extract structured metadata
from images using the Structured Extraction technique in conjunction with multimodal
language models like gpt-4o. It provides insights into creating a taxonomy for
e-commerce product categorization and demonstrates practical implementations using
Python, making it essential for enhancing personalized recommendations in online
retail settings.
topics:
- '[metadata extraction'
- product taxonomy
- multimodal language models
- Python implementation
- e-commerce personalization]
blog/posts/fake-data.md:
ai_references: []
cross_links: []
hash: e94f325f97c0441ee1cdc670f4feb925
keywords:
- '[Synthetic Data'
- Pydantic
- OpenAI
- Data Generation
- Python
- data modeling
- JSON schema
- AI-generated data]
references: []
summary: This documentation provides a comprehensive guide on generating synthetic
data using Pydantic and OpenAI's models, featuring practical examples and configurations.
Users can learn to customize synthetic data generation through various methods
such as example setting, model adjustments, and descriptive influences on data
output.
topics:
- '[Data generation with Pydantic'
- Using OpenAI models
- Customizing synthetic data
- Practical examples in Python
- JSON schema configurations]
blog/posts/full-fastapi-visibility.md:
cross_links:
- blog/posts/learn-async.md
hash: b86decf8772b03d62dd49c2700936cc3
references:
- blog/posts/learn-async.md
summary: This article demonstrates how Logfire enhances FastAPI applications with
comprehensive observability and OpenTelemetry integration. It highlights easy
setup and code integration for logging, profiling, and monitoring API endpoints,
including handling asynchronous operations with asyncio and streaming responses
using Instructor's Iterable support. Key topics include FastAPI, Logfire, OpenTelemetry,
Pydantic, AsyncIO, streaming responses, and performance tracking, providing practical
examples to improve application visibility, debugging, and error reproduction
in production environments.
blog/posts/generating-pdf-citations.md:
cross_links:
- index.md
hash: d293a327202394d87adcd15ec894381e
references:
- index.md
summary: This article demonstrates how to leverage Google's Gemini model with Instructor
and Pydantic for accurate PDF data extraction and citation generation. It highlights
the importance of structured outputs to reduce hallucinations, ensure source-truthfulness,
and improve reliability in document processing. The process involves PDF parsing
with PyMuPDF, uploading files to Gemini, and creating citations for precise referencing,
making it ideal for legal, academic, and financial applications. Key topics include
PDF analysis, structured data validation, GPT integration, citation highlighting,
and reducing errors in AI-generated content, with keywords like Gemini, PDF processing,
citations, structured outputs, Pydantic, document verification, and AI accuracy.
blog/posts/generator.md:
cross_links:
- concepts/fastapi.md
hash: b9ebcb6883c21f0ba7d87980c45817dd
references:
- concepts/fastapi.md
summary: 'This article explores the use of Python generators to enhance Large Language
Model (LLM) streaming, improving latency and user experience in applications like
eCommerce and chat interfaces. It explains how generators enable efficient, real-time
data processing and extraction, allowing for faster rendering and responsiveness.
The post demonstrates practical implementations using the Instructor library for
structured data extraction from streaming LLM responses, highlighting their benefits
over traditional approaches. Key concepts include Python generators, LLM streaming,
data pipeline optimization, and fast API integration, emphasizing how real-time
streaming can boost performance and customer engagement. Core keywords: Python
generators, LLM streaming, data processing, real-time API, latency reduction,
fastapi, instructor library, structured extraction, performance optimization.'
blog/posts/google-openai-client.md:
cross_links:
- blog/posts/bad-schemas-could-break-llms.md
- blog/posts/multimodal-gemini.md
- concepts/retrying.md
hash: 26e8561156b73b2a9b6da501c1aa7c04
references:
- blog/posts/bad-schemas-could-break-llms.md
- blog/posts/multimodal-gemini.md
- concepts/retrying.md
summary: "This article explains why Instructor remains essential despite Google's\
\ recent OpenAI compatibility for Gemini models. While the new integration simplifies\
\ interactions with Gemini via OpenAI's API, it has limitations such as limited\
\ schema support, lack of streaming, and no multimodal capabilities. Instructor\
\ offers a provider-agnostic API, advanced schema management, streaming, multimodal\
\ support, automatic validation, retries, and seamless provider switching\u2014\
features crucial for building reliable, production-grade LLM applications. Keywords\
\ include Gemini, OpenAI integration, Instructor, multimodal support, schema management,\
\ streaming, provider agnostic, robust AI applications."
blog/posts/introducing-structured-outputs-with-cerebras-inference.md:
cross_links: []
hash: 9cae7568e3f7431ca1ee3b73b8a7a1b0
references: []
summary: Explore how to leverage Cerebras Inference for structured outputs and faster
model processing with seamless Pydantic integration. Cerebras offers up to 20x
faster inference compared to GPUs, making it an excellent choice for efficient
API development. The article guides you through setting up a Cerebras Inference
API key and using the Cerebras SDK with Pydantic models for validated responses.
Key functionality includes creating instructor clients, using models like "llama3.1-70b",
and supporting both synchronous and asynchronous operations. Enhance your API
integration with features such as streaming responses in `CEREBRAS_JSON` mode
for real-time data processing. Key topics include Cerebras Inference, Pydantic,
fast inference, structured outputs, and API integration.
blog/posts/introducing-structured-outputs.md:
ai_references:
- '[../../concepts/reask_validation.md'
- ../../concepts/lists.md
- ../../concepts/partial.md]
cross_links:
- concepts/lists.md
- concepts/partial.md
- concepts/reask_validation.md
hash: 85ac9a93f1b6892914274bd21ebc8498
keywords:
- '[OpenAI'
- Structured Outputs
- instructor
- Pydantic
- Data Validation
- LLM Workflows
- API
- Vendor Lock-in]
references:
- concepts/reask_validation.md
- concepts/lists.md
- concepts/partial.md
summary: This article explores the challenges associated with OpenAI's Structured
Outputs and introduces 'instructor' as a solution to enhance LLM workflows. It
discusses issues such as validation limitations, streaming difficulties, and latency
problems while highlighting the advantages of using 'instructor' for automatic
retries and provider flexibility.
topics:
- '[OpenAI Structured Outputs'
- Validation Logic
- Streaming Challenges
- Latency Issues
- instructor Features]
blog/posts/introduction.md:
cross_links:
- blog/posts/best_framework.md
- blog/posts/structured-output-anthropic.md
- concepts/models.md
- concepts/reask_validation.md
- index.md
- integrations/index.md
hash: 33cd1df34b63e686b253b5ebca7b433d
references:
- index.md
- integrations/index.md
- concepts/reask_validation.md
- concepts/models.md
- blog/posts/best_framework.md
- blog/posts/structured-output-anthropic.md
- examples/chain-of-thought.md
summary: This article explores how Pydantic simplifies working with Language Learning
Models (LLMs) in Python, particularly through structured JSON outputs. It highlights
the difficulties developers face with existing LLM frameworks and showcases how
the Pydantic-powered Instructor library streamlines interactions with language
models, focusing on ease of use, widespread adoption, and compatibility with tools
like OpenAI's Function Calling. By supporting modular schemas, easy validation,
and relationship definition, Pydantic offers a more organized code structure,
enhancing the developer experience. The piece also parallels LLM architecture
with FastAPI, offering simple, Pythonic approaches to utilizing LLMs effectively.
Key phrases include Pydantic, LLMs, structured JSON, OpenAI, Python, and language
model interaction.
blog/posts/jinja-proposal.md:
ai_references: []
cross_links: []
hash: c49c3ea11717caead70f820614a48932
keywords:
- '[Jinja'
- Templating
- Pydantic
- API Development
- Data Validation
- Prompt Formatting
- Versioning
- Logging
- Security]
references: []
summary: This document outlines the integration of Jinja templating into the Instructor
platform to enhance prompt formatting, validation, versioning, and secure logging
capabilities. By leveraging Jinja's features, Instructor will provide improved
handling of complex prompts and better data management, ultimately boosting its
functionality for users.
topics:
- '[Integration of Jinja'
- Enhanced Formatting Capabilities
- Data Validation
- Version Control
- Secure Logging]
blog/posts/langsmith.md:
cross_links:
- blog/posts/learn-async.md
- examples/bulk_classification.md
hash: 3f9c1608a2030bf77928eb024d6326e4
references:
- examples/bulk_classification.md
- blog/posts/learn-async.md
summary: "This blog post explores how LangChain's LangSmith can be integrated with\
\ the OpenAI client to enhance functionality through seamless LLM observability.\
\ By wrapping the OpenAI client with LangSmith and using the `instructor` package,\
\ developers can improve their LLM applications by enabling features such as question\
\ classification and asynchronous processing with `asyncio`. The article provides\
\ a step-by-step guide on setting up LangSmith, installing necessary SDKs, and\
\ implementing multi-label classification of questions using Python. It highlights\
\ LangSmith\u2019s capabilities as a DevOps platform for developing, collaborating,\
\ deploying, and monitoring language model applications. Key points include the\
\ use of `wrap_openai`, rate limiting via `asyncio.Semaphore`, and customizing\
\ the classification prompt to fit specific use cases."
blog/posts/learn-async.md:
ai_references:
- '[../concepts/error_handling.md'
- ../concepts/retrying.md
- https://docs.python.org/3/library/asyncio.html
- https://realpython.com/async-io-python/
- https://python.useinstructor.com
- https://platform.openai.com/docs/guides/async]
cross_links:
- concepts/error_handling.md
- concepts/retrying.md
hash: 510b01ac35458a0b82a7f5055913fb4f
keywords:
- '[asyncio'
- asyncio.gather
- asyncio.as_completed
- Python
- LLM processing
- concurrent processing
- async programming
- rate limiting
- performance optimization]
references:
- blog/concepts/error_handling.md
- blog/concepts/retrying.md
summary: This documentation provides an in-depth guide on using Python's asyncio.gather
and asyncio.as_completed for efficient concurrent processing of Large Language
Models (LLMs). It covers various async programming patterns, rate limiting techniques,
and performance optimization strategies vital for AI applications.
topics:
- '[asyncio methods'
- concurrent execution
- performance comparison
- rate-limited processing
- error handling]
blog/posts/llm-as-reranker.md:
ai_references:
- '[rag-and-beyond'
- validation-part1
- logfire]
cross_links:
- blog/posts/validation-part1.md
hash: 67f340dc144300698dca7905ebdefc6b
keywords:
- '[LLM'
- Pydantic
- Instructor
- Search Relevance
- Reranking
- Retrieval-Augmented Generation
- synthetic data
- evaluation pipeline]
references:
- blog/posts/rag-and-beyond/index.md
- blog/posts/validation-part1/index.md
- blog/posts/logfire/index.md
summary: This blog post guides you through creating an LLM-based reranker using
Instructor and Pydantic for enhancing search results relevance in Retrieval-Augmented
Generation (RAG) pipelines. By utilizing structured outputs and large language
models, you will learn to label synthetic data for fine-tuning and build an accurate
evaluation pipeline.
topics:
- '[Setting Up the Environment'
- Defining the Reranking Models
- Creating the Reranker Function
- Testing the Reranker]
blog/posts/llms-txt-adoption.md:
ai_references:
- '[llms.txt specification](https://github.com/AnswerDotAI/llms-txt)'
- '[standard format](https://github.com/AnswerDotAI/llms-txt#format)'
- '[GitHub](https://github.com/instructor-ai/instructor)'
- '[Twitter](https://x.com/jxnl.co)'
cross_links: []
hash: 4c6baf0df522771e1991d14f88965af2
keywords:
- llms.txt
- AI language models
- documentation accessibility
- Instructor
- coding assistants
- standardization
- markdown
- implementation
references: []
summary: Instructor has adopted the llms.txt specification to enhance the accessibility
of its documentation for AI language models. This implementation allows AI tools
to better interpret and navigate the documentation, resulting in improved code
suggestions and a cleaner access experience for users.
topics:
- llms.txt specification
- AI-documentation interaction
- benefits of llms.txt
- implementation guidelines
- future of AI in coding
blog/posts/logfire.md:
cross_links: []
hash: 7ce79e21910ace0347fba9fd9615cfca
references: []
summary: The article introduces **Logfire**, an observability platform developed
by the creators of **Pydantic**, which integrates seamlessly with libraries like
**HTTPx** and **Instructor**. It demonstrates how Logfire can enhance application
performance tracking through examples such as spam email classification, validation
using `llm_validator`, and data extraction from images with **GPT-4V**. The guide
details how to set up and use these features with Logfire, emphasizing its ease
of integration, efficient logging capabilities, and ability to provide in-depth
insights into application processes. Core components include **OpenAI**, **Logfire**,
**LLM Observability**, and integration with Pydantic.
blog/posts/matching-language.md:
ai_references: []
cross_links: []
hash: d3478db3ed6545cb29034b23ad22a955
keywords:
- '[multilingual summarization'
- language detection
- Pydantic
- langdetect
- language models
- data validation
- summaries
- language match
- AI
- machine learning]
references: []
summary: This documentation explores methods to ensure that language models generate
summaries in the same language as the source text, leveraging Pydantic for validation
and langdetect for language identification. By integrating these techniques, the
accuracy of multilingual summarization improves significantly.
topics:
- '[language model optimization'
- summary generation
- language detection methods
- Pydantic usage
- multilingual data handling]
blog/posts/migrating-to-uv.md:
cross_links: []
hash: 226ee4a165a8d84023029357089b8443
references: []
summary: This article details the migration from Poetry to UV for dependency management
and build automation in a Python project. The author highlights UV's faster CI/CD
performance, automatic caching, cargo-style lockfiles, and easier adoption of
new PEP features. The article provides a step-by-step guide to converting Poetry
lockfiles using UV, updating build configurations to use hatchling, and modifying
GitHub Actions workflows to implement UV commands like `uv sync` and `uv run`.
Overall, the transition resulted in a ~3x speed increase in CI jobs, simplifying
dependency management and enhancing development efficiency. Keywords include UV,
Poetry migration, dependency management, CI/CD speedup, Python, build automation,
UV lockfile, GitHub actions.
blog/posts/multimodal-gemini.md:
ai_references:
- '[concepts/multimodal'
- concepts/images
- integrations/google
- openai-multimodal
- structured-output-anthropic
- chat-with-your-pdf-with-gemini]
cross_links:
- blog/posts/openai-multimodal.md
- blog/posts/structured-output-anthropic.md
- integrations/google.md
hash: 4d4d4773381b446dfd30f7438ec93e7a
keywords:
- '[Gemini'
- Multimodal AI
- Travel Recommendations
- Pydantic
- Python
- Video Analysis
- Structured Extraction
- Recommendations]
references:
- blog/posts/concepts/multimodal/index.md
- blog/posts/concepts/images/index.md
- blog/posts/integrations/google/index.md
- blog/posts/openai-multimodal/index.md
- blog/posts/structured-output-anthropic/index.md
- blog/posts/chat-with-your-pdf-with-gemini/index.md
summary: This documentation provides a comprehensive guide on utilizing Google's
Gemini model for multimodal structured extraction from YouTube travel videos,
enabling users to derive structured recommendations for tourist destinations.
By integrating video analysis with Pydantic data models, users can effectively
extract and organize travel information for enhanced user experiences.
topics:
- '[Gemini Model'
- Video Processing
- Pydantic Data Models
- Travel Recommendations
- Multimodal AI Applications]
blog/posts/open_source.md:
cross_links:
- concepts/patching.md
- integrations/groq.md
- integrations/llama-cpp-python.md
- integrations/mistral.md
- integrations/ollama.md
- integrations/together.md
hash: b3cb29bb72d1746982e2bb01087f8cdf
references:
- integrations/llama-cpp-python.md
- concepts/patching.md
- integrations/ollama.md
- integrations/groq.md
- integrations/together.md
- concepts/patching.md
- integrations/mistral.md
summary: This article explores Instructor's enhanced capabilities for integrating
with a variety of open source and local large language models (LLMs), including
OpenAI, Ollama, llama-cpp-python, Groq, Together AI, and Mistral. It highlights
how Instructor supports structured data extraction and outputs through JSON mode
and JSON schema, utilizing Pydantic for data validation. Key features include
model patching, multi-platform compatibility, and simplified API interactions
for in-process and remote models. The content emphasizes adaptability in AI workflows,
offering practical code examples for implementing structured outputs with different
providers, aiming to streamline AI development and improve model control. Core
keywords include Instructor, structured outputs, LLMs, OpenAI, Pydantic, JSON
schema, Ollama, llama-cpp-python, Groq, Together AI, Mistral, API integration,
local models, AI development.
blog/posts/openai-distilation-store.md:
cross_links: []
hash: f192d6f81e391bb953541405d9656871
references: []
summary: OpenAI's API Model Distillation with Instructor enables developers to create
smaller, efficient, and specialized AI models tailored to specific tasks. By combining
Instructor's structured output capabilities with API Model Distillation, users
can produce validated, consistent results while reducing latency and costs. The
integration supports metadata, proxy kwargs, and seamlessly leverages OpenAI's
API parameters, enhancing workflow flexibility. This approach improves model efficiency,
precision, and scalability for AI applications, making it ideal for personalized
and high-performance implementations. Key words include API Model Distillation,
Instructor, openAI, structured output, model optimization, AI efficiency, and
customized AI models.
blog/posts/openai-multimodal.md:
ai_references:
- '[Multimodal Guide](/concepts/multimodal)'