From bbcf3b6e80935857ab863ab8553c58c0419a14ef Mon Sep 17 00:00:00 2001 From: justabot Date: Thu, 28 Nov 2024 12:59:03 -0500 Subject: [PATCH] CS - adding better errors and readme. --- packages/client-direct/src/README.md | 44 ++++++++++++++++++++++++++++ packages/client-direct/src/index.ts | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 packages/client-direct/src/README.md diff --git a/packages/client-direct/src/README.md b/packages/client-direct/src/README.md new file mode 100644 index 0000000000..beb9e8e4eb --- /dev/null +++ b/packages/client-direct/src/README.md @@ -0,0 +1,44 @@ +# Bagel fine tuning + +## Setup + +Go to [bakery.bagel.net](https://bakery.bagel.net) and create an account. Then get an API key. + +Set the `BAGEL_API_KEY` environment variable to your API key. + +In bakery, create your model and fine-tune dataset. + +## Fine-tune with Eliza + +```bash +curl -X POST http://localhost:3000/fine-tune \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer jvBpxrTNqGqhnfQhSEqCdsG6aTSP8IBL" \ + -d '{ + "dataset_type": "MODEL", + "title": "smollm2-fine-tuning-00000099", + "category": "AI", + "details": "Test", + "tags": [], + "user_id": "96c633e6-e973-446e-b782-6235324c0a56", + "fine_tune_payload": { + "asset_id": "d0a3f665-c207-4ee6-9daa-0cbdb272eeca", + "model_name": "llama3-fine-tuning-00000001", + "base_model": "0488b40b-829f-4c3a-9880-d55d76775dd1", + "file_name": "qa_data.csv", + "epochs": 1, + "learning_rate": 0.01, + "user_id": "96c633e6-e973-446e-b782-6235324c0a56", + "use_ipfs": "false", + "input_column": "question", + "output_column": "answer" + } + }' +``` +This can take a while to complete. You can check the status of the fine-tune job in the bakery dashboard. When it is complete, you can download the fine-tuned model here: + +```bash +curl -X GET "http://localhost:3000/fine-tune/8566c47a-ada8-441c-95bc-7bb07656c4c1" \ + -H "Content-Type: application/json" \ + -H "Authorization: Bearer jvBpxrTNqGqhnfQhSEqCdsG6aTSP8IBL". +``` \ No newline at end of file diff --git a/packages/client-direct/src/index.ts b/packages/client-direct/src/index.ts index e8da9d2c73..6872299eaa 100644 --- a/packages/client-direct/src/index.ts +++ b/packages/client-direct/src/index.ts @@ -290,7 +290,7 @@ export class DirectClient { res.json(data); } catch (error) { res.status(500).json({ - error: 'Failed to forward request to BagelDB', + error: 'Please create an account at bakery.bagel.net and get an API key. Then set the BAGEL_API_KEY environment variable.', details: error.message }); }