yb
yb
Explore posts from servers
CDCloudflare Developers
Created by yb on 4/14/2025 in #workers-help
Batch API Access for `@cf/meta/llama-3.3-70b-instruct-batch`
Hello, I'm currently testing the Workers AI Batch API functionality with LLM models, and I've encountered some issues that I’d like clarification on. Attempt 1: @cf/meta/llama-3.3-70b-instruct-fp8-fast I tried to batch multiple requests to this model using the following code:
const batchResult = await AI.run('@cf/meta/llama-3.3-70b-instruct-fp8-fast', {
requests: batchMessages,
}, {
queueRequest: true,
});
const batchResult = await AI.run('@cf/meta/llama-3.3-70b-instruct-fp8-fast', {
requests: batchMessages,
}, {
queueRequest: true,
});
However, I received this error:
Error: 8007: This model does not support request queuing
Error: 8007: This model does not support request queuing
This seems to indicate that batching is not supported for this model, even though it's one of the newest. Attempt 2: @cf/meta/llama-3.3-70b-instruct-batch After reviewing your blog post, I attempted to use this alternative model for batching. However, I received the following error:
Error: 5018: This account is not allowed to access this model
Error: 5018: This account is not allowed to access this model
This makes me wonder: 1. Is @cf/meta/llama-3.3-70b-instruct-batch still in alpha or limited-access only? 2. When will batching be supported for @cf/meta/llama-3.3-70b-instruct-fp8-fast, if at all? 3. Is there a recommended LLM model that supports batching for general instruction-following tasks?
1 replies
지급대행 Encryption Javascript 버전
import { compactDecrypt, CompactEncrypt } from 'jose';
import { uuidv4 } from 'lib0/random';

const encrypt = async (target: object, securityKey: string) => {
// securityKey is a 64 character Hexadecimal string, change it to a byte array
const key = Buffer.from(securityKey, 'hex');
const keyInUint8Array = new Uint8Array(key);
const payload = JSON.stringify(target);
const payloadAsUint8Array = new TextEncoder().encode(payload);

const encryption = new CompactEncrypt(payloadAsUint8Array);
const encrypted = await encryption
.setProtectedHeader({
alg: 'dir',
enc: 'A256GCM',
iat: new Date().toISOString(),
nonce: uuidv4(),
})
.encrypt(keyInUint8Array);
return encrypted;
};

const decrypt = async (encrypted: string, securityKey: string) => {
const key = Buffer.from(securityKey, 'hex');

const keyInUint8Array = new Uint8Array(key);
const decryption = await compactDecrypt(encrypted, keyInUint8Array);
const plainTextInUint8Array = decryption.plaintext;
// decode the plain text from Uint8Array to string in utf-8
const plainText = new TextDecoder().decode(plainTextInUint8Array);
return JSON.parse(plainText) as object;
};

export { encrypt, decrypt };
import { compactDecrypt, CompactEncrypt } from 'jose';
import { uuidv4 } from 'lib0/random';

const encrypt = async (target: object, securityKey: string) => {
// securityKey is a 64 character Hexadecimal string, change it to a byte array
const key = Buffer.from(securityKey, 'hex');
const keyInUint8Array = new Uint8Array(key);
const payload = JSON.stringify(target);
const payloadAsUint8Array = new TextEncoder().encode(payload);

const encryption = new CompactEncrypt(payloadAsUint8Array);
const encrypted = await encryption
.setProtectedHeader({
alg: 'dir',
enc: 'A256GCM',
iat: new Date().toISOString(),
nonce: uuidv4(),
})
.encrypt(keyInUint8Array);
return encrypted;
};

const decrypt = async (encrypted: string, securityKey: string) => {
const key = Buffer.from(securityKey, 'hex');

const keyInUint8Array = new Uint8Array(key);
const decryption = await compactDecrypt(encrypted, keyInUint8Array);
const plainTextInUint8Array = decryption.plaintext;
// decode the plain text from Uint8Array to string in utf-8
const plainText = new TextDecoder().decode(plainTextInUint8Array);
return JSON.parse(plainText) as object;
};

export { encrypt, decrypt };
Node 환경에서 구현한 간단한 예시입니다 🙂
6 replies
테스트 환경에서 셀러 등록
라이브 버전의 시크릿키와 보안 키로는 셀러 등록(POST /v2/sellers)이 정상적으로 요청되나, 테스트 버전의 시크릿키와 보안 키로 호출 시
{
version: '2022-11-16',
traceId: 'ec3f43ec91c7383dd757f199f3fcf72e',
entityBody: null,
entityType: null,
error: { code: 'FORBIDDEN_REQUEST', message: 'Not allowed request' }
}
{
version: '2022-11-16',
traceId: 'ec3f43ec91c7383dd757f199f3fcf72e',
entityBody: null,
entityType: null,
error: { code: 'FORBIDDEN_REQUEST', message: 'Not allowed request' }
}
아래와 같은 결과를 얻습니다. 혹시 지원하지 않는 기능인가요?
6 replies
테스트 시크릿키와 보안키를 통한 셀러 등록
No description
7 replies