DeepFabric 4.4.1__tar.gz
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.
- deepfabric-4.4.1/.github/config.yml +50 -0
- deepfabric-4.4.1/.github/dependabot.yml +14 -0
- deepfabric-4.4.1/.github/workflows/docs.yml +60 -0
- deepfabric-4.4.1/.github/workflows/integration.yml +48 -0
- deepfabric-4.4.1/.github/workflows/publish.yml +35 -0
- deepfabric-4.4.1/.github/workflows/test.yml +45 -0
- deepfabric-4.4.1/.github/workflows/tools-sdk-docker.yml +147 -0
- deepfabric-4.4.1/.gitignore +135 -0
- deepfabric-4.4.1/CLAUDE.md +100 -0
- deepfabric-4.4.1/LICENSE +201 -0
- deepfabric-4.4.1/Makefile +36 -0
- deepfabric-4.4.1/PKG-INFO +702 -0
- deepfabric-4.4.1/README.md +658 -0
- deepfabric-4.4.1/assets/df-demo.gif +0 -0
- deepfabric-4.4.1/assets/logo-light-hols.png +0 -0
- deepfabric-4.4.1/assets/logo-light.png +0 -0
- deepfabric-4.4.1/assets/star.gif +0 -0
- deepfabric-4.4.1/coverage.xml +688 -0
- deepfabric-4.4.1/deepfabric/__init__.py +70 -0
- deepfabric-4.4.1/deepfabric/__main__.py +6 -0
- deepfabric-4.4.1/deepfabric/auth.py +382 -0
- deepfabric-4.4.1/deepfabric/builders.py +303 -0
- deepfabric-4.4.1/deepfabric/builders_agent.py +1304 -0
- deepfabric-4.4.1/deepfabric/cli.py +1288 -0
- deepfabric-4.4.1/deepfabric/config.py +899 -0
- deepfabric-4.4.1/deepfabric/config_manager.py +251 -0
- deepfabric-4.4.1/deepfabric/constants.py +94 -0
- deepfabric-4.4.1/deepfabric/dataset_manager.py +534 -0
- deepfabric-4.4.1/deepfabric/error_codes.py +581 -0
- deepfabric-4.4.1/deepfabric/evaluation/__init__.py +47 -0
- deepfabric-4.4.1/deepfabric/evaluation/backends/__init__.py +32 -0
- deepfabric-4.4.1/deepfabric/evaluation/backends/ollama_backend.py +137 -0
- deepfabric-4.4.1/deepfabric/evaluation/backends/tool_call_parsers.py +409 -0
- deepfabric-4.4.1/deepfabric/evaluation/backends/transformers_backend.py +326 -0
- deepfabric-4.4.1/deepfabric/evaluation/evaluator.py +845 -0
- deepfabric-4.4.1/deepfabric/evaluation/evaluators/__init__.py +13 -0
- deepfabric-4.4.1/deepfabric/evaluation/evaluators/base.py +104 -0
- deepfabric-4.4.1/deepfabric/evaluation/evaluators/builtin/__init__.py +5 -0
- deepfabric-4.4.1/deepfabric/evaluation/evaluators/builtin/tool_calling.py +93 -0
- deepfabric-4.4.1/deepfabric/evaluation/evaluators/registry.py +66 -0
- deepfabric-4.4.1/deepfabric/evaluation/inference.py +155 -0
- deepfabric-4.4.1/deepfabric/evaluation/metrics.py +397 -0
- deepfabric-4.4.1/deepfabric/evaluation/parser.py +304 -0
- deepfabric-4.4.1/deepfabric/evaluation/reporters/__init__.py +13 -0
- deepfabric-4.4.1/deepfabric/evaluation/reporters/base.py +56 -0
- deepfabric-4.4.1/deepfabric/evaluation/reporters/cloud_reporter.py +195 -0
- deepfabric-4.4.1/deepfabric/evaluation/reporters/file_reporter.py +61 -0
- deepfabric-4.4.1/deepfabric/evaluation/reporters/multi_reporter.py +56 -0
- deepfabric-4.4.1/deepfabric/exceptions.py +67 -0
- deepfabric-4.4.1/deepfabric/factory.py +26 -0
- deepfabric-4.4.1/deepfabric/generator.py +1084 -0
- deepfabric-4.4.1/deepfabric/graph.py +545 -0
- deepfabric-4.4.1/deepfabric/hf_hub.py +214 -0
- deepfabric-4.4.1/deepfabric/kaggle_hub.py +219 -0
- deepfabric-4.4.1/deepfabric/llm/__init__.py +41 -0
- deepfabric-4.4.1/deepfabric/llm/api_key_verifier.py +534 -0
- deepfabric-4.4.1/deepfabric/llm/client.py +1220 -0
- deepfabric-4.4.1/deepfabric/llm/errors.py +105 -0
- deepfabric-4.4.1/deepfabric/llm/rate_limit_config.py +262 -0
- deepfabric-4.4.1/deepfabric/llm/rate_limit_detector.py +278 -0
- deepfabric-4.4.1/deepfabric/llm/retry_handler.py +270 -0
- deepfabric-4.4.1/deepfabric/metrics.py +212 -0
- deepfabric-4.4.1/deepfabric/progress.py +262 -0
- deepfabric-4.4.1/deepfabric/prompts.py +290 -0
- deepfabric-4.4.1/deepfabric/schemas.py +1000 -0
- deepfabric-4.4.1/deepfabric/spin/__init__.py +6 -0
- deepfabric-4.4.1/deepfabric/spin/client.py +263 -0
- deepfabric-4.4.1/deepfabric/spin/models.py +26 -0
- deepfabric-4.4.1/deepfabric/stream_simulator.py +90 -0
- deepfabric-4.4.1/deepfabric/tools/__init__.py +5 -0
- deepfabric-4.4.1/deepfabric/tools/defaults.py +85 -0
- deepfabric-4.4.1/deepfabric/tools/loader.py +87 -0
- deepfabric-4.4.1/deepfabric/tools/mcp_client.py +677 -0
- deepfabric-4.4.1/deepfabric/topic_manager.py +303 -0
- deepfabric-4.4.1/deepfabric/topic_model.py +20 -0
- deepfabric-4.4.1/deepfabric/training/__init__.py +35 -0
- deepfabric-4.4.1/deepfabric/training/api_key_prompt.py +302 -0
- deepfabric-4.4.1/deepfabric/training/callback.py +363 -0
- deepfabric-4.4.1/deepfabric/training/metrics_sender.py +301 -0
- deepfabric-4.4.1/deepfabric/tree.py +438 -0
- deepfabric-4.4.1/deepfabric/tui.py +1267 -0
- deepfabric-4.4.1/deepfabric/update_checker.py +166 -0
- deepfabric-4.4.1/deepfabric/utils.py +150 -0
- deepfabric-4.4.1/deepfabric/validation.py +143 -0
- deepfabric-4.4.1/docs/api/config.md +325 -0
- deepfabric-4.4.1/docs/api/generator.md +458 -0
- deepfabric-4.4.1/docs/api/graph.md +327 -0
- deepfabric-4.4.1/docs/api/index.md +135 -0
- deepfabric-4.4.1/docs/api/tree.md +283 -0
- deepfabric-4.4.1/docs/cli/format.md +240 -0
- deepfabric-4.4.1/docs/cli/generate.md +165 -0
- deepfabric-4.4.1/docs/cli/import-tools.md +323 -0
- deepfabric-4.4.1/docs/cli/index.md +89 -0
- deepfabric-4.4.1/docs/cli/upload.md +153 -0
- deepfabric-4.4.1/docs/cli/validate.md +144 -0
- deepfabric-4.4.1/docs/cli/visualize.md +115 -0
- deepfabric-4.4.1/docs/dataset-generation/agent.md +137 -0
- deepfabric-4.4.1/docs/dataset-generation/basic.md +92 -0
- deepfabric-4.4.1/docs/dataset-generation/configuration.md +177 -0
- deepfabric-4.4.1/docs/dataset-generation/index.md +60 -0
- deepfabric-4.4.1/docs/dataset-generation/rate-limiting.md +213 -0
- deepfabric-4.4.1/docs/dataset-generation/reasoning.md +99 -0
- deepfabric-4.4.1/docs/evaluation/index.md +54 -0
- deepfabric-4.4.1/docs/evaluation/metrics.md +136 -0
- deepfabric-4.4.1/docs/evaluation/running.md +179 -0
- deepfabric-4.4.1/docs/getting-started/index.md +98 -0
- deepfabric-4.4.1/docs/images/logo-light.png +0 -0
- deepfabric-4.4.1/docs/index.md +94 -0
- deepfabric-4.4.1/docs/tools/custom.md +223 -0
- deepfabric-4.4.1/docs/tools/index.md +91 -0
- deepfabric-4.4.1/docs/tools/mcp.md +165 -0
- deepfabric-4.4.1/docs/tools/mock.md +194 -0
- deepfabric-4.4.1/docs/tools/spin.md +135 -0
- deepfabric-4.4.1/docs/tools/vfs.md +118 -0
- deepfabric-4.4.1/docs/training/chat-templates.md +162 -0
- deepfabric-4.4.1/docs/training/frameworks.md +155 -0
- deepfabric-4.4.1/docs/training/index.md +60 -0
- deepfabric-4.4.1/docs/training/loading.md +115 -0
- deepfabric-4.4.1/examples/agent-tools-multi.yaml +157 -0
- deepfabric-4.4.1/examples/agent-tools-single.yaml +110 -0
- deepfabric-4.4.1/examples/basic-anthropic.yaml +51 -0
- deepfabric-4.4.1/examples/basic-gemini.yaml +51 -0
- deepfabric-4.4.1/examples/basic-graph.yaml +51 -0
- deepfabric-4.4.1/examples/basic-ollama.yaml +51 -0
- deepfabric-4.4.1/examples/basic-openai.yaml +51 -0
- deepfabric-4.4.1/examples/basic-openrouter.yaml +51 -0
- deepfabric-4.4.1/examples/basic-tree.yaml +51 -0
- deepfabric-4.4.1/examples/coding-agent.yaml +151 -0
- deepfabric-4.4.1/examples/complete.yaml +158 -0
- deepfabric-4.4.1/examples/custom-tools.yaml +93 -0
- deepfabric-4.4.1/examples/github-mock-tools.yaml +203 -0
- deepfabric-4.4.1/examples/reasoning.yaml +54 -0
- deepfabric-4.4.1/examples/spin-vfs-tools.yaml +89 -0
- deepfabric-4.4.1/examples/tools-sdk-examples/blender/blender-mock-data.json +915 -0
- deepfabric-4.4.1/examples/tools-sdk-examples/blender/load-blender-mock-data.sh +128 -0
- deepfabric-4.4.1/examples/tools-sdk-examples/blender/spin-blender.yaml +185 -0
- deepfabric-4.4.1/examples/tools-sdk-examples/figma/figma-mock-data.json +586 -0
- deepfabric-4.4.1/examples/tools-sdk-examples/figma/load-figma-mock-data.sh +113 -0
- deepfabric-4.4.1/examples/tools-sdk-examples/figma/spin-figma.yaml +109 -0
- deepfabric-4.4.1/examples/tools-sdk-examples/github/github-mock-data.json +542 -0
- deepfabric-4.4.1/examples/tools-sdk-examples/github/load-github-mock-data.sh +104 -0
- deepfabric-4.4.1/examples/tools-sdk-examples/github/spin-github-tools.yaml +96 -0
- deepfabric-4.4.1/examples/tools-sdk-examples/kubernetes/kubernetes-mock-data.json +1277 -0
- deepfabric-4.4.1/examples/tools-sdk-examples/kubernetes/load-kubernetes-mock-data.sh +131 -0
- deepfabric-4.4.1/examples/tools-sdk-examples/kubernetes/spin-kubernetes.yaml +185 -0
- deepfabric-4.4.1/examples/tools-sdk-examples/kubernetes/tools.json +607 -0
- deepfabric-4.4.1/misc/test_update_manual.py +27 -0
- deepfabric-4.4.1/mkdocs.yml +107 -0
- deepfabric-4.4.1/notebooks/trl_sft_training.ipynb +602 -0
- deepfabric-4.4.1/pyproject.toml +160 -0
- deepfabric-4.4.1/test-run/01-alpaca.txt +4 -0
- deepfabric-4.4.1/test-run/01-chatml.txt +176 -0
- deepfabric-4.4.1/test-run/01-grpo.txt +4 -0
- deepfabric-4.4.1/test-run/01-xlam_v2.txt +0 -0
- deepfabric-4.4.1/test-run/02-trl2.txt +4 -0
- deepfabric-4.4.1/test-run/02-xlam_v2.txt +52 -0
- deepfabric-4.4.1/test-run/04-agent-tool-conversations.jsnl +4 -0
- deepfabric-4.4.1/test-run/04-single-agent-tools +515 -0
- deepfabric-4.4.1/tests/__init__.py +0 -0
- deepfabric-4.4.1/tests/integration/__init__.py +0 -0
- deepfabric-4.4.1/tests/integration/test_tree_integration.py +186 -0
- deepfabric-4.4.1/tests/unit/__init__.py +0 -0
- deepfabric-4.4.1/tests/unit/conftest.py +20 -0
- deepfabric-4.4.1/tests/unit/test_api_key_validation.py +375 -0
- deepfabric-4.4.1/tests/unit/test_cli.py +700 -0
- deepfabric-4.4.1/tests/unit/test_config.py +280 -0
- deepfabric-4.4.1/tests/unit/test_error_codes.py +439 -0
- deepfabric-4.4.1/tests/unit/test_gemini_schema.py +393 -0
- deepfabric-4.4.1/tests/unit/test_generator.py +235 -0
- deepfabric-4.4.1/tests/unit/test_hf_hub.py +164 -0
- deepfabric-4.4.1/tests/unit/test_kaggle_hub.py +209 -0
- deepfabric-4.4.1/tests/unit/test_modular_config.py +272 -0
- deepfabric-4.4.1/tests/unit/test_rate_limiting.py +476 -0
- deepfabric-4.4.1/tests/unit/test_schemas.py +441 -0
- deepfabric-4.4.1/tests/unit/test_tool_call_parsers.py +424 -0
- deepfabric-4.4.1/tests/unit/test_topic_graph.py +490 -0
- deepfabric-4.4.1/tests/unit/test_training_callback.py +424 -0
- deepfabric-4.4.1/tests/unit/test_update_checker.py +318 -0
- deepfabric-4.4.1/tools/extract_messages.py +48 -0
- deepfabric-4.4.1/tools/function.py +20 -0
- deepfabric-4.4.1/tools/yaml_to_openai_tools.py +127 -0
- deepfabric-4.4.1/tools-sdk/.dockerignore +37 -0
- deepfabric-4.4.1/tools-sdk/Dockerfile +91 -0
- deepfabric-4.4.1/tools-sdk/README.md +277 -0
- deepfabric-4.4.1/tools-sdk/components/github/README.md +348 -0
- deepfabric-4.4.1/tools-sdk/components/github/app.py +701 -0
- deepfabric-4.4.1/tools-sdk/components/github/github.wasm +0 -0
- deepfabric-4.4.1/tools-sdk/components/github/pyproject.toml +11 -0
- deepfabric-4.4.1/tools-sdk/components/github/requirements.txt +1 -0
- deepfabric-4.4.1/tools-sdk/components/github/spin.toml +6 -0
- deepfabric-4.4.1/tools-sdk/components/github/uv.lock +40 -0
- deepfabric-4.4.1/tools-sdk/components/mock/Cargo.lock +867 -0
- deepfabric-4.4.1/tools-sdk/components/mock/Cargo.toml +14 -0
- deepfabric-4.4.1/tools-sdk/components/mock/README.md +357 -0
- deepfabric-4.4.1/tools-sdk/components/mock/src/lib.rs +635 -0
- deepfabric-4.4.1/tools-sdk/components/vfs/Cargo.lock +847 -0
- deepfabric-4.4.1/tools-sdk/components/vfs/Cargo.toml +19 -0
- deepfabric-4.4.1/tools-sdk/components/vfs/src/lib.rs +330 -0
- deepfabric-4.4.1/tools-sdk/docker-compose.yaml +43 -0
- deepfabric-4.4.1/tools-sdk/runtime-config.toml +5 -0
- deepfabric-4.4.1/tools-sdk/spin.toml +76 -0
- deepfabric-4.4.1/uv.lock +3478 -0
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Configuration for welcome - https://github.com/behaviorbot/welcome
|
|
2
|
+
|
|
3
|
+
# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome
|
|
4
|
+
|
|
5
|
+
# Comment to be posted to on first time issues
|
|
6
|
+
newIssueWelcomeComment: >
|
|
7
|
+
🎉 **Welcome to the DeepFabric project!** 🎉
|
|
8
|
+
Thanks for opening your first issue here — we’re *so excited* to have you contributing! 😄
|
|
9
|
+
Please make sure to follow the issue template so we can help you faster 🧵✨
|
|
10
|
+
|
|
11
|
+
💬 Join our amazing community on Discord for live discussions, sneak peeks, and good vibes:
|
|
12
|
+
👉 [**DeepFabric Discord**](https://discord.gg/pPcjYzGvbS)
|
|
13
|
+
|
|
14
|
+
🧠 Let’s build something *deep* together! 🚀💡
|
|
15
|
+
|
|
16
|
+

|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome
|
|
21
|
+
|
|
22
|
+
# Comment to be posted to on PRs from first time contributors in your repository
|
|
23
|
+
newPRWelcomeComment: >
|
|
24
|
+
👏 **Thank you for your first pull request!** 👏
|
|
25
|
+
Welcome to **DeepFabric** — you’re officially part of the weave now! 🧶✨
|
|
26
|
+
|
|
27
|
+
Please take a moment to check out our **contributing guidelines** before your PR is reviewed 💪
|
|
28
|
+
Every thread you add helps strengthen the fabric of this project 🕸️💙
|
|
29
|
+
|
|
30
|
+
💬 Hop into our Discord to say hi or share your progress:
|
|
31
|
+
👉 [**DeepFabric Discord**](https://discord.gg/pPcjYzGvbS)
|
|
32
|
+
|
|
33
|
+

|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge
|
|
38
|
+
|
|
39
|
+
# Comment to be posted to on pull requests merged by a first time user
|
|
40
|
+
firstPRMergeComment: >
|
|
41
|
+
🥳 **Congratulations on merging your first PR!** 🥳
|
|
42
|
+
The **DeepFabric** team is *so proud* of you! 🌟
|
|
43
|
+
|
|
44
|
+
You’ve officially added your thread to the ever-growing fabric of this project 🧵💫
|
|
45
|
+
Keep up the great work and let’s keep building amazing things together! 🚀
|
|
46
|
+
|
|
47
|
+
💬 Come celebrate with us on Discord — you’ve earned it!
|
|
48
|
+
👉 [**DeepFabric Discord**](https://discord.gg/pPcjYzGvbS)
|
|
49
|
+
|
|
50
|
+

|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
version: 2
|
|
2
|
+
updates:
|
|
3
|
+
- package-ecosystem: "pip"
|
|
4
|
+
directory: "/"
|
|
5
|
+
schedule:
|
|
6
|
+
interval: "daily"
|
|
7
|
+
- package-ecosystem: "github-actions"
|
|
8
|
+
directory: "/"
|
|
9
|
+
schedule:
|
|
10
|
+
interval: "daily"
|
|
11
|
+
# - package-ecosystem: "docker"
|
|
12
|
+
# directory: "/"
|
|
13
|
+
# schedule:
|
|
14
|
+
# interval: "daily"
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
name: Build and Deploy Documentation
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main ]
|
|
8
|
+
|
|
9
|
+
permissions:
|
|
10
|
+
contents: read
|
|
11
|
+
pages: write
|
|
12
|
+
id-token: write
|
|
13
|
+
|
|
14
|
+
concurrency:
|
|
15
|
+
group: "pages"
|
|
16
|
+
cancel-in-progress: false
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
build:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout
|
|
23
|
+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5
|
|
24
|
+
|
|
25
|
+
- name: Install uv
|
|
26
|
+
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7
|
|
27
|
+
|
|
28
|
+
- name: Set up Python
|
|
29
|
+
run: uv python install
|
|
30
|
+
|
|
31
|
+
- name: Create virtual environment
|
|
32
|
+
run: uv venv
|
|
33
|
+
|
|
34
|
+
- name: Install dependencies
|
|
35
|
+
run: uv pip install mkdocs-material "mkdocstrings[python]>=0.30.0"
|
|
36
|
+
|
|
37
|
+
- name: Build documentation
|
|
38
|
+
run: |
|
|
39
|
+
source .venv/bin/activate
|
|
40
|
+
mkdocs build --strict
|
|
41
|
+
|
|
42
|
+
- name: Setup Pages
|
|
43
|
+
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5
|
|
44
|
+
|
|
45
|
+
- name: Upload artifact
|
|
46
|
+
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4
|
|
47
|
+
with:
|
|
48
|
+
path: ./site
|
|
49
|
+
|
|
50
|
+
deploy:
|
|
51
|
+
if: github.ref == 'refs/heads/main'
|
|
52
|
+
environment:
|
|
53
|
+
name: github-pages
|
|
54
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
|
55
|
+
runs-on: ubuntu-latest
|
|
56
|
+
needs: build
|
|
57
|
+
steps:
|
|
58
|
+
- name: Deploy to GitHub Pages
|
|
59
|
+
id: deployment
|
|
60
|
+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
name: Integration Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
paths-ignore:
|
|
8
|
+
- '**/README.md'
|
|
9
|
+
- '**/docs/**'
|
|
10
|
+
- '**/.github/workflows/publish.yml'
|
|
11
|
+
pull_request:
|
|
12
|
+
paths-ignore:
|
|
13
|
+
- '**/README.md'
|
|
14
|
+
- '**/docs/**'
|
|
15
|
+
- '**/.github/workflows/publish.yml'
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
integration-tests:
|
|
19
|
+
name: Run integration tests (Python ${{ matrix.python-version }})
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
|
|
22
|
+
strategy:
|
|
23
|
+
fail-fast: false
|
|
24
|
+
matrix:
|
|
25
|
+
python-version: [ '3.10', '3.11', '3.12' ]
|
|
26
|
+
|
|
27
|
+
steps:
|
|
28
|
+
- name: Checkout code
|
|
29
|
+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5
|
|
30
|
+
|
|
31
|
+
- name: Set up Python
|
|
32
|
+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6
|
|
33
|
+
with:
|
|
34
|
+
python-version: ${{ matrix.python-version }}
|
|
35
|
+
cache: pip
|
|
36
|
+
|
|
37
|
+
- name: Install uv
|
|
38
|
+
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7
|
|
39
|
+
with:
|
|
40
|
+
enable-cache: true
|
|
41
|
+
|
|
42
|
+
- name: Install dependencies
|
|
43
|
+
run: uv sync --all-extras
|
|
44
|
+
|
|
45
|
+
- name: Run integration tests
|
|
46
|
+
run: make test-integration
|
|
47
|
+
env:
|
|
48
|
+
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: CI/CD
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
pypi-publish:
|
|
9
|
+
name: Upload release to PyPI
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
environment:
|
|
12
|
+
name: release
|
|
13
|
+
url: https://pypi.org/p/deepfabric
|
|
14
|
+
permissions:
|
|
15
|
+
id-token: write
|
|
16
|
+
|
|
17
|
+
steps:
|
|
18
|
+
- name: Checkout code
|
|
19
|
+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5
|
|
20
|
+
|
|
21
|
+
- name: Set up Python
|
|
22
|
+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6
|
|
23
|
+
with:
|
|
24
|
+
python-version: '3.x'
|
|
25
|
+
|
|
26
|
+
- name: Install uv
|
|
27
|
+
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7
|
|
28
|
+
|
|
29
|
+
- name: Build distributions
|
|
30
|
+
run: uv build
|
|
31
|
+
|
|
32
|
+
- name: Publish package distributions to PyPI
|
|
33
|
+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # release/v1
|
|
34
|
+
with:
|
|
35
|
+
attestations: true
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: Tests
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [ main ]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [ main ]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
matrix:
|
|
14
|
+
python-version: ['3.11']
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5
|
|
18
|
+
|
|
19
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
20
|
+
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6
|
|
21
|
+
with:
|
|
22
|
+
python-version: ${{ matrix.python-version }}
|
|
23
|
+
|
|
24
|
+
- name: Install uv
|
|
25
|
+
uses: astral-sh/setup-uv@681c641aba71e4a1c380be3ab5e12ad51f415867 # v7
|
|
26
|
+
with:
|
|
27
|
+
enable-cache: true
|
|
28
|
+
|
|
29
|
+
- name: Install dependencies
|
|
30
|
+
run: uv sync --all-extras
|
|
31
|
+
|
|
32
|
+
- name: Run code formatting
|
|
33
|
+
run: make format
|
|
34
|
+
|
|
35
|
+
- name: Run linting
|
|
36
|
+
run: make lint
|
|
37
|
+
|
|
38
|
+
- name: Run tests
|
|
39
|
+
run: make test-unit
|
|
40
|
+
|
|
41
|
+
- name: Run security checks
|
|
42
|
+
run: make security
|
|
43
|
+
|
|
44
|
+
- name: Run build
|
|
45
|
+
run: make build
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
name: Tools-SDK Docker Build and Publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
paths:
|
|
8
|
+
- 'tools-sdk/**'
|
|
9
|
+
- '.github/workflows/tools-sdk-docker.yml'
|
|
10
|
+
pull_request:
|
|
11
|
+
branches:
|
|
12
|
+
- main
|
|
13
|
+
paths:
|
|
14
|
+
- 'tools-sdk/**'
|
|
15
|
+
- '.github/workflows/tools-sdk-docker.yml'
|
|
16
|
+
release:
|
|
17
|
+
types: [published]
|
|
18
|
+
workflow_dispatch:
|
|
19
|
+
|
|
20
|
+
env:
|
|
21
|
+
REGISTRY: ghcr.io
|
|
22
|
+
IMAGE_NAME: ${{ github.repository }}/tools-sdk
|
|
23
|
+
|
|
24
|
+
jobs:
|
|
25
|
+
build:
|
|
26
|
+
name: Build ${{ matrix.platform }}
|
|
27
|
+
runs-on: ${{ matrix.runner }}
|
|
28
|
+
permissions:
|
|
29
|
+
contents: read
|
|
30
|
+
packages: write
|
|
31
|
+
strategy:
|
|
32
|
+
fail-fast: false
|
|
33
|
+
matrix:
|
|
34
|
+
include:
|
|
35
|
+
- platform: linux/amd64
|
|
36
|
+
runner: ubuntu-latest
|
|
37
|
+
- platform: linux/arm64
|
|
38
|
+
runner: ubuntu-24.04-arm
|
|
39
|
+
|
|
40
|
+
steps:
|
|
41
|
+
- name: Checkout code
|
|
42
|
+
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
|
43
|
+
|
|
44
|
+
- name: Set up Docker Buildx
|
|
45
|
+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
|
|
46
|
+
|
|
47
|
+
- name: Log in to Container Registry
|
|
48
|
+
if: github.event_name != 'pull_request'
|
|
49
|
+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
|
50
|
+
with:
|
|
51
|
+
registry: ${{ env.REGISTRY }}
|
|
52
|
+
username: ${{ github.actor }}
|
|
53
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
54
|
+
|
|
55
|
+
- name: Extract metadata for Docker
|
|
56
|
+
id: meta
|
|
57
|
+
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
|
|
58
|
+
with:
|
|
59
|
+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
60
|
+
|
|
61
|
+
- name: Build and push by digest
|
|
62
|
+
id: build
|
|
63
|
+
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
|
|
64
|
+
with:
|
|
65
|
+
context: ./tools-sdk
|
|
66
|
+
file: ./tools-sdk/Dockerfile
|
|
67
|
+
platforms: ${{ matrix.platform }}
|
|
68
|
+
labels: ${{ steps.meta.outputs.labels }}
|
|
69
|
+
cache-from: type=gha,scope=${{ matrix.platform }}
|
|
70
|
+
cache-to: type=gha,mode=max,scope=${{ matrix.platform }}
|
|
71
|
+
outputs: type=image,name=${{ env.REGISTRY }}/${{ env.IMAGE_NAME }},push-by-digest=true,name-canonical=true,push=${{ github.event_name != 'pull_request' }}
|
|
72
|
+
|
|
73
|
+
- name: Export digest
|
|
74
|
+
if: github.event_name != 'pull_request'
|
|
75
|
+
run: |
|
|
76
|
+
mkdir -p /tmp/digests
|
|
77
|
+
digest="${{ steps.build.outputs.digest }}"
|
|
78
|
+
touch "/tmp/digests/${digest#sha256:}"
|
|
79
|
+
|
|
80
|
+
- name: Upload digest
|
|
81
|
+
if: github.event_name != 'pull_request'
|
|
82
|
+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
|
83
|
+
with:
|
|
84
|
+
name: digests-${{ matrix.platform == 'linux/amd64' && 'amd64' || 'arm64' }}
|
|
85
|
+
path: /tmp/digests/*
|
|
86
|
+
if-no-files-found: error
|
|
87
|
+
retention-days: 1
|
|
88
|
+
|
|
89
|
+
merge:
|
|
90
|
+
name: Merge and Push Manifest
|
|
91
|
+
runs-on: ubuntu-latest
|
|
92
|
+
if: github.event_name != 'pull_request'
|
|
93
|
+
needs: build
|
|
94
|
+
permissions:
|
|
95
|
+
contents: read
|
|
96
|
+
packages: write
|
|
97
|
+
id-token: write
|
|
98
|
+
|
|
99
|
+
steps:
|
|
100
|
+
- name: Download digests
|
|
101
|
+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
|
|
102
|
+
with:
|
|
103
|
+
path: /tmp/digests
|
|
104
|
+
pattern: digests-*
|
|
105
|
+
merge-multiple: true
|
|
106
|
+
|
|
107
|
+
- name: Set up Docker Buildx
|
|
108
|
+
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0
|
|
109
|
+
|
|
110
|
+
- name: Log in to Container Registry
|
|
111
|
+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
|
|
112
|
+
with:
|
|
113
|
+
registry: ${{ env.REGISTRY }}
|
|
114
|
+
username: ${{ github.actor }}
|
|
115
|
+
password: ${{ secrets.GITHUB_TOKEN }}
|
|
116
|
+
|
|
117
|
+
- name: Extract metadata for Docker
|
|
118
|
+
id: meta
|
|
119
|
+
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
|
|
120
|
+
with:
|
|
121
|
+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
122
|
+
tags: |
|
|
123
|
+
type=ref,event=branch
|
|
124
|
+
type=ref,event=pr
|
|
125
|
+
type=semver,pattern={{version}}
|
|
126
|
+
type=semver,pattern={{major}}.{{minor}}
|
|
127
|
+
type=sha,prefix=
|
|
128
|
+
type=raw,value=latest,enable={{is_default_branch}}
|
|
129
|
+
|
|
130
|
+
- name: Create manifest list and push
|
|
131
|
+
working-directory: /tmp/digests
|
|
132
|
+
run: |
|
|
133
|
+
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
|
|
134
|
+
$(printf '${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}@sha256:%s ' *)
|
|
135
|
+
|
|
136
|
+
- name: Inspect image
|
|
137
|
+
run: |
|
|
138
|
+
docker buildx imagetools inspect ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.version }}
|
|
139
|
+
|
|
140
|
+
- name: Install Cosign
|
|
141
|
+
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad # v4.0.0
|
|
142
|
+
|
|
143
|
+
- name: Sign the container image
|
|
144
|
+
env:
|
|
145
|
+
DIGEST: ${{ steps.meta.outputs.version }}
|
|
146
|
+
run: |
|
|
147
|
+
cosign sign --yes "${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${DIGEST}"
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.pyo
|
|
5
|
+
*.pyd
|
|
6
|
+
|
|
7
|
+
# C extensions
|
|
8
|
+
*.so
|
|
9
|
+
|
|
10
|
+
# Distribution / packaging
|
|
11
|
+
.Python
|
|
12
|
+
build/
|
|
13
|
+
develop-eggs/
|
|
14
|
+
dist/
|
|
15
|
+
downloads/
|
|
16
|
+
eggs/
|
|
17
|
+
.eggs/
|
|
18
|
+
lib/
|
|
19
|
+
lib64/
|
|
20
|
+
parts/
|
|
21
|
+
sdist/
|
|
22
|
+
var/
|
|
23
|
+
wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
# Usually these files are written by a python script from a template
|
|
31
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
32
|
+
*.manifest
|
|
33
|
+
*.spec
|
|
34
|
+
|
|
35
|
+
# Installer logs
|
|
36
|
+
pip-log.txt
|
|
37
|
+
pip-delete-this-directory.txt
|
|
38
|
+
|
|
39
|
+
# Unit test / coverage reports
|
|
40
|
+
htmlcov/
|
|
41
|
+
.tox/
|
|
42
|
+
.nox/
|
|
43
|
+
.coverage
|
|
44
|
+
*.cover
|
|
45
|
+
*.py,cover
|
|
46
|
+
.hypothesis/
|
|
47
|
+
|
|
48
|
+
# mypy
|
|
49
|
+
.mypy_cache/
|
|
50
|
+
.dmypy.json
|
|
51
|
+
dmypy.json
|
|
52
|
+
|
|
53
|
+
# Pyre type checker
|
|
54
|
+
.pyre/
|
|
55
|
+
|
|
56
|
+
# Pytype static type analyzer
|
|
57
|
+
.pytype/
|
|
58
|
+
|
|
59
|
+
# Environments
|
|
60
|
+
.env
|
|
61
|
+
.venv
|
|
62
|
+
env/
|
|
63
|
+
venv/
|
|
64
|
+
ENV/
|
|
65
|
+
env.bak/
|
|
66
|
+
venv.bak/
|
|
67
|
+
|
|
68
|
+
# Spyder project settings
|
|
69
|
+
.spyderproject
|
|
70
|
+
.spyproject
|
|
71
|
+
|
|
72
|
+
# Rope project settings
|
|
73
|
+
.ropeproject
|
|
74
|
+
|
|
75
|
+
# Jupyter Notebook
|
|
76
|
+
.ipynb_checkpoints
|
|
77
|
+
|
|
78
|
+
# pyenv
|
|
79
|
+
.python-version
|
|
80
|
+
|
|
81
|
+
# Celery
|
|
82
|
+
celerybeat-schedule
|
|
83
|
+
*.sage.py
|
|
84
|
+
|
|
85
|
+
# Django stuff:
|
|
86
|
+
*.log
|
|
87
|
+
local_settings.py
|
|
88
|
+
db.sqlite3
|
|
89
|
+
db.sqlite3-journal
|
|
90
|
+
|
|
91
|
+
# Flask stuff:
|
|
92
|
+
instance/
|
|
93
|
+
.webassets-cache
|
|
94
|
+
|
|
95
|
+
# Scrapy stuff:
|
|
96
|
+
.scrapy
|
|
97
|
+
|
|
98
|
+
# Sphinx documentation
|
|
99
|
+
docs/_build/
|
|
100
|
+
|
|
101
|
+
# PyBuilder
|
|
102
|
+
target/
|
|
103
|
+
|
|
104
|
+
# Jupyter Notebook metadata
|
|
105
|
+
.ipynb_checkpoints
|
|
106
|
+
|
|
107
|
+
# VS Code settings
|
|
108
|
+
.vscode/
|
|
109
|
+
.vscode/settings.json
|
|
110
|
+
|
|
111
|
+
# macOS specific
|
|
112
|
+
.DS_Store
|
|
113
|
+
|
|
114
|
+
# Temporary and backup files
|
|
115
|
+
*.bak
|
|
116
|
+
*.swp
|
|
117
|
+
*.swo
|
|
118
|
+
|
|
119
|
+
# IDE specific settings
|
|
120
|
+
.idea/
|
|
121
|
+
*.iml
|
|
122
|
+
.serena/
|
|
123
|
+
|
|
124
|
+
# Logs
|
|
125
|
+
*.log
|
|
126
|
+
*.out
|
|
127
|
+
*.err
|
|
128
|
+
|
|
129
|
+
# Project files
|
|
130
|
+
venv/
|
|
131
|
+
*.jsonl
|
|
132
|
+
formats/*
|
|
133
|
+
# coverage files
|
|
134
|
+
.coverage.*
|
|
135
|
+
tools-sdk/.spin/*
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# CLAUDE.md
|
|
2
|
+
|
|
3
|
+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
DeepFabric is a Python library for generating synthetic datasets using LLM providers. It consists of three main components that work together in a pipeline:
|
|
8
|
+
|
|
9
|
+
1. **Tree**: Generates hierarchical topic structures from a root prompt
|
|
10
|
+
2. **DataSetGenerator**: Creates training examples based on topics
|
|
11
|
+
3. **Dataset**: Manages and exports the final dataset
|
|
12
|
+
|
|
13
|
+
## Development Commands
|
|
14
|
+
|
|
15
|
+
### Package Management
|
|
16
|
+
- `uv sync --all-extras` - Install all dependencies including dev tools
|
|
17
|
+
- `make install` - Same as above via Makefile
|
|
18
|
+
|
|
19
|
+
### Code Quality
|
|
20
|
+
- `make format` - Format code with black and ruff auto-fix
|
|
21
|
+
- `make lint` - Run ruff linting checks
|
|
22
|
+
- `make security` - Run bandit security analysis on deepfabric/ directory
|
|
23
|
+
|
|
24
|
+
### Testing
|
|
25
|
+
- `make test` - Run pytest test suite
|
|
26
|
+
- `uv run pytest` - Direct pytest execution
|
|
27
|
+
- Test files are in `tests/` directory
|
|
28
|
+
|
|
29
|
+
### Build and Release
|
|
30
|
+
- `make build` - Clean, test, and build package
|
|
31
|
+
- `make clean` - Remove build artifacts and cache files
|
|
32
|
+
- `make all` - Complete workflow: install, format, lint, test, security, build
|
|
33
|
+
|
|
34
|
+
## Core Architecture
|
|
35
|
+
|
|
36
|
+
### Configuration System
|
|
37
|
+
- YAML-based configuration with direct system prompt specification
|
|
38
|
+
- CLI supports extensive parameter overrides
|
|
39
|
+
|
|
40
|
+
### Data Flow
|
|
41
|
+
1. Tree generates topic hierarchy from root prompt
|
|
42
|
+
2. DataSetGenerator uses topics to create question/answer pairs
|
|
43
|
+
3. Dataset validates, stores, and exports training examples
|
|
44
|
+
4. Optional HuggingFace Hub upload with auto-generated dataset cards
|
|
45
|
+
|
|
46
|
+
### Key Classes and Their Relationships
|
|
47
|
+
- `DeepFabricConfig`: Loads YAML and provides argument objects
|
|
48
|
+
- `TreeArguments`/`DataSetGeneratorArguments`: Pydantic-style dataclasses for parameters
|
|
49
|
+
- `Dataset`: Handles JSONL import/export and validation
|
|
50
|
+
- `HFUploader`: Manages Hugging Face Hub integration
|
|
51
|
+
|
|
52
|
+
## Important Implementation Details
|
|
53
|
+
|
|
54
|
+
### JSON Validation
|
|
55
|
+
The engine includes robust JSON parsing with regex extraction and retry logic for handling LLM response inconsistencies.
|
|
56
|
+
|
|
57
|
+
### Error Handling
|
|
58
|
+
- Max retries configurable for failed LLM calls
|
|
59
|
+
- Failed samples tracked separately from successful ones
|
|
60
|
+
- Comprehensive error reporting in final summary
|
|
61
|
+
|
|
62
|
+
### System Message Control
|
|
63
|
+
The `sys_msg` parameter controls whether system messages are included in the final dataset format - this affects training data structure.
|
|
64
|
+
|
|
65
|
+
## Configuration Patterns
|
|
66
|
+
|
|
67
|
+
### YAML Structure
|
|
68
|
+
```yaml
|
|
69
|
+
dataset_system_prompt: "..."
|
|
70
|
+
topic_tree:
|
|
71
|
+
args: {...}
|
|
72
|
+
save_as: "file.jsonl"
|
|
73
|
+
data_engine:
|
|
74
|
+
args: {...}
|
|
75
|
+
dataset:
|
|
76
|
+
creation: {...}
|
|
77
|
+
save_as: "file.jsonl"
|
|
78
|
+
huggingface: {...} # optional
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### Provider Configuration
|
|
82
|
+
Specify provider and model separately in config, or use combined format in code:
|
|
83
|
+
- Config: `provider: "ollama"`, `model: "mistral:latest"`
|
|
84
|
+
- Code: `model_name: "ollama/mistral:latest"`
|
|
85
|
+
|
|
86
|
+
## CLI Usage Patterns
|
|
87
|
+
|
|
88
|
+
The CLI supports both YAML configuration and parameter overrides:
|
|
89
|
+
```bash
|
|
90
|
+
deepfabric start config.yaml --model gpt-4 --temperature 0.8 --hf-repo user/dataset
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
## Code Style Notes
|
|
94
|
+
- Uses uv for dependency management
|
|
95
|
+
- Ruff for linting with extensive rule set
|
|
96
|
+
- Black for formatting
|
|
97
|
+
- Bandit for security analysis
|
|
98
|
+
- Python 3.11+ required
|
|
99
|
+
- Google-style docstrings preferred
|
|
100
|
+
- do not place imports anywhere but the top of the file
|