@synsci/cli-darwin-x64 1.1.70 → 1.1.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/skills/citation-management/SKILL.md +1109 -0
- package/bin/skills/citation-management/assets/bibtex_template.bib +264 -0
- package/bin/skills/citation-management/assets/citation_checklist.md +386 -0
- package/bin/skills/citation-management/references/bibtex_formatting.md +908 -0
- package/bin/skills/citation-management/references/citation_validation.md +794 -0
- package/bin/skills/citation-management/references/google_scholar_search.md +725 -0
- package/bin/skills/citation-management/references/metadata_extraction.md +870 -0
- package/bin/skills/citation-management/references/pubmed_search.md +839 -0
- package/bin/skills/citation-management/scripts/doi_to_bibtex.py +182 -0
- package/bin/skills/citation-management/scripts/extract_metadata.py +570 -0
- package/bin/skills/citation-management/scripts/format_bibtex.py +349 -0
- package/bin/skills/citation-management/scripts/search_google_scholar.py +251 -0
- package/bin/skills/citation-management/scripts/search_pubmed.py +348 -0
- package/bin/skills/citation-management/scripts/validate_citations.py +494 -0
- package/bin/skills/clinical-decision-support/README.md +129 -0
- package/bin/skills/clinical-decision-support/SKILL.md +506 -0
- package/bin/skills/clinical-decision-support/assets/biomarker_report_template.tex +380 -0
- package/bin/skills/clinical-decision-support/assets/clinical_pathway_template.tex +222 -0
- package/bin/skills/clinical-decision-support/assets/cohort_analysis_template.tex +359 -0
- package/bin/skills/clinical-decision-support/assets/color_schemes.tex +149 -0
- package/bin/skills/clinical-decision-support/assets/example_gbm_cohort.md +208 -0
- package/bin/skills/clinical-decision-support/assets/recommendation_strength_guide.md +328 -0
- package/bin/skills/clinical-decision-support/assets/treatment_recommendation_template.tex +529 -0
- package/bin/skills/clinical-decision-support/references/biomarker_classification.md +719 -0
- package/bin/skills/clinical-decision-support/references/clinical_decision_algorithms.md +604 -0
- package/bin/skills/clinical-decision-support/references/evidence_synthesis.md +840 -0
- package/bin/skills/clinical-decision-support/references/outcome_analysis.md +640 -0
- package/bin/skills/clinical-decision-support/references/patient_cohort_analysis.md +427 -0
- package/bin/skills/clinical-decision-support/references/treatment_recommendations.md +521 -0
- package/bin/skills/clinical-decision-support/scripts/biomarker_classifier.py +383 -0
- package/bin/skills/clinical-decision-support/scripts/build_decision_tree.py +417 -0
- package/bin/skills/clinical-decision-support/scripts/create_cohort_tables.py +509 -0
- package/bin/skills/clinical-decision-support/scripts/generate_survival_analysis.py +441 -0
- package/bin/skills/clinical-decision-support/scripts/validate_cds_document.py +326 -0
- package/bin/skills/clinical-reports/IMPLEMENTATION_SUMMARY.md +641 -0
- package/bin/skills/clinical-reports/README.md +236 -0
- package/bin/skills/clinical-reports/SKILL.md +1127 -0
- package/bin/skills/clinical-reports/assets/case_report_template.md +352 -0
- package/bin/skills/clinical-reports/assets/clinical_trial_csr_template.md +353 -0
- package/bin/skills/clinical-reports/assets/clinical_trial_sae_template.md +359 -0
- package/bin/skills/clinical-reports/assets/consult_note_template.md +305 -0
- package/bin/skills/clinical-reports/assets/discharge_summary_template.md +453 -0
- package/bin/skills/clinical-reports/assets/hipaa_compliance_checklist.md +395 -0
- package/bin/skills/clinical-reports/assets/history_physical_template.md +305 -0
- package/bin/skills/clinical-reports/assets/lab_report_template.md +309 -0
- package/bin/skills/clinical-reports/assets/pathology_report_template.md +249 -0
- package/bin/skills/clinical-reports/assets/quality_checklist.md +338 -0
- package/bin/skills/clinical-reports/assets/radiology_report_template.md +318 -0
- package/bin/skills/clinical-reports/assets/soap_note_template.md +253 -0
- package/bin/skills/clinical-reports/references/case_report_guidelines.md +570 -0
- package/bin/skills/clinical-reports/references/clinical_trial_reporting.md +693 -0
- package/bin/skills/clinical-reports/references/data_presentation.md +530 -0
- package/bin/skills/clinical-reports/references/diagnostic_reports_standards.md +629 -0
- package/bin/skills/clinical-reports/references/medical_terminology.md +588 -0
- package/bin/skills/clinical-reports/references/patient_documentation.md +744 -0
- package/bin/skills/clinical-reports/references/peer_review_standards.md +585 -0
- package/bin/skills/clinical-reports/references/regulatory_compliance.md +577 -0
- package/bin/skills/clinical-reports/scripts/check_deidentification.py +332 -0
- package/bin/skills/clinical-reports/scripts/compliance_checker.py +78 -0
- package/bin/skills/clinical-reports/scripts/extract_clinical_data.py +97 -0
- package/bin/skills/clinical-reports/scripts/format_adverse_events.py +97 -0
- package/bin/skills/clinical-reports/scripts/generate_report_template.py +149 -0
- package/bin/skills/clinical-reports/scripts/terminology_validator.py +126 -0
- package/bin/skills/clinical-reports/scripts/validate_case_report.py +323 -0
- package/bin/skills/clinical-reports/scripts/validate_trial_report.py +88 -0
- package/bin/skills/fireworks-ai/SKILL.md +665 -0
- package/bin/skills/generate-image/SKILL.md +178 -0
- package/bin/skills/generate-image/scripts/generate_image.py +254 -0
- package/bin/skills/groq/SKILL.md +347 -0
- package/bin/skills/hypothesis-generation/SKILL.md +293 -0
- package/bin/skills/hypothesis-generation/assets/FORMATTING_GUIDE.md +672 -0
- package/bin/skills/hypothesis-generation/assets/hypothesis_generation.sty +307 -0
- package/bin/skills/hypothesis-generation/assets/hypothesis_report_template.tex +572 -0
- package/bin/skills/hypothesis-generation/references/experimental_design_patterns.md +329 -0
- package/bin/skills/hypothesis-generation/references/hypothesis_quality_criteria.md +198 -0
- package/bin/skills/hypothesis-generation/references/literature_search_strategies.md +622 -0
- package/bin/skills/latex-posters/README.md +417 -0
- package/bin/skills/latex-posters/SKILL.md +1602 -0
- package/bin/skills/latex-posters/assets/baposter_template.tex +257 -0
- package/bin/skills/latex-posters/assets/beamerposter_template.tex +244 -0
- package/bin/skills/latex-posters/assets/poster_quality_checklist.md +358 -0
- package/bin/skills/latex-posters/assets/tikzposter_template.tex +251 -0
- package/bin/skills/latex-posters/references/latex_poster_packages.md +745 -0
- package/bin/skills/latex-posters/references/poster_content_guide.md +748 -0
- package/bin/skills/latex-posters/references/poster_design_principles.md +806 -0
- package/bin/skills/latex-posters/references/poster_layout_design.md +900 -0
- package/bin/skills/latex-posters/scripts/review_poster.sh +214 -0
- package/bin/skills/literature-review/SKILL.md +641 -0
- package/bin/skills/literature-review/assets/review_template.md +412 -0
- package/bin/skills/literature-review/references/citation_styles.md +166 -0
- package/bin/skills/literature-review/references/database_strategies.md +455 -0
- package/bin/skills/literature-review/scripts/generate_pdf.py +184 -0
- package/bin/skills/literature-review/scripts/search_databases.py +310 -0
- package/bin/skills/literature-review/scripts/verify_citations.py +218 -0
- package/bin/skills/market-research-reports/SKILL.md +904 -0
- package/bin/skills/market-research-reports/assets/FORMATTING_GUIDE.md +428 -0
- package/bin/skills/market-research-reports/assets/market_report_template.tex +1380 -0
- package/bin/skills/market-research-reports/assets/market_research.sty +564 -0
- package/bin/skills/market-research-reports/references/data_analysis_patterns.md +548 -0
- package/bin/skills/market-research-reports/references/report_structure_guide.md +999 -0
- package/bin/skills/market-research-reports/references/visual_generation_guide.md +1077 -0
- package/bin/skills/market-research-reports/scripts/generate_market_visuals.py +472 -0
- package/bin/skills/markitdown/INSTALLATION_GUIDE.md +318 -0
- package/bin/skills/markitdown/LICENSE.txt +22 -0
- package/bin/skills/markitdown/OPENROUTER_INTEGRATION.md +359 -0
- package/bin/skills/markitdown/QUICK_REFERENCE.md +309 -0
- package/bin/skills/markitdown/README.md +184 -0
- package/bin/skills/markitdown/SKILL.md +486 -0
- package/bin/skills/markitdown/SKILL_SUMMARY.md +307 -0
- package/bin/skills/markitdown/assets/example_usage.md +463 -0
- package/bin/skills/markitdown/references/api_reference.md +399 -0
- package/bin/skills/markitdown/references/file_formats.md +542 -0
- package/bin/skills/markitdown/scripts/batch_convert.py +195 -0
- package/bin/skills/markitdown/scripts/convert_literature.py +262 -0
- package/bin/skills/markitdown/scripts/convert_with_ai.py +224 -0
- package/bin/skills/ml-paper-writing/SKILL.md +937 -0
- package/bin/skills/ml-paper-writing/references/checklists.md +361 -0
- package/bin/skills/ml-paper-writing/references/citation-workflow.md +562 -0
- package/bin/skills/ml-paper-writing/references/reviewer-guidelines.md +367 -0
- package/bin/skills/ml-paper-writing/references/sources.md +159 -0
- package/bin/skills/ml-paper-writing/references/writing-guide.md +476 -0
- package/bin/skills/ml-paper-writing/templates/README.md +251 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/README.md +534 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026-unified-supp.tex +144 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026-unified-template.tex +952 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026.bib +111 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026.bst +1493 -0
- package/bin/skills/ml-paper-writing/templates/aaai2026/aaai2026.sty +315 -0
- package/bin/skills/ml-paper-writing/templates/acl/README.md +50 -0
- package/bin/skills/ml-paper-writing/templates/acl/acl.sty +312 -0
- package/bin/skills/ml-paper-writing/templates/acl/acl_latex.tex +377 -0
- package/bin/skills/ml-paper-writing/templates/acl/acl_lualatex.tex +101 -0
- package/bin/skills/ml-paper-writing/templates/acl/acl_natbib.bst +1940 -0
- package/bin/skills/ml-paper-writing/templates/acl/anthology.bib.txt +26 -0
- package/bin/skills/ml-paper-writing/templates/acl/custom.bib +70 -0
- package/bin/skills/ml-paper-writing/templates/acl/formatting.md +326 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/README.md +3 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.bib +11 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.bst +1440 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.pdf +0 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.sty +218 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/colm2025_conference.tex +305 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/fancyhdr.sty +485 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/math_commands.tex +508 -0
- package/bin/skills/ml-paper-writing/templates/colm2025/natbib.sty +1246 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/fancyhdr.sty +485 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.bib +24 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.bst +1440 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.pdf +0 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.sty +246 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/iclr2026_conference.tex +414 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/math_commands.tex +508 -0
- package/bin/skills/ml-paper-writing/templates/iclr2026/natbib.sty +1246 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/algorithm.sty +79 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/algorithmic.sty +201 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/example_paper.bib +75 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/example_paper.pdf +0 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/example_paper.tex +662 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/fancyhdr.sty +864 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/icml2026.bst +1443 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/icml2026.sty +767 -0
- package/bin/skills/ml-paper-writing/templates/icml2026/icml_numpapers.pdf +0 -0
- package/bin/skills/ml-paper-writing/templates/neurips2025/Makefile +36 -0
- package/bin/skills/ml-paper-writing/templates/neurips2025/extra_pkgs.tex +53 -0
- package/bin/skills/ml-paper-writing/templates/neurips2025/main.tex +38 -0
- package/bin/skills/ml-paper-writing/templates/neurips2025/neurips.sty +382 -0
- package/bin/skills/paper-2-web/SKILL.md +491 -0
- package/bin/skills/paper-2-web/references/installation.md +141 -0
- package/bin/skills/paper-2-web/references/paper2poster.md +346 -0
- package/bin/skills/paper-2-web/references/paper2video.md +305 -0
- package/bin/skills/paper-2-web/references/paper2web.md +187 -0
- package/bin/skills/paper-2-web/references/usage_examples.md +436 -0
- package/bin/skills/peer-review/SKILL.md +702 -0
- package/bin/skills/peer-review/references/calibration_guidelines.md +196 -0
- package/bin/skills/peer-review/references/common_issues.md +552 -0
- package/bin/skills/peer-review/references/paper_mechanics.md +269 -0
- package/bin/skills/peer-review/references/reporting_standards.md +290 -0
- package/bin/skills/peer-review/references/scoring_rubric.md +239 -0
- package/bin/skills/pptx-posters/SKILL.md +410 -0
- package/bin/skills/pptx-posters/assets/poster_html_template.html +257 -0
- package/bin/skills/pptx-posters/assets/poster_quality_checklist.md +358 -0
- package/bin/skills/pptx-posters/references/poster_content_guide.md +748 -0
- package/bin/skills/pptx-posters/references/poster_design_principles.md +806 -0
- package/bin/skills/pptx-posters/references/poster_layout_design.md +900 -0
- package/bin/skills/research-grants/README.md +285 -0
- package/bin/skills/research-grants/SKILL.md +938 -0
- package/bin/skills/research-grants/assets/budget_justification_template.md +453 -0
- package/bin/skills/research-grants/assets/nih_specific_aims_template.md +166 -0
- package/bin/skills/research-grants/assets/nsf_project_summary_template.md +92 -0
- package/bin/skills/research-grants/references/broader_impacts.md +392 -0
- package/bin/skills/research-grants/references/darpa_guidelines.md +636 -0
- package/bin/skills/research-grants/references/doe_guidelines.md +586 -0
- package/bin/skills/research-grants/references/nih_guidelines.md +851 -0
- package/bin/skills/research-grants/references/nsf_guidelines.md +570 -0
- package/bin/skills/research-grants/references/specific_aims_guide.md +458 -0
- package/bin/skills/research-lookup/README.md +156 -0
- package/bin/skills/research-lookup/SKILL.md +606 -0
- package/bin/skills/research-lookup/examples.py +174 -0
- package/bin/skills/research-lookup/lookup.py +187 -0
- package/bin/skills/research-lookup/research_lookup.py +483 -0
- package/bin/skills/research-lookup/scripts/research_lookup.py +483 -0
- package/bin/skills/scholar-evaluation/SKILL.md +289 -0
- package/bin/skills/scholar-evaluation/references/evaluation_framework.md +663 -0
- package/bin/skills/scholar-evaluation/scripts/calculate_scores.py +366 -0
- package/bin/skills/scientific-critical-thinking/SKILL.md +566 -0
- package/bin/skills/scientific-critical-thinking/references/common_biases.md +364 -0
- package/bin/skills/scientific-critical-thinking/references/evidence_hierarchy.md +484 -0
- package/bin/skills/scientific-critical-thinking/references/experimental_design.md +496 -0
- package/bin/skills/scientific-critical-thinking/references/logical_fallacies.md +478 -0
- package/bin/skills/scientific-critical-thinking/references/scientific_method.md +169 -0
- package/bin/skills/scientific-critical-thinking/references/statistical_pitfalls.md +506 -0
- package/bin/skills/scientific-schematics/QUICK_REFERENCE.md +207 -0
- package/bin/skills/scientific-schematics/README.md +327 -0
- package/bin/skills/scientific-schematics/SKILL.md +615 -0
- package/bin/skills/scientific-schematics/example_usage.sh +89 -0
- package/bin/skills/scientific-schematics/references/best_practices.md +559 -0
- package/bin/skills/scientific-schematics/scripts/generate_schematic.py +135 -0
- package/bin/skills/scientific-schematics/scripts/generate_schematic_ai.py +807 -0
- package/bin/skills/scientific-schematics/test_ai_generation.py +243 -0
- package/bin/skills/scientific-slides/SKILL.md +942 -0
- package/bin/skills/scientific-slides/assets/timing_guidelines.md +597 -0
- package/bin/skills/scientific-slides/references/data_visualization_slides.md +708 -0
- package/bin/skills/scientific-slides/references/presentation_structure.md +642 -0
- package/bin/skills/scientific-slides/references/slide_design_principles.md +849 -0
- package/bin/skills/scientific-slides/references/talk_types_guide.md +687 -0
- package/bin/skills/scientific-slides/references/visual_review_workflow.md +775 -0
- package/bin/skills/scientific-slides/scripts/generate_slide_image.py +143 -0
- package/bin/skills/scientific-slides/scripts/generate_slide_image_ai.py +748 -0
- package/bin/skills/scientific-slides/scripts/pdf_to_images.py +201 -0
- package/bin/skills/scientific-slides/scripts/slides_to_pdf.py +220 -0
- package/bin/skills/scientific-slides/scripts/validate_presentation.py +367 -0
- package/bin/skills/scientific-writing/SKILL.md +714 -0
- package/bin/skills/scientific-writing/assets/REPORT_FORMATTING_GUIDE.md +574 -0
- package/bin/skills/scientific-writing/assets/scientific_report.sty +606 -0
- package/bin/skills/scientific-writing/assets/scientific_report_template.tex +449 -0
- package/bin/skills/scientific-writing/references/citation_styles.md +720 -0
- package/bin/skills/scientific-writing/references/figures_tables.md +806 -0
- package/bin/skills/scientific-writing/references/imrad_structure.md +686 -0
- package/bin/skills/scientific-writing/references/professional_report_formatting.md +664 -0
- package/bin/skills/scientific-writing/references/reporting_guidelines.md +748 -0
- package/bin/skills/scientific-writing/references/writing_principles.md +824 -0
- package/bin/skills/tinker/SKILL.md +2 -3
- package/bin/skills/together-ai/SKILL.md +722 -0
- package/bin/skills/treatment-plans/README.md +488 -0
- package/bin/skills/treatment-plans/SKILL.md +1579 -0
- package/bin/skills/treatment-plans/assets/STYLING_QUICK_REFERENCE.md +185 -0
- package/bin/skills/treatment-plans/assets/chronic_disease_management_plan.tex +665 -0
- package/bin/skills/treatment-plans/assets/general_medical_treatment_plan.tex +547 -0
- package/bin/skills/treatment-plans/assets/medical_treatment_plan.sty +222 -0
- package/bin/skills/treatment-plans/assets/mental_health_treatment_plan.tex +774 -0
- package/bin/skills/treatment-plans/assets/one_page_treatment_plan.tex +193 -0
- package/bin/skills/treatment-plans/assets/pain_management_plan.tex +799 -0
- package/bin/skills/treatment-plans/assets/perioperative_care_plan.tex +753 -0
- package/bin/skills/treatment-plans/assets/quality_checklist.md +471 -0
- package/bin/skills/treatment-plans/assets/rehabilitation_treatment_plan.tex +756 -0
- package/bin/skills/treatment-plans/references/goal_setting_frameworks.md +411 -0
- package/bin/skills/treatment-plans/references/intervention_guidelines.md +507 -0
- package/bin/skills/treatment-plans/references/regulatory_compliance.md +476 -0
- package/bin/skills/treatment-plans/references/specialty_specific_guidelines.md +655 -0
- package/bin/skills/treatment-plans/references/treatment_plan_standards.md +485 -0
- package/bin/skills/treatment-plans/scripts/check_completeness.py +322 -0
- package/bin/skills/treatment-plans/scripts/generate_template.py +233 -0
- package/bin/skills/treatment-plans/scripts/timeline_generator.py +385 -0
- package/bin/skills/treatment-plans/scripts/validate_treatment_plan.py +369 -0
- package/bin/skills/unsloth/SKILL.md +565 -47
- package/bin/skills/unsloth/docs/advanced-rl.md +222 -0
- package/bin/skills/unsloth/docs/chat-templates.md +141 -0
- package/bin/skills/unsloth/docs/datasets.md +489 -0
- package/bin/skills/unsloth/docs/docker-extended.md +99 -0
- package/bin/skills/unsloth/docs/dynamic-ggufs-2.0.md +116 -0
- package/bin/skills/unsloth/docs/dynamic-ggufs-aider.md +118 -0
- package/bin/skills/unsloth/docs/faq.md +91 -0
- package/bin/skills/unsloth/docs/fp16-vs-bf16.md +61 -0
- package/bin/skills/unsloth/docs/fp8-rl.md +224 -0
- package/bin/skills/unsloth/docs/glm-4.7-flash.md +997 -0
- package/bin/skills/unsloth/docs/inference-deployment-overview.md +17 -0
- package/bin/skills/unsloth/docs/inference.md +27 -0
- package/bin/skills/unsloth/docs/installation-docker.md +155 -0
- package/bin/skills/unsloth/docs/installation-pip.md +148 -0
- package/bin/skills/unsloth/docs/kernels-packing.md +190 -0
- package/bin/skills/unsloth/docs/kimi-k2.5.md +634 -0
- package/bin/skills/unsloth/docs/lm-studio.md +235 -0
- package/bin/skills/unsloth/docs/lora-hot-swapping.md +75 -0
- package/bin/skills/unsloth/docs/lora-hyperparameters.md +363 -0
- package/bin/skills/unsloth/docs/memory-efficient-rl.md +267 -0
- package/bin/skills/unsloth/docs/model-selection.md +70 -0
- package/bin/skills/unsloth/docs/models.md +532 -0
- package/bin/skills/unsloth/docs/multi-gpu-ddp.md +90 -0
- package/bin/skills/unsloth/docs/notebooks.md +223 -0
- package/bin/skills/unsloth/docs/overview.md +110 -0
- package/bin/skills/unsloth/docs/qwen3-coder-next-extended.md +900 -0
- package/bin/skills/unsloth/docs/qwen3-coder-next.md +900 -0
- package/bin/skills/unsloth/docs/requirements.md +45 -0
- package/bin/skills/unsloth/docs/reward-hacking.md +25 -0
- package/bin/skills/unsloth/docs/saving-to-gguf.md +138 -0
- package/bin/skills/unsloth/docs/saving-to-ollama.md +46 -0
- package/bin/skills/unsloth/docs/sglang-guide.md +278 -0
- package/bin/skills/unsloth/docs/speculative-decoding.md +70 -0
- package/bin/skills/unsloth/docs/tool-calling.md +334 -0
- package/bin/skills/unsloth/docs/troubleshooting-faq.md +204 -0
- package/bin/skills/unsloth/docs/troubleshooting-inference.md +26 -0
- package/bin/skills/unsloth/docs/tts-fine-tuning.md +149 -0
- package/bin/skills/unsloth/docs/tutorial-grpo.md +273 -0
- package/bin/skills/unsloth/docs/tutorial-llama3-ollama.md +356 -0
- package/bin/skills/unsloth/docs/vision-fine-tuning.md +135 -0
- package/bin/skills/unsloth/docs/vision-rl.md +170 -0
- package/bin/skills/unsloth/docs/vllm-engine-arguments.md +43 -0
- package/bin/skills/unsloth/docs/vllm-guide.md +98 -0
- package/bin/skills/venue-templates/SKILL.md +686 -0
- package/bin/skills/venue-templates/assets/examples/cell_summary_example.md +247 -0
- package/bin/skills/venue-templates/assets/examples/medical_structured_abstract.md +313 -0
- package/bin/skills/venue-templates/assets/examples/nature_abstract_examples.md +213 -0
- package/bin/skills/venue-templates/assets/examples/neurips_introduction_example.md +245 -0
- package/bin/skills/venue-templates/assets/grants/nih_specific_aims.tex +235 -0
- package/bin/skills/venue-templates/assets/grants/nsf_proposal_template.tex +375 -0
- package/bin/skills/venue-templates/assets/journals/nature_article.tex +171 -0
- package/bin/skills/venue-templates/assets/journals/neurips_article.tex +283 -0
- package/bin/skills/venue-templates/assets/journals/plos_one.tex +317 -0
- package/bin/skills/venue-templates/assets/posters/beamerposter_academic.tex +311 -0
- package/bin/skills/venue-templates/references/cell_press_style.md +483 -0
- package/bin/skills/venue-templates/references/conferences_formatting.md +564 -0
- package/bin/skills/venue-templates/references/cs_conference_style.md +463 -0
- package/bin/skills/venue-templates/references/grants_requirements.md +787 -0
- package/bin/skills/venue-templates/references/journals_formatting.md +486 -0
- package/bin/skills/venue-templates/references/medical_journal_styles.md +535 -0
- package/bin/skills/venue-templates/references/ml_conference_style.md +556 -0
- package/bin/skills/venue-templates/references/nature_science_style.md +405 -0
- package/bin/skills/venue-templates/references/posters_guidelines.md +628 -0
- package/bin/skills/venue-templates/references/reviewer_expectations.md +417 -0
- package/bin/skills/venue-templates/references/venue_writing_styles.md +321 -0
- package/bin/skills/venue-templates/scripts/customize_template.py +195 -0
- package/bin/skills/venue-templates/scripts/query_template.py +266 -0
- package/bin/skills/venue-templates/scripts/validate_format.py +250 -0
- package/bin/synsc +0 -0
- package/package.json +1 -1
- package/bin/skills/unsloth/references/index.md +0 -7
- package/bin/skills/unsloth/references/llms-full.md +0 -16799
- package/bin/skills/unsloth/references/llms-txt.md +0 -12044
- package/bin/skills/unsloth/references/llms.md +0 -82
|
@@ -0,0 +1,722 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: together-ai-inference
|
|
3
|
+
description: Serverless inference, fine-tuning, embeddings, image generation, and batch processing on 200+ open-source models via an OpenAI-compatible API. Use when you need fast, cost-effective access to open-source LLMs without managing infrastructure.
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
author: Synthetic Sciences
|
|
6
|
+
license: MIT
|
|
7
|
+
tags: [Inference, Together AI, Fine-Tuning, Embeddings, Serverless, OpenAI-Compatible, Batch, Image Generation]
|
|
8
|
+
dependencies: [together, openai]
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# Together AI — Serverless Inference & Fine-Tuning
|
|
12
|
+
|
|
13
|
+
Together AI is an AI cloud platform providing serverless inference on 200+ open-source models through an OpenAI-compatible API. It supports chat completions, embeddings, fine-tuning, image generation, and batch processing at `https://api.together.xyz/v1`.
|
|
14
|
+
|
|
15
|
+
## When to Use Together AI
|
|
16
|
+
|
|
17
|
+
**Use Together AI when:**
|
|
18
|
+
- You need fast serverless inference on open-source models (Llama, DeepSeek, Qwen, Mistral)
|
|
19
|
+
- You want an OpenAI-compatible API so you can swap providers with a single line change
|
|
20
|
+
- You need to fine-tune open-source models without managing GPU infrastructure
|
|
21
|
+
- You want cost-effective inference with pay-per-token pricing
|
|
22
|
+
- You need function calling, JSON mode, or structured outputs from open-source models
|
|
23
|
+
- You want batch processing at 50% lower cost for non-urgent workloads
|
|
24
|
+
- You need embeddings or image generation alongside chat completions
|
|
25
|
+
|
|
26
|
+
**Use alternatives instead:**
|
|
27
|
+
|
|
28
|
+
| Need | Use Instead |
|
|
29
|
+
|------|-------------|
|
|
30
|
+
| Managed LoRA fine-tuning with training platform | **Tinker** |
|
|
31
|
+
| Self-hosted inference with full control | **vLLM**, **TensorRT-LLM** |
|
|
32
|
+
| Dedicated GPU instances | **Lambda Labs**, **RunPod** |
|
|
33
|
+
| Serverless GPU with custom containers | **Modal** |
|
|
34
|
+
| Multi-cloud cost optimization | **SkyPilot** |
|
|
35
|
+
| Proprietary models (GPT-4o, Claude) | **OpenAI**, **Anthropic** directly |
|
|
36
|
+
|
|
37
|
+
## Quick Start
|
|
38
|
+
|
|
39
|
+
### Install
|
|
40
|
+
|
|
41
|
+
```python
|
|
42
|
+
pip install together openai
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Set API Key
|
|
46
|
+
|
|
47
|
+
```python
|
|
48
|
+
import os
|
|
49
|
+
os.environ["TOGETHER_API_KEY"] = "your-api-key"
|
|
50
|
+
|
|
51
|
+
# Or export in shell:
|
|
52
|
+
# export TOGETHER_API_KEY="your-api-key"
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
Get your API key from https://api.together.xyz/settings/api-keys
|
|
56
|
+
|
|
57
|
+
### Basic Chat Completion
|
|
58
|
+
|
|
59
|
+
```python
|
|
60
|
+
from together import Together
|
|
61
|
+
|
|
62
|
+
client = Together()
|
|
63
|
+
|
|
64
|
+
response = client.chat.completions.create(
|
|
65
|
+
model="meta-llama/Llama-3.3-70B-Instruct-Reference",
|
|
66
|
+
messages=[
|
|
67
|
+
{"role": "system", "content": "You are a helpful assistant."},
|
|
68
|
+
{"role": "user", "content": "Explain gradient descent in one paragraph."},
|
|
69
|
+
],
|
|
70
|
+
max_tokens=256,
|
|
71
|
+
temperature=0.7,
|
|
72
|
+
)
|
|
73
|
+
|
|
74
|
+
print(response.choices[0].message.content)
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Inference
|
|
78
|
+
|
|
79
|
+
### Chat Completions
|
|
80
|
+
|
|
81
|
+
The primary endpoint for conversational AI. Supports system/user/assistant messages, temperature, top_p, top_k, repetition_penalty, and stop sequences.
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
from together import Together
|
|
85
|
+
|
|
86
|
+
client = Together()
|
|
87
|
+
|
|
88
|
+
response = client.chat.completions.create(
|
|
89
|
+
model="deepseek-ai/DeepSeek-V3",
|
|
90
|
+
messages=[
|
|
91
|
+
{"role": "system", "content": "You are an expert ML researcher."},
|
|
92
|
+
{"role": "user", "content": "Compare LoRA vs full fine-tuning."},
|
|
93
|
+
],
|
|
94
|
+
max_tokens=512,
|
|
95
|
+
temperature=0.7,
|
|
96
|
+
top_p=0.9,
|
|
97
|
+
top_k=50,
|
|
98
|
+
repetition_penalty=1.1,
|
|
99
|
+
stop=["</s>"],
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
print(response.choices[0].message.content)
|
|
103
|
+
print(f"Tokens used: {response.usage.total_tokens}")
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### Streaming
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
from together import Together
|
|
110
|
+
|
|
111
|
+
client = Together()
|
|
112
|
+
|
|
113
|
+
stream = client.chat.completions.create(
|
|
114
|
+
model="meta-llama/Llama-3.3-70B-Instruct-Reference",
|
|
115
|
+
messages=[{"role": "user", "content": "Write a haiku about transformers."}],
|
|
116
|
+
max_tokens=128,
|
|
117
|
+
stream=True,
|
|
118
|
+
)
|
|
119
|
+
|
|
120
|
+
for chunk in stream:
|
|
121
|
+
delta = chunk.choices[0].delta.content
|
|
122
|
+
if delta:
|
|
123
|
+
print(delta, end="", flush=True)
|
|
124
|
+
print()
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
### Function Calling
|
|
128
|
+
|
|
129
|
+
Supported on select models including Llama, DeepSeek, Qwen, and Mistral variants.
|
|
130
|
+
|
|
131
|
+
```python
|
|
132
|
+
from together import Together
|
|
133
|
+
import json
|
|
134
|
+
|
|
135
|
+
client = Together()
|
|
136
|
+
|
|
137
|
+
tools = [
|
|
138
|
+
{
|
|
139
|
+
"type": "function",
|
|
140
|
+
"function": {
|
|
141
|
+
"name": "get_weather",
|
|
142
|
+
"description": "Get the current weather for a location",
|
|
143
|
+
"parameters": {
|
|
144
|
+
"type": "object",
|
|
145
|
+
"properties": {
|
|
146
|
+
"location": {
|
|
147
|
+
"type": "string",
|
|
148
|
+
"description": "City and state, e.g. San Francisco, CA",
|
|
149
|
+
},
|
|
150
|
+
"unit": {
|
|
151
|
+
"type": "string",
|
|
152
|
+
"enum": ["celsius", "fahrenheit"],
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
"required": ["location"],
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
}
|
|
159
|
+
]
|
|
160
|
+
|
|
161
|
+
response = client.chat.completions.create(
|
|
162
|
+
model="meta-llama/Llama-3.3-70B-Instruct-Reference",
|
|
163
|
+
messages=[
|
|
164
|
+
{"role": "system", "content": "You are a helpful assistant."},
|
|
165
|
+
{"role": "user", "content": "What's the weather in San Francisco?"},
|
|
166
|
+
],
|
|
167
|
+
tools=tools,
|
|
168
|
+
tool_choice="auto",
|
|
169
|
+
)
|
|
170
|
+
|
|
171
|
+
tool_calls = response.choices[0].message.tool_calls
|
|
172
|
+
if tool_calls:
|
|
173
|
+
call = tool_calls[0]
|
|
174
|
+
print(f"Function: {call.function.name}")
|
|
175
|
+
print(f"Arguments: {call.function.arguments}")
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
### JSON Mode (Structured Outputs)
|
|
179
|
+
|
|
180
|
+
Force the model to return valid JSON conforming to a schema.
|
|
181
|
+
|
|
182
|
+
```python
|
|
183
|
+
import json
|
|
184
|
+
from together import Together
|
|
185
|
+
|
|
186
|
+
client = Together()
|
|
187
|
+
|
|
188
|
+
schema = {
|
|
189
|
+
"type": "object",
|
|
190
|
+
"properties": {
|
|
191
|
+
"name": {"type": "string"},
|
|
192
|
+
"age": {"type": "integer"},
|
|
193
|
+
"skills": {"type": "array", "items": {"type": "string"}},
|
|
194
|
+
},
|
|
195
|
+
"required": ["name", "age", "skills"],
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
response = client.chat.completions.create(
|
|
199
|
+
model="meta-llama/Llama-3.3-70B-Instruct-Reference",
|
|
200
|
+
messages=[
|
|
201
|
+
{
|
|
202
|
+
"role": "system",
|
|
203
|
+
"content": f"Respond only in JSON matching this schema: {json.dumps(schema)}",
|
|
204
|
+
},
|
|
205
|
+
{"role": "user", "content": "Create a profile for a senior ML engineer."},
|
|
206
|
+
],
|
|
207
|
+
response_format={
|
|
208
|
+
"type": "json_object",
|
|
209
|
+
"schema": schema,
|
|
210
|
+
},
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
data = json.loads(response.choices[0].message.content)
|
|
214
|
+
print(json.dumps(data, indent=2))
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
### Vision Models
|
|
218
|
+
|
|
219
|
+
```python
|
|
220
|
+
from together import Together
|
|
221
|
+
|
|
222
|
+
client = Together()
|
|
223
|
+
|
|
224
|
+
response = client.chat.completions.create(
|
|
225
|
+
model="meta-llama/Llama-4-Scout-17B-16E-Instruct-VLM",
|
|
226
|
+
messages=[
|
|
227
|
+
{
|
|
228
|
+
"role": "user",
|
|
229
|
+
"content": [
|
|
230
|
+
{"type": "text", "text": "Describe this image in detail."},
|
|
231
|
+
{
|
|
232
|
+
"type": "image_url",
|
|
233
|
+
"image_url": {"url": "https://example.com/image.jpg"},
|
|
234
|
+
},
|
|
235
|
+
],
|
|
236
|
+
}
|
|
237
|
+
],
|
|
238
|
+
max_tokens=512,
|
|
239
|
+
)
|
|
240
|
+
|
|
241
|
+
print(response.choices[0].message.content)
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
## Fine-Tuning
|
|
245
|
+
|
|
246
|
+
Together AI supports both LoRA and full fine-tuning on a wide range of open-source models.
|
|
247
|
+
|
|
248
|
+
### Data Format
|
|
249
|
+
|
|
250
|
+
Training data must be in JSONL format with chat-style messages:
|
|
251
|
+
|
|
252
|
+
```jsonl
|
|
253
|
+
{"messages": [{"role": "system", "content": "You are a helpful assistant."}, {"role": "user", "content": "What is the capital of France?"}, {"role": "assistant", "content": "The capital of France is Paris."}]}
|
|
254
|
+
{"messages": [{"role": "user", "content": "Explain photosynthesis."}, {"role": "assistant", "content": "Photosynthesis is the process by which plants convert sunlight, water, and carbon dioxide into glucose and oxygen."}]}
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
Each line is one training example. The `system` role is optional. The model learns to generate the `assistant` responses.
|
|
258
|
+
|
|
259
|
+
### Upload Training Data
|
|
260
|
+
|
|
261
|
+
```python
|
|
262
|
+
from together import Together
|
|
263
|
+
|
|
264
|
+
client = Together()
|
|
265
|
+
|
|
266
|
+
# Upload training file
|
|
267
|
+
file = client.files.upload(file="training_data.jsonl")
|
|
268
|
+
print(f"File ID: {file.id}")
|
|
269
|
+
```
|
|
270
|
+
|
|
271
|
+
### Create Fine-Tuning Job
|
|
272
|
+
|
|
273
|
+
```python
|
|
274
|
+
from together import Together
|
|
275
|
+
|
|
276
|
+
client = Together()
|
|
277
|
+
|
|
278
|
+
# Create LoRA fine-tuning job
|
|
279
|
+
job = client.fine_tuning.create(
|
|
280
|
+
training_file="file-abc123",
|
|
281
|
+
model="meta-llama/Llama-3.3-70B-Instruct-Reference",
|
|
282
|
+
n_epochs=3,
|
|
283
|
+
learning_rate=1e-5,
|
|
284
|
+
batch_size=4,
|
|
285
|
+
lora=True,
|
|
286
|
+
lora_r=16,
|
|
287
|
+
lora_alpha=32,
|
|
288
|
+
lora_dropout=0.05,
|
|
289
|
+
suffix="my-custom-model",
|
|
290
|
+
)
|
|
291
|
+
|
|
292
|
+
print(f"Job ID: {job.id}")
|
|
293
|
+
print(f"Status: {job.status}")
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
### Monitor Fine-Tuning
|
|
297
|
+
|
|
298
|
+
```python
|
|
299
|
+
from together import Together
|
|
300
|
+
|
|
301
|
+
client = Together()
|
|
302
|
+
|
|
303
|
+
# Check job status
|
|
304
|
+
job = client.fine_tuning.retrieve(id="ft-abc123")
|
|
305
|
+
print(f"Status: {job.status}")
|
|
306
|
+
|
|
307
|
+
# List all jobs
|
|
308
|
+
jobs = client.fine_tuning.list()
|
|
309
|
+
for j in jobs:
|
|
310
|
+
print(f"{j.id}: {j.status}")
|
|
311
|
+
|
|
312
|
+
# List events (training logs)
|
|
313
|
+
events = client.fine_tuning.list_events(id="ft-abc123")
|
|
314
|
+
for event in events:
|
|
315
|
+
print(event)
|
|
316
|
+
|
|
317
|
+
# Cancel a job
|
|
318
|
+
client.fine_tuning.cancel(id="ft-abc123")
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
### CLI Fine-Tuning
|
|
322
|
+
|
|
323
|
+
```bash
|
|
324
|
+
# Install CLI
|
|
325
|
+
pip install --upgrade together
|
|
326
|
+
|
|
327
|
+
# Upload data
|
|
328
|
+
together files upload training_data.jsonl
|
|
329
|
+
|
|
330
|
+
# Create fine-tuning job
|
|
331
|
+
together fine-tuning create \
|
|
332
|
+
--training-file file-abc123 \
|
|
333
|
+
-m meta-llama/Meta-Llama-3.1-8B-Instruct-Reference
|
|
334
|
+
|
|
335
|
+
# Check status
|
|
336
|
+
together fine-tuning status ft-abc123
|
|
337
|
+
|
|
338
|
+
# List checkpoints
|
|
339
|
+
together fine-tuning list-checkpoints ft-abc123
|
|
340
|
+
|
|
341
|
+
# Download fine-tuned model
|
|
342
|
+
together fine-tuning download --ft-id ft-abc123
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
### Supported Fine-Tuning Models (Selection)
|
|
346
|
+
|
|
347
|
+
| Model | LoRA | Full |
|
|
348
|
+
|-------|------|------|
|
|
349
|
+
| meta-llama/Meta-Llama-3.1-8B-Instruct-Reference | Yes | Yes |
|
|
350
|
+
| meta-llama/Llama-3.3-70B-Instruct-Reference | Yes | Yes |
|
|
351
|
+
| meta-llama/Llama-4-Scout-17B-16E-Instruct | Yes | No |
|
|
352
|
+
| deepseek-ai/DeepSeek-V3 | Yes | No |
|
|
353
|
+
| deepseek-ai/DeepSeek-R1 | Yes | No |
|
|
354
|
+
| Qwen/Qwen3-8B | Yes | Yes |
|
|
355
|
+
| Qwen/Qwen3-32B | Yes | Yes |
|
|
356
|
+
| Qwen/Qwen3-235B-A22B | Yes | No |
|
|
357
|
+
| google/gemma-3-27b-it | Yes | Yes |
|
|
358
|
+
| google/gemma-3-4b-it | Yes | Yes |
|
|
359
|
+
|
|
360
|
+
See the full list at https://docs.together.ai/docs/fine-tuning-models
|
|
361
|
+
|
|
362
|
+
## Embeddings
|
|
363
|
+
|
|
364
|
+
### Generate Embeddings
|
|
365
|
+
|
|
366
|
+
```python
|
|
367
|
+
from together import Together
|
|
368
|
+
|
|
369
|
+
client = Together()
|
|
370
|
+
|
|
371
|
+
response = client.embeddings.create(
|
|
372
|
+
model="BAAI/bge-large-en-v1.5",
|
|
373
|
+
input="What is the meaning of life?",
|
|
374
|
+
)
|
|
375
|
+
|
|
376
|
+
embedding = response.data[0].embedding
|
|
377
|
+
print(f"Dimensions: {len(embedding)}")
|
|
378
|
+
print(f"First 5 values: {embedding[:5]}")
|
|
379
|
+
```
|
|
380
|
+
|
|
381
|
+
### Batch Embeddings
|
|
382
|
+
|
|
383
|
+
```python
|
|
384
|
+
from together import Together
|
|
385
|
+
|
|
386
|
+
client = Together()
|
|
387
|
+
|
|
388
|
+
texts = [
|
|
389
|
+
"Machine learning is a subset of AI.",
|
|
390
|
+
"Deep learning uses neural networks.",
|
|
391
|
+
"Transformers revolutionized NLP.",
|
|
392
|
+
]
|
|
393
|
+
|
|
394
|
+
response = client.embeddings.create(
|
|
395
|
+
model="BAAI/bge-large-en-v1.5",
|
|
396
|
+
input=texts,
|
|
397
|
+
)
|
|
398
|
+
|
|
399
|
+
for i, item in enumerate(response.data):
|
|
400
|
+
print(f"Text {i}: {len(item.embedding)} dimensions")
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
### Available Embedding Models
|
|
404
|
+
|
|
405
|
+
| Model ID | Dimensions | Best For |
|
|
406
|
+
|----------|-----------|----------|
|
|
407
|
+
| `BAAI/bge-large-en-v1.5` | 1024 | General-purpose English retrieval |
|
|
408
|
+
| `BAAI/bge-base-en-v1.5` | 768 | Balanced performance and cost |
|
|
409
|
+
| `WhereIsAI/UAE-Large-V1` | 1024 | High-accuracy retrieval |
|
|
410
|
+
| `togethercomputer/m2-bert-80M-8k-retrieval` | 768 | Long-context (8k tokens) retrieval |
|
|
411
|
+
|
|
412
|
+
## Image Generation
|
|
413
|
+
|
|
414
|
+
Together AI hosts FLUX models from Black Forest Labs for high-quality image generation.
|
|
415
|
+
|
|
416
|
+
### Generate Images
|
|
417
|
+
|
|
418
|
+
```python
|
|
419
|
+
from together import Together
|
|
420
|
+
|
|
421
|
+
client = Together()
|
|
422
|
+
|
|
423
|
+
response = client.images.generate(
|
|
424
|
+
model="black-forest-labs/FLUX.1-schnell",
|
|
425
|
+
prompt="A photorealistic mountain landscape at sunset with a lake reflection",
|
|
426
|
+
steps=4,
|
|
427
|
+
n=1,
|
|
428
|
+
width=1024,
|
|
429
|
+
height=1024,
|
|
430
|
+
)
|
|
431
|
+
|
|
432
|
+
# Response contains URL or base64 image data
|
|
433
|
+
print(response.data[0].url)
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
### Available Image Models
|
|
437
|
+
|
|
438
|
+
| Model ID | Type | Notes |
|
|
439
|
+
|----------|------|-------|
|
|
440
|
+
| `black-forest-labs/FLUX.1-schnell` | Fast generation | Fastest, lower step count (4 steps) |
|
|
441
|
+
| `black-forest-labs/FLUX.1-dev` | Development | LoRA support for custom styles |
|
|
442
|
+
| `black-forest-labs/FLUX.1.1-pro` | Premium | Highest quality, best prompt adherence |
|
|
443
|
+
|
|
444
|
+
### Image with OpenAI SDK
|
|
445
|
+
|
|
446
|
+
```python
|
|
447
|
+
from openai import OpenAI
|
|
448
|
+
|
|
449
|
+
client = OpenAI(
|
|
450
|
+
api_key=os.environ["TOGETHER_API_KEY"],
|
|
451
|
+
base_url="https://api.together.xyz/v1",
|
|
452
|
+
)
|
|
453
|
+
|
|
454
|
+
response = client.images.generate(
|
|
455
|
+
model="black-forest-labs/FLUX.1-schnell",
|
|
456
|
+
prompt="A cyberpunk cityscape at night",
|
|
457
|
+
n=1,
|
|
458
|
+
)
|
|
459
|
+
|
|
460
|
+
print(response.data[0].url)
|
|
461
|
+
```
|
|
462
|
+
|
|
463
|
+
## Batch Inference
|
|
464
|
+
|
|
465
|
+
Batch API processes large volumes of requests asynchronously at 50% lower cost with a 24-hour turnaround.
|
|
466
|
+
|
|
467
|
+
### Input File Format
|
|
468
|
+
|
|
469
|
+
Create a JSONL file where each line is a request:
|
|
470
|
+
|
|
471
|
+
```jsonl
|
|
472
|
+
{"custom_id": "request-1", "body": {"model": "deepseek-ai/DeepSeek-V3", "messages": [{"role": "user", "content": "What is machine learning?"}], "max_tokens": 200}}
|
|
473
|
+
{"custom_id": "request-2", "body": {"model": "deepseek-ai/DeepSeek-V3", "messages": [{"role": "user", "content": "Explain gradient descent."}], "max_tokens": 200}}
|
|
474
|
+
{"custom_id": "request-3", "body": {"model": "deepseek-ai/DeepSeek-V3", "messages": [{"role": "user", "content": "What are transformers?"}], "max_tokens": 200}}
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
### Submit Batch Job
|
|
478
|
+
|
|
479
|
+
```python
|
|
480
|
+
from together import Together
|
|
481
|
+
|
|
482
|
+
client = Together()
|
|
483
|
+
|
|
484
|
+
# 1. Upload the batch file
|
|
485
|
+
batch_file = client.files.upload(
|
|
486
|
+
file="batch_requests.jsonl",
|
|
487
|
+
purpose="batch-api",
|
|
488
|
+
)
|
|
489
|
+
print(f"File ID: {batch_file.id}")
|
|
490
|
+
|
|
491
|
+
# 2. Create the batch job
|
|
492
|
+
batch = client.batches.create_batch(
|
|
493
|
+
file_id=batch_file.id,
|
|
494
|
+
endpoint="/v1/chat/completions",
|
|
495
|
+
)
|
|
496
|
+
print(f"Batch ID: {batch.id}")
|
|
497
|
+
|
|
498
|
+
# 3. Monitor status
|
|
499
|
+
status = client.batches.get_batch(batch.id)
|
|
500
|
+
print(f"Status: {status.status}")
|
|
501
|
+
|
|
502
|
+
# 4. Download results when completed
|
|
503
|
+
if status.status == "COMPLETED":
|
|
504
|
+
results = client.files.retrieve_content(
|
|
505
|
+
id=status.output_file_id,
|
|
506
|
+
)
|
|
507
|
+
print(results)
|
|
508
|
+
```
|
|
509
|
+
|
|
510
|
+
### List Batches
|
|
511
|
+
|
|
512
|
+
```python
|
|
513
|
+
from together import Together
|
|
514
|
+
|
|
515
|
+
client = Together()
|
|
516
|
+
|
|
517
|
+
batches = client.batches.list_batches()
|
|
518
|
+
for b in batches:
|
|
519
|
+
print(f"{b.id}: {b.status}")
|
|
520
|
+
```
|
|
521
|
+
|
|
522
|
+
## Model Selection
|
|
523
|
+
|
|
524
|
+
### Chat / Instruct Models
|
|
525
|
+
|
|
526
|
+
| Model ID | Params | Input $/M | Output $/M | Context | Best For |
|
|
527
|
+
|----------|--------|-----------|------------|---------|----------|
|
|
528
|
+
| `meta-llama/Meta-Llama-3.1-8B-Instruct-Reference` | 8B | $0.18 | $0.18 | 131k | Fast, cheap general tasks |
|
|
529
|
+
| `meta-llama/Llama-3.3-70B-Instruct-Reference` | 70B | $0.88 | $0.88 | 131k | High-quality general purpose |
|
|
530
|
+
| `meta-llama/Llama-4-Maverick-17B-128E-Instruct` | 400B MoE | $0.27 | $0.85 | 1M | Cost-effective large model |
|
|
531
|
+
| `deepseek-ai/DeepSeek-V3` | 671B MoE | $1.25 | $1.25 | 128k | Top-tier reasoning and code |
|
|
532
|
+
| `deepseek-ai/DeepSeek-R1` | 671B MoE | $3.00 | $7.00 | 128k | Complex reasoning with CoT |
|
|
533
|
+
| `Qwen/Qwen3-Next-80B-A3B-Instruct` | 80B MoE | $0.15 | $1.50 | 128k | Ultra-cheap MoE inference |
|
|
534
|
+
| `Qwen/Qwen3-235B-A22B` | 235B MoE | $0.50 | $1.50 | 128k | Powerful open-weight MoE |
|
|
535
|
+
| `mistralai/Mixtral-8x7B-Instruct-v0.1` | 46B MoE | $0.60 | $0.60 | 32k | Balanced MoE model |
|
|
536
|
+
| `Qwen/Qwen3-Coder-480B-A35B-Instruct` | 480B MoE | $0.60 | $1.80 | 256k | Code generation and review |
|
|
537
|
+
| `google/gemma-3-27b-it` | 27B | $0.30 | $0.30 | 128k | Google's efficient model |
|
|
538
|
+
|
|
539
|
+
### Reasoning Models
|
|
540
|
+
|
|
541
|
+
| Model ID | Input $/M | Output $/M | Notes |
|
|
542
|
+
|----------|-----------|------------|-------|
|
|
543
|
+
| `deepseek-ai/DeepSeek-R1` | $3.00 | $7.00 | Chain-of-thought reasoning |
|
|
544
|
+
| `deepseek-ai/DeepSeek-R1-0528` | $3.00 | $7.00 | Updated R1 variant |
|
|
545
|
+
| `Qwen/Qwen3-Next-80B-A3B-Thinking` | $0.15 | $1.50 | MoE reasoning, very cheap |
|
|
546
|
+
|
|
547
|
+
### Code Models
|
|
548
|
+
|
|
549
|
+
| Model ID | Input $/M | Output $/M | Notes |
|
|
550
|
+
|----------|-----------|------------|-------|
|
|
551
|
+
| `Qwen/Qwen3-Coder-30B-A3B-Instruct` | $0.15 | $1.50 | Fast code MoE |
|
|
552
|
+
| `Qwen/Qwen3-Coder-480B-A35B-Instruct` | $0.60 | $1.80 | Largest code model |
|
|
553
|
+
|
|
554
|
+
Pricing is approximate and subject to change. Check https://www.together.ai/pricing for current rates.
|
|
555
|
+
|
|
556
|
+
## OpenAI Compatibility
|
|
557
|
+
|
|
558
|
+
Together AI is fully compatible with the OpenAI Python SDK. Change two lines to switch from OpenAI to Together AI.
|
|
559
|
+
|
|
560
|
+
### Using OpenAI SDK
|
|
561
|
+
|
|
562
|
+
```python
|
|
563
|
+
from openai import OpenAI
|
|
564
|
+
import os
|
|
565
|
+
|
|
566
|
+
# Just change the API key and base_url
|
|
567
|
+
client = OpenAI(
|
|
568
|
+
api_key=os.environ["TOGETHER_API_KEY"],
|
|
569
|
+
base_url="https://api.together.xyz/v1",
|
|
570
|
+
)
|
|
571
|
+
|
|
572
|
+
# Everything else is identical to OpenAI usage
|
|
573
|
+
response = client.chat.completions.create(
|
|
574
|
+
model="meta-llama/Llama-3.3-70B-Instruct-Reference",
|
|
575
|
+
messages=[
|
|
576
|
+
{"role": "system", "content": "You are a helpful assistant."},
|
|
577
|
+
{"role": "user", "content": "Hello!"},
|
|
578
|
+
],
|
|
579
|
+
max_tokens=256,
|
|
580
|
+
)
|
|
581
|
+
|
|
582
|
+
print(response.choices[0].message.content)
|
|
583
|
+
```
|
|
584
|
+
|
|
585
|
+
### What Works with OpenAI SDK
|
|
586
|
+
|
|
587
|
+
| Feature | Supported |
|
|
588
|
+
|---------|-----------|
|
|
589
|
+
| `chat.completions.create` | Yes |
|
|
590
|
+
| Streaming responses | Yes |
|
|
591
|
+
| Function calling / tools | Yes |
|
|
592
|
+
| JSON mode / structured outputs | Yes |
|
|
593
|
+
| Vision (multimodal) | Yes |
|
|
594
|
+
| `embeddings.create` | Yes |
|
|
595
|
+
| `images.generate` | Yes |
|
|
596
|
+
| `fine_tuning.jobs.create` | Yes |
|
|
597
|
+
| `models.list` | Yes |
|
|
598
|
+
| Async client | Yes |
|
|
599
|
+
| `.with_raw_response` | Yes |
|
|
600
|
+
| `.with_streaming_response` | Yes |
|
|
601
|
+
|
|
602
|
+
### LangChain Integration
|
|
603
|
+
|
|
604
|
+
```python
|
|
605
|
+
from langchain_openai import ChatOpenAI
|
|
606
|
+
|
|
607
|
+
llm = ChatOpenAI(
|
|
608
|
+
model="meta-llama/Llama-3.3-70B-Instruct-Reference",
|
|
609
|
+
openai_api_key=os.environ["TOGETHER_API_KEY"],
|
|
610
|
+
openai_api_base="https://api.together.xyz/v1",
|
|
611
|
+
)
|
|
612
|
+
|
|
613
|
+
response = llm.invoke("What is the meaning of life?")
|
|
614
|
+
print(response.content)
|
|
615
|
+
```
|
|
616
|
+
|
|
617
|
+
## CLI Reference
|
|
618
|
+
|
|
619
|
+
The `together` CLI provides direct access from the terminal.
|
|
620
|
+
|
|
621
|
+
```bash
|
|
622
|
+
# Install
|
|
623
|
+
pip install --upgrade together
|
|
624
|
+
|
|
625
|
+
# Set API key
|
|
626
|
+
export TOGETHER_API_KEY="your-api-key"
|
|
627
|
+
|
|
628
|
+
# Chat completion
|
|
629
|
+
together chat.completions \
|
|
630
|
+
--message "system" "You are helpful." \
|
|
631
|
+
--message "user" "What is PyTorch?" \
|
|
632
|
+
--model meta-llama/Llama-3.3-70B-Instruct-Reference
|
|
633
|
+
|
|
634
|
+
# List models
|
|
635
|
+
together models list
|
|
636
|
+
|
|
637
|
+
# Image generation
|
|
638
|
+
together images generate \
|
|
639
|
+
"A futuristic city at sunset" \
|
|
640
|
+
--model black-forest-labs/FLUX.1-schnell \
|
|
641
|
+
--n 1
|
|
642
|
+
|
|
643
|
+
# File operations
|
|
644
|
+
together files upload training_data.jsonl
|
|
645
|
+
together files list
|
|
646
|
+
together files retrieve file-abc123
|
|
647
|
+
together files delete file-abc123
|
|
648
|
+
|
|
649
|
+
# Fine-tuning
|
|
650
|
+
together fine-tuning create \
|
|
651
|
+
--training-file file-abc123 \
|
|
652
|
+
-m meta-llama/Meta-Llama-3.1-8B-Instruct-Reference
|
|
653
|
+
together fine-tuning list
|
|
654
|
+
together fine-tuning status ft-abc123
|
|
655
|
+
together fine-tuning list-events ft-abc123
|
|
656
|
+
together fine-tuning list-checkpoints ft-abc123
|
|
657
|
+
together fine-tuning download --ft-id ft-abc123
|
|
658
|
+
together fine-tuning cancel ft-abc123
|
|
659
|
+
```
|
|
660
|
+
|
|
661
|
+
## Cost Optimization
|
|
662
|
+
|
|
663
|
+
### 1. Use MoE Models
|
|
664
|
+
|
|
665
|
+
Mixture-of-Experts models activate only a fraction of parameters per token, offering better price-to-performance:
|
|
666
|
+
|
|
667
|
+
| Model | Active Params | Price |
|
|
668
|
+
|-------|--------------|-------|
|
|
669
|
+
| Qwen3-Next-80B-A3B | 3B active of 80B | $0.15/M input |
|
|
670
|
+
| Llama-4-Maverick | 17B active of 400B | $0.27/M input |
|
|
671
|
+
| DeepSeek-V3 | ~37B active of 671B | $1.25/M input |
|
|
672
|
+
|
|
673
|
+
### 2. Use Batch API
|
|
674
|
+
|
|
675
|
+
Submit non-urgent workloads via the batch API for 50% cost reduction. Ideal for evaluations, dataset generation, and bulk classification.
|
|
676
|
+
|
|
677
|
+
### 3. Use JSON Mode for Structured Output
|
|
678
|
+
|
|
679
|
+
Avoid post-processing errors and retry loops by constraining output format upfront.
|
|
680
|
+
|
|
681
|
+
### 4. Right-Size Your Model
|
|
682
|
+
|
|
683
|
+
- **Simple classification/extraction**: 8B models ($0.18/M)
|
|
684
|
+
- **General chat/instruction**: 70B models ($0.88/M)
|
|
685
|
+
- **Complex reasoning/code**: DeepSeek-V3 ($1.25/M) or R1 ($3.00/M)
|
|
686
|
+
- **Cost-sensitive high volume**: MoE models like Qwen3-Next ($0.15/M)
|
|
687
|
+
|
|
688
|
+
### 5. Minimize Max Tokens
|
|
689
|
+
|
|
690
|
+
Set `max_tokens` to the minimum needed. You pay for output tokens generated, not the max_tokens budget.
|
|
691
|
+
|
|
692
|
+
### 6. Use Streaming for Long Outputs
|
|
693
|
+
|
|
694
|
+
Streaming does not cost more but gives faster time-to-first-token and lets you abort early if the output goes off track.
|
|
695
|
+
|
|
696
|
+
## Common Issues
|
|
697
|
+
|
|
698
|
+
| Problem | Solution |
|
|
699
|
+
|---------|----------|
|
|
700
|
+
| `401 Unauthorized` | Check `TOGETHER_API_KEY` is set and valid |
|
|
701
|
+
| `429 Rate Limited` | Implement exponential backoff; upgrade plan for higher limits |
|
|
702
|
+
| `Model not found` | Verify model ID at https://docs.together.ai/docs/serverless-models |
|
|
703
|
+
| JSON mode returns invalid JSON | Include the schema in the system prompt alongside `response_format` |
|
|
704
|
+
| Function calling not working | Use supported models (Llama 3.x, DeepSeek, Qwen3, Mistral) |
|
|
705
|
+
| Fine-tuning job stuck | Check data format (must be valid JSONL with `messages` array) |
|
|
706
|
+
| Batch job failed | Verify JSONL format has `custom_id` and `body` fields per line |
|
|
707
|
+
| Slow response times | Try Turbo/Lite model variants or reduce `max_tokens` |
|
|
708
|
+
| Embedding dimensions mismatch | Different models produce different dimensions (768 or 1024) |
|
|
709
|
+
| Image generation timeout | Reduce `steps` parameter; use FLUX.1-schnell for fastest results |
|
|
710
|
+
|
|
711
|
+
## Resources
|
|
712
|
+
|
|
713
|
+
- **Documentation**: https://docs.together.ai
|
|
714
|
+
- **API Reference**: https://docs.together.ai/reference
|
|
715
|
+
- **Pricing**: https://www.together.ai/pricing
|
|
716
|
+
- **Dashboard**: https://api.together.xyz
|
|
717
|
+
- **Model Catalog**: https://docs.together.ai/docs/serverless-models
|
|
718
|
+
- **Fine-Tuning Guide**: https://docs.together.ai/docs/fine-tuning-quickstart
|
|
719
|
+
- **Python SDK**: https://github.com/togethercomputer/together-python
|
|
720
|
+
- **TypeScript SDK**: https://github.com/togethercomputer/together-typescript
|
|
721
|
+
- **Cookbook (Examples)**: https://github.com/togethercomputer/together-cookbook
|
|
722
|
+
- **Status Page**: https://status.together.ai
|